diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index b84be386aa817..91b768f5e561e 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -479,6 +479,7 @@ com.azure.resourcemanager:azure-resourcemanager-containerorchestratorruntime;1.0 com.azure.resourcemanager:azure-resourcemanager-terraform;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-connectedcache;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-neonpostgres;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-storage-generated;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 io.clientcore:clientcore-parent;1.0.0-beta.1;1.0.0-beta.1 diff --git a/sdk/storage/azure-resourcemanager-storage-generated/CHANGELOG.md b/sdk/storage/azure-resourcemanager-storage-generated/CHANGELOG.md new file mode 100644 index 0000000000000..c805a41c209aa --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/CHANGELOG.md @@ -0,0 +1,8 @@ +# Release History + +## 1.0.0-beta.1 (2024-12-18) + +- Azure Resource Manager Storage client library for Java. This package contains Microsoft Azure SDK for Storage Management SDK. The Azure Storage Management API. Package tag package-2024-01. 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-storage-generated Java SDK. diff --git a/sdk/storage/azure-resourcemanager-storage-generated/README.md b/sdk/storage/azure-resourcemanager-storage-generated/README.md new file mode 100644 index 0000000000000..6bc3a74c387c1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/README.md @@ -0,0 +1,104 @@ +# Azure Resource Manager Storage client library for Java + +Azure Resource Manager Storage client library for Java. + +This package contains Microsoft Azure SDK for Storage Management SDK. The Azure Storage Management API. Package tag package-2024-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-storage-generated;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-storage-generated + 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(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +StorageManager manager = StorageManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-resourcemanager-storage-generated/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/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fstorage%2Fazure-resourcemanager-storage-generated%2FREADME.png) diff --git a/sdk/storage/azure-resourcemanager-storage-generated/SAMPLE.md b/sdk/storage/azure-resourcemanager-storage-generated/SAMPLE.md new file mode 100644 index 0000000000000..b10329610584b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/SAMPLE.md @@ -0,0 +1,5080 @@ +# Code snippets and samples + + +## BlobContainers + +- [ClearLegalHold](#blobcontainers_clearlegalhold) +- [Create](#blobcontainers_create) +- [CreateOrUpdateImmutabilityPolicy](#blobcontainers_createorupdateimmutabilitypolicy) +- [Delete](#blobcontainers_delete) +- [DeleteImmutabilityPolicy](#blobcontainers_deleteimmutabilitypolicy) +- [ExtendImmutabilityPolicy](#blobcontainers_extendimmutabilitypolicy) +- [Get](#blobcontainers_get) +- [GetImmutabilityPolicy](#blobcontainers_getimmutabilitypolicy) +- [Lease](#blobcontainers_lease) +- [List](#blobcontainers_list) +- [LockImmutabilityPolicy](#blobcontainers_lockimmutabilitypolicy) +- [ObjectLevelWorm](#blobcontainers_objectlevelworm) +- [SetLegalHold](#blobcontainers_setlegalhold) +- [Update](#blobcontainers_update) + +## BlobInventoryPolicies + +- [CreateOrUpdate](#blobinventorypolicies_createorupdate) +- [Delete](#blobinventorypolicies_delete) +- [Get](#blobinventorypolicies_get) +- [List](#blobinventorypolicies_list) + +## BlobServices + +- [GetServiceProperties](#blobservices_getserviceproperties) +- [List](#blobservices_list) +- [SetServiceProperties](#blobservices_setserviceproperties) + +## DeletedAccounts + +- [Get](#deletedaccounts_get) +- [List](#deletedaccounts_list) + +## EncryptionScopes + +- [Get](#encryptionscopes_get) +- [List](#encryptionscopes_list) +- [Patch](#encryptionscopes_patch) +- [Put](#encryptionscopes_put) + +## FileServices + +- [GetServiceProperties](#fileservices_getserviceproperties) +- [GetServiceUsage](#fileservices_getserviceusage) +- [List](#fileservices_list) +- [ListServiceUsages](#fileservices_listserviceusages) +- [SetServiceProperties](#fileservices_setserviceproperties) + +## FileShares + +- [Create](#fileshares_create) +- [Delete](#fileshares_delete) +- [Get](#fileshares_get) +- [Lease](#fileshares_lease) +- [List](#fileshares_list) +- [Restore](#fileshares_restore) +- [Update](#fileshares_update) + +## LocalUsersOperation + +- [CreateOrUpdate](#localusersoperation_createorupdate) +- [Delete](#localusersoperation_delete) +- [Get](#localusersoperation_get) +- [List](#localusersoperation_list) +- [ListKeys](#localusersoperation_listkeys) +- [RegeneratePassword](#localusersoperation_regeneratepassword) + +## ManagementPolicies + +- [CreateOrUpdate](#managementpolicies_createorupdate) +- [Delete](#managementpolicies_delete) +- [Get](#managementpolicies_get) + +## NetworkSecurityPerimeterConfigurations + +- [Get](#networksecurityperimeterconfigurations_get) +- [List](#networksecurityperimeterconfigurations_list) +- [Reconcile](#networksecurityperimeterconfigurations_reconcile) + +## ObjectReplicationPoliciesOperation + +- [CreateOrUpdate](#objectreplicationpoliciesoperation_createorupdate) +- [Delete](#objectreplicationpoliciesoperation_delete) +- [Get](#objectreplicationpoliciesoperation_get) +- [List](#objectreplicationpoliciesoperation_list) + +## Operations + +- [List](#operations_list) + +## PrivateEndpointConnections + +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [List](#privateendpointconnections_list) +- [Put](#privateendpointconnections_put) + +## PrivateLinkResources + +- [ListByStorageAccount](#privatelinkresources_listbystorageaccount) + +## Queue + +- [Create](#queue_create) +- [Delete](#queue_delete) +- [Get](#queue_get) +- [List](#queue_list) +- [Update](#queue_update) + +## QueueServices + +- [GetServiceProperties](#queueservices_getserviceproperties) +- [List](#queueservices_list) +- [SetServiceProperties](#queueservices_setserviceproperties) + +## Skus + +- [List](#skus_list) + +## StorageAccounts + +- [AbortHierarchicalNamespaceMigration](#storageaccounts_aborthierarchicalnamespacemigration) +- [CheckNameAvailability](#storageaccounts_checknameavailability) +- [Create](#storageaccounts_create) +- [CustomerInitiatedMigration](#storageaccounts_customerinitiatedmigration) +- [Delete](#storageaccounts_delete) +- [Failover](#storageaccounts_failover) +- [GetByResourceGroup](#storageaccounts_getbyresourcegroup) +- [GetCustomerInitiatedMigration](#storageaccounts_getcustomerinitiatedmigration) +- [HierarchicalNamespaceMigration](#storageaccounts_hierarchicalnamespacemigration) +- [List](#storageaccounts_list) +- [ListAccountSas](#storageaccounts_listaccountsas) +- [ListByResourceGroup](#storageaccounts_listbyresourcegroup) +- [ListKeys](#storageaccounts_listkeys) +- [ListServiceSas](#storageaccounts_listservicesas) +- [RegenerateKey](#storageaccounts_regeneratekey) +- [RestoreBlobRanges](#storageaccounts_restoreblobranges) +- [RevokeUserDelegationKeys](#storageaccounts_revokeuserdelegationkeys) +- [Update](#storageaccounts_update) + +## StorageTaskAssignmentInstancesReport + +- [List](#storagetaskassignmentinstancesreport_list) + +## StorageTaskAssignments + +- [Create](#storagetaskassignments_create) +- [Delete](#storagetaskassignments_delete) +- [Get](#storagetaskassignments_get) +- [List](#storagetaskassignments_list) +- [Update](#storagetaskassignments_update) + +## StorageTaskAssignmentsInstancesReport + +- [List](#storagetaskassignmentsinstancesreport_list) + +## Table + +- [Create](#table_create) +- [Delete](#table_delete) +- [Get](#table_get) +- [List](#table_list) +- [Update](#table_update) + +## TableServices + +- [GetServiceProperties](#tableservices_getserviceproperties) +- [List](#tableservices_list) +- [SetServiceProperties](#tableservices_setserviceproperties) + +## Usages + +- [ListByLocation](#usages_listbylocation) +### BlobContainers_ClearLegalHold + +```java +import com.azure.resourcemanager.storage.generated.fluent.models.LegalHoldInner; +import java.util.Arrays; + +/** + * Samples for BlobContainers ClearLegalHold. + */ +public final class BlobContainersClearLegalHoldSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/BlobContainersClearLegalHold. + * json + */ + /** + * Sample code: ClearLegalHoldContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void clearLegalHoldContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .clearLegalHoldWithResponse("res4303", "sto7280", "container8723", + new LegalHoldInner().withTags(Arrays.asList("tag1", "tag2", "tag3")), com.azure.core.util.Context.NONE); + } +} +``` + +### BlobContainers_Create + +```java +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageWithVersioning; + +/** + * Samples for BlobContainers Create. + */ +public final class BlobContainersCreateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * BlobContainersPutDefaultEncryptionScope.json + */ + /** + * Sample code: PutContainerWithDefaultEncryptionScope. + * + * @param manager Entry point to StorageManager. + */ + public static void + putContainerWithDefaultEncryptionScope(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .define("container6185") + .withExistingStorageAccount("res3376", "sto328") + .withDefaultEncryptionScope("encryptionscope185") + .withDenyEncryptionScopeOverride(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * BlobContainersPutObjectLevelWorm.json + */ + /** + * Sample code: PutContainerWithObjectLevelWorm. + * + * @param manager Entry point to StorageManager. + */ + public static void + putContainerWithObjectLevelWorm(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .define("container6185") + .withExistingStorageAccount("res3376", "sto328") + .withImmutableStorageWithVersioning(new ImmutableStorageWithVersioning().withEnabled(true)) + .create(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/BlobContainersPut.json + */ + /** + * Sample code: PutContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void putContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers().define("container6185").withExistingStorageAccount("res3376", "sto328").create(); + } +} +``` + +### BlobContainers_CreateOrUpdateImmutabilityPolicy + +```java +/** + * Samples for BlobContainers CreateOrUpdateImmutabilityPolicy. + */ +public final class BlobContainersCreateOrUpdateImmutabilityPolicySamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * BlobContainersPutImmutabilityPolicy.json + */ + /** + * Sample code: CreateOrUpdateImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void + createOrUpdateImmutabilityPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .defineImmutabilityPolicy() + .withExistingContainer("res1782", "sto7069", "container6397") + .withImmutabilityPeriodSinceCreationInDays(3) + .withAllowProtectedAppendWrites(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * BlobContainersPutImmutabilityPolicyAllowProtectedAppendWritesAll.json + */ + /** + * Sample code: CreateOrUpdateImmutabilityPolicyWithAllowProtectedAppendWritesAll. + * + * @param manager Entry point to StorageManager. + */ + public static void createOrUpdateImmutabilityPolicyWithAllowProtectedAppendWritesAll( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .defineImmutabilityPolicy() + .withExistingContainer("res1782", "sto7069", "container6397") + .withImmutabilityPeriodSinceCreationInDays(3) + .withAllowProtectedAppendWritesAll(true) + .create(); + } +} +``` + +### BlobContainers_Delete + +```java +/** + * Samples for BlobContainers Delete. + */ +public final class BlobContainersDeleteSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/BlobContainersDelete.json + */ + /** + * Sample code: DeleteContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void deleteContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .deleteWithResponse("res4079", "sto4506", "container9689", com.azure.core.util.Context.NONE); + } +} +``` + +### BlobContainers_DeleteImmutabilityPolicy + +```java +/** + * Samples for BlobContainers DeleteImmutabilityPolicy. + */ +public final class BlobContainersDeleteImmutabilityPolicySamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * BlobContainersDeleteImmutabilityPolicy.json + */ + /** + * Sample code: DeleteImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void deleteImmutabilityPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .deleteImmutabilityPolicyWithResponse("res1581", "sto9621", "container4910", "8d59f81a7fa7be0", + com.azure.core.util.Context.NONE); + } +} +``` + +### BlobContainers_ExtendImmutabilityPolicy + +```java +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner; + +/** + * Samples for BlobContainers ExtendImmutabilityPolicy. + */ +public final class BlobContainersExtendImmutabilityPolicySamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * BlobContainersExtendImmutabilityPolicy.json + */ + /** + * Sample code: ExtendImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void extendImmutabilityPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .extendImmutabilityPolicyWithResponse("res6238", "sto232", "container5023", "8d59f830d0c3bf9", + new ImmutabilityPolicyInner().withImmutabilityPeriodSinceCreationInDays(100), + com.azure.core.util.Context.NONE); + } +} +``` + +### BlobContainers_Get + +```java +/** + * Samples for BlobContainers Get. + */ +public final class BlobContainersGetSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/BlobContainersGet.json + */ + /** + * Sample code: GetContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void getContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .getWithResponse("res9871", "sto6217", "container1634", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * BlobContainersGetWithAllowProtectedAppendWritesAll.json + */ + /** + * Sample code: GetBlobContainersGetWithAllowProtectedAppendWritesAll. + * + * @param manager Entry point to StorageManager. + */ + public static void getBlobContainersGetWithAllowProtectedAppendWritesAll( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .getWithResponse("res9871", "sto6217", "container1634", com.azure.core.util.Context.NONE); + } +} +``` + +### BlobContainers_GetImmutabilityPolicy + +```java +/** + * Samples for BlobContainers GetImmutabilityPolicy. + */ +public final class BlobContainersGetImmutabilityPolicySamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * BlobContainersGetImmutabilityPolicy.json + */ + /** + * Sample code: GetImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void getImmutabilityPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .getImmutabilityPolicyWithResponse("res5221", "sto9177", "container3489", null, + com.azure.core.util.Context.NONE); + } +} +``` + +### BlobContainers_Lease + +```java +import com.azure.resourcemanager.storage.generated.models.LeaseContainerRequest; +import com.azure.resourcemanager.storage.generated.models.LeaseContainerRequestAction; + +/** + * Samples for BlobContainers Lease. + */ +public final class BlobContainersLeaseSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/BlobContainersLease_Break. + * json + */ + /** + * Sample code: Break a lease on a container. + * + * @param manager Entry point to StorageManager. + */ + public static void breakALeaseOnAContainer(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .leaseWithResponse("res3376", "sto328", "container6185", + new LeaseContainerRequest().withAction(LeaseContainerRequestAction.BREAK) + .withLeaseId("8698f513-fa75-44a1-b8eb-30ba336af27d"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/BlobContainersLease_Acquire. + * json + */ + /** + * Sample code: Acquire a lease on a container. + * + * @param manager Entry point to StorageManager. + */ + public static void acquireALeaseOnAContainer(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .leaseWithResponse("res3376", "sto328", "container6185", + new LeaseContainerRequest().withAction(LeaseContainerRequestAction.ACQUIRE).withLeaseDuration(-1), + com.azure.core.util.Context.NONE); + } +} +``` + +### BlobContainers_List + +```java +import com.azure.resourcemanager.storage.generated.models.ListContainersInclude; + +/** + * Samples for BlobContainers List. + */ +public final class BlobContainersListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/BlobContainersList.json + */ + /** + * Sample code: ListContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void listContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers().list("res9290", "sto1590", null, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/DeletedBlobContainersList. + * json + */ + /** + * Sample code: ListDeletedContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void listDeletedContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .list("res9290", "sto1590", null, null, ListContainersInclude.DELETED, com.azure.core.util.Context.NONE); + } +} +``` + +### BlobContainers_LockImmutabilityPolicy + +```java +/** + * Samples for BlobContainers LockImmutabilityPolicy. + */ +public final class BlobContainersLockImmutabilityPolicySamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * BlobContainersLockImmutabilityPolicy.json + */ + /** + * Sample code: LockImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void lockImmutabilityPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .lockImmutabilityPolicyWithResponse("res2702", "sto5009", "container1631", "8d59f825b721dd3", + com.azure.core.util.Context.NONE); + } +} +``` + +### BlobContainers_ObjectLevelWorm + +```java +/** + * Samples for BlobContainers ObjectLevelWorm. + */ +public final class BlobContainersObjectLevelWormSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * ObjectLevelWormContainerMigration.json + */ + /** + * Sample code: VersionLevelWormContainerMigration. + * + * @param manager Entry point to StorageManager. + */ + public static void + versionLevelWormContainerMigration(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .objectLevelWorm("res1782", "sto7069", "container6397", com.azure.core.util.Context.NONE); + } +} +``` + +### BlobContainers_SetLegalHold + +```java +import com.azure.resourcemanager.storage.generated.fluent.models.LegalHoldInner; +import java.util.Arrays; + +/** + * Samples for BlobContainers SetLegalHold. + */ +public final class BlobContainersSetLegalHoldSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/BlobContainersSetLegalHold. + * json + */ + /** + * Sample code: SetLegalHoldContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void setLegalHoldContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .setLegalHoldWithResponse("res4303", "sto7280", "container8723", + new LegalHoldInner().withTags(Arrays.asList("tag1", "tag2", "tag3")), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * BlobContainersSetLegalHoldAllowProtectedAppendWritesAll.json + */ + /** + * Sample code: SetLegalHoldContainersWithAllowProtectedAppendWritesAll. + * + * @param manager Entry point to StorageManager. + */ + public static void setLegalHoldContainersWithAllowProtectedAppendWritesAll( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .setLegalHoldWithResponse("res4303", "sto7280", "container8723", + new LegalHoldInner().withTags(Arrays.asList("tag1", "tag2", "tag3")) + .withAllowProtectedAppendWritesAll(true), + com.azure.core.util.Context.NONE); + } +} +``` + +### BlobContainers_Update + +```java +import com.azure.resourcemanager.storage.generated.models.BlobContainer; +import com.azure.resourcemanager.storage.generated.models.PublicAccess; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for BlobContainers Update. + */ +public final class BlobContainersUpdateSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/BlobContainersPatch.json + */ + /** + * Sample code: UpdateContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void updateContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + BlobContainer resource = manager.blobContainers() + .getWithResponse("res3376", "sto328", "container6185", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withPublicAccess(PublicAccess.CONTAINER).withMetadata(mapOf("metadata", "true")).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; + } +} +``` + +### BlobInventoryPolicies_CreateOrUpdate + +```java +import com.azure.resourcemanager.storage.generated.models.BlobInventoryCreationTime; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyDefinition; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyFilter; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyName; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyRule; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicySchema; +import com.azure.resourcemanager.storage.generated.models.Format; +import com.azure.resourcemanager.storage.generated.models.InventoryRuleType; +import com.azure.resourcemanager.storage.generated.models.ObjectType; +import com.azure.resourcemanager.storage.generated.models.Schedule; +import java.util.Arrays; + +/** + * Samples for BlobInventoryPolicies CreateOrUpdate. + */ +public final class BlobInventoryPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountSetBlobInventoryPolicyIncludeDeleteAndNewSchemaForNonHnsAccount.json + */ + /** + * Sample code: StorageAccountSetBlobInventoryPolicyIncludeDeleteAndNewSchemaForNonHnsAccount. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetBlobInventoryPolicyIncludeDeleteAndNewSchemaForNonHnsAccount( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobInventoryPolicies() + .define(BlobInventoryPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy(new BlobInventoryPolicySchema().withEnabled(true) + .withType(InventoryRuleType.INVENTORY) + .withRules(Arrays.asList( + new BlobInventoryPolicyRule().withEnabled(true) + .withName("inventoryPolicyRule1") + .withDestination("container1") + .withDefinition(new BlobInventoryPolicyDefinition() + .withFilters(new BlobInventoryPolicyFilter() + .withPrefixMatch(Arrays.asList("inventoryprefix1", "inventoryprefix2")) + .withExcludePrefix(Arrays.asList("excludeprefix1", "excludeprefix2")) + .withBlobTypes(Arrays.asList("blockBlob", "appendBlob", "pageBlob")) + .withIncludeBlobVersions(true) + .withIncludeSnapshots(true) + .withIncludeDeleted(true)) + .withFormat(Format.CSV) + .withSchedule(Schedule.DAILY) + .withObjectType(ObjectType.BLOB) + .withSchemaFields( + Arrays.asList("Name", "Creation-Time", "Last-Modified", "Content-Length", "Content-MD5", + "BlobType", "AccessTier", "AccessTierChangeTime", "Snapshot", "VersionId", + "IsCurrentVersion", "Tags", "ContentType", "ContentEncoding", "ContentLanguage", + "ContentCRC64", "CacheControl", "Metadata", "Deleted", "RemainingRetentionDays"))), + new BlobInventoryPolicyRule().withEnabled(true) + .withName("inventoryPolicyRule2") + .withDestination("container2") + .withDefinition(new BlobInventoryPolicyDefinition().withFormat(Format.PARQUET) + .withSchedule(Schedule.WEEKLY) + .withObjectType(ObjectType.CONTAINER) + .withSchemaFields(Arrays.asList("Name", "Last-Modified", "Metadata", "LeaseStatus", + "LeaseState", "LeaseDuration", "PublicAccess", "HasImmutabilityPolicy", "HasLegalHold", + "Etag", "DefaultEncryptionScope", "DenyEncryptionScopeOverride", + "ImmutableStorageWithVersioningEnabled", "Deleted", "Version", "DeletedTime", + "RemainingRetentionDays")))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountSetBlobInventoryPolicy.json + */ + /** + * Sample code: StorageAccountSetBlobInventoryPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountSetBlobInventoryPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobInventoryPolicies() + .define(BlobInventoryPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new BlobInventoryPolicySchema().withEnabled(true) + .withType(InventoryRuleType.INVENTORY) + .withRules(Arrays.asList( + new BlobInventoryPolicyRule().withEnabled(true) + .withName("inventoryPolicyRule1") + .withDestination("container1") + .withDefinition(new BlobInventoryPolicyDefinition() + .withFilters(new BlobInventoryPolicyFilter() + .withPrefixMatch(Arrays.asList("inventoryprefix1", "inventoryprefix2")) + .withBlobTypes(Arrays.asList("blockBlob", "appendBlob", "pageBlob")) + .withIncludeBlobVersions(true) + .withIncludeSnapshots(true) + .withCreationTime(new BlobInventoryCreationTime().withLastNDays(1000))) + .withFormat(Format.CSV) + .withSchedule(Schedule.DAILY) + .withObjectType(ObjectType.BLOB) + .withSchemaFields(Arrays.asList("Name", "Creation-Time", "Last-Modified", + "Content-Length", "Content-MD5", "BlobType", "AccessTier", "AccessTierChangeTime", + "Snapshot", "VersionId", "IsCurrentVersion", "Metadata"))), + new BlobInventoryPolicyRule().withEnabled(true) + .withName("inventoryPolicyRule2") + .withDestination("container2") + .withDefinition( + new BlobInventoryPolicyDefinition().withFormat(Format.PARQUET) + .withSchedule(Schedule.WEEKLY) + .withObjectType(ObjectType.CONTAINER) + .withSchemaFields(Arrays.asList("Name", "Last-Modified", "Metadata", "LeaseStatus", + "LeaseState", "LeaseDuration", "PublicAccess", "HasImmutabilityPolicy", + "HasLegalHold")))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountSetBlobInventoryPolicyIncludeDeleteAndNewSchemaForHnsAccount.json + */ + /** + * Sample code: StorageAccountSetBlobInventoryPolicyIncludeDeleteAndNewSchemaForHnsAccount. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetBlobInventoryPolicyIncludeDeleteAndNewSchemaForHnsAccount( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobInventoryPolicies() + .define(BlobInventoryPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy(new BlobInventoryPolicySchema().withEnabled(true) + .withType(InventoryRuleType.INVENTORY) + .withRules(Arrays.asList( + new BlobInventoryPolicyRule().withEnabled(true) + .withName("inventoryPolicyRule1") + .withDestination("container1") + .withDefinition(new BlobInventoryPolicyDefinition() + .withFilters(new BlobInventoryPolicyFilter() + .withPrefixMatch(Arrays.asList("inventoryprefix1", "inventoryprefix2")) + .withExcludePrefix(Arrays.asList("excludeprefix1", "excludeprefix2")) + .withBlobTypes(Arrays.asList("blockBlob", "appendBlob", "pageBlob")) + .withIncludeBlobVersions(true) + .withIncludeSnapshots(true) + .withIncludeDeleted(true)) + .withFormat(Format.CSV) + .withSchedule(Schedule.DAILY) + .withObjectType(ObjectType.BLOB) + .withSchemaFields(Arrays.asList("Name", "Creation-Time", "Last-Modified", "Content-Length", + "Content-MD5", "BlobType", "AccessTier", "AccessTierChangeTime", "Snapshot", + "VersionId", "IsCurrentVersion", "ContentType", "ContentEncoding", "ContentLanguage", + "ContentCRC64", "CacheControl", "Metadata", "DeletionId", "Deleted", "DeletedTime", + "RemainingRetentionDays"))), + new BlobInventoryPolicyRule().withEnabled(true) + .withName("inventoryPolicyRule2") + .withDestination("container2") + .withDefinition(new BlobInventoryPolicyDefinition().withFormat(Format.PARQUET) + .withSchedule(Schedule.WEEKLY) + .withObjectType(ObjectType.CONTAINER) + .withSchemaFields(Arrays.asList("Name", "Last-Modified", "Metadata", "LeaseStatus", + "LeaseState", "LeaseDuration", "PublicAccess", "HasImmutabilityPolicy", "HasLegalHold", + "Etag", "DefaultEncryptionScope", "DenyEncryptionScopeOverride", + "ImmutableStorageWithVersioningEnabled", "Deleted", "Version", "DeletedTime", + "RemainingRetentionDays")))))) + .create(); + } +} +``` + +### BlobInventoryPolicies_Delete + +```java +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyName; + +/** + * Samples for BlobInventoryPolicies Delete. + */ +public final class BlobInventoryPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountDeleteBlobInventoryPolicy.json + */ + /** + * Sample code: StorageAccountDeleteBlobInventoryPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountDeleteBlobInventoryPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobInventoryPolicies() + .deleteWithResponse("res6977", "sto2527", BlobInventoryPolicyName.DEFAULT, + com.azure.core.util.Context.NONE); + } +} +``` + +### BlobInventoryPolicies_Get + +```java +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyName; + +/** + * Samples for BlobInventoryPolicies Get. + */ +public final class BlobInventoryPoliciesGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountGetBlobInventoryPolicy.json + */ + /** + * Sample code: StorageAccountGetBlobInventoryPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountGetBlobInventoryPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobInventoryPolicies() + .getWithResponse("res7687", "sto9699", BlobInventoryPolicyName.DEFAULT, com.azure.core.util.Context.NONE); + } +} +``` + +### BlobInventoryPolicies_List + +```java +/** + * Samples for BlobInventoryPolicies List. + */ +public final class BlobInventoryPoliciesListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountListBlobInventoryPolicy.json + */ + /** + * Sample code: StorageAccountGetBlobInventoryPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountGetBlobInventoryPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobInventoryPolicies().list("res7687", "sto9699", com.azure.core.util.Context.NONE); + } +} +``` + +### BlobServices_GetServiceProperties + +```java +/** + * Samples for BlobServices GetServiceProperties. + */ +public final class BlobServicesGetServicePropertiesSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/BlobServicesGet.json + */ + /** + * Sample code: GetBlobServices. + * + * @param manager Entry point to StorageManager. + */ + public static void getBlobServices(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobServices().getServicePropertiesWithResponse("res4410", "sto8607", com.azure.core.util.Context.NONE); + } +} +``` + +### BlobServices_List + +```java +/** + * Samples for BlobServices List. + */ +public final class BlobServicesListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/BlobServicesList.json + */ + /** + * Sample code: ListBlobServices. + * + * @param manager Entry point to StorageManager. + */ + public static void listBlobServices(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobServices().list("res4410", "sto8607", com.azure.core.util.Context.NONE); + } +} +``` + +### BlobServices_SetServiceProperties + +```java +import com.azure.resourcemanager.storage.generated.models.AllowedMethods; +import com.azure.resourcemanager.storage.generated.models.ChangeFeed; +import com.azure.resourcemanager.storage.generated.models.CorsRule; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.azure.resourcemanager.storage.generated.models.DeleteRetentionPolicy; +import com.azure.resourcemanager.storage.generated.models.LastAccessTimeTrackingPolicy; +import com.azure.resourcemanager.storage.generated.models.Name; +import java.util.Arrays; + +/** + * Samples for BlobServices SetServiceProperties. + */ +public final class BlobServicesSetServicePropertiesSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/BlobServicesPut.json + */ + /** + * Sample code: PutBlobServices. + * + * @param manager Entry point to StorageManager. + */ + public static void putBlobServices(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withCors(new CorsRules().withCorsRules(Arrays.asList( + new CorsRule().withAllowedOrigins(Arrays.asList("http://www.contoso.com", "http://www.fabrikam.com")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET, AllowedMethods.HEAD, AllowedMethods.POST, + AllowedMethods.OPTIONS, AllowedMethods.MERGE, AllowedMethods.PUT)) + .withMaxAgeInSeconds(100) + .withExposedHeaders(Arrays.asList("x-ms-meta-*")) + .withAllowedHeaders(Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")), + new CorsRule().withAllowedOrigins(Arrays.asList("*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET)) + .withMaxAgeInSeconds(2) + .withExposedHeaders(Arrays.asList("*")) + .withAllowedHeaders(Arrays.asList("*")), + new CorsRule().withAllowedOrigins(Arrays.asList("http://www.abc23.com", "https://www.fabrikam.com/*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET, AllowedMethods.PUT)) + .withMaxAgeInSeconds(2000) + .withExposedHeaders(Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x -ms-meta-target*")) + .withAllowedHeaders(Arrays.asList("x-ms-meta-12345675754564*"))))) + .withDefaultServiceVersion("2017-07-29") + .withDeleteRetentionPolicy(new DeleteRetentionPolicy().withEnabled(true).withDays(300)) + .withIsVersioningEnabled(true) + .withChangeFeed(new ChangeFeed().withEnabled(true).withRetentionInDays(7)) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * BlobServicesPutAllowPermanentDelete.json + */ + /** + * Sample code: BlobServicesPutAllowPermanentDelete. + * + * @param manager Entry point to StorageManager. + */ + public static void + blobServicesPutAllowPermanentDelete(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withDeleteRetentionPolicy( + new DeleteRetentionPolicy().withEnabled(true).withDays(300).withAllowPermanentDelete(true)) + .withIsVersioningEnabled(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * BlobServicesPutLastAccessTimeBasedTracking.json + */ + /** + * Sample code: BlobServicesPutLastAccessTimeBasedTracking. + * + * @param manager Entry point to StorageManager. + */ + public static void + blobServicesPutLastAccessTimeBasedTracking(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withLastAccessTimeTrackingPolicy(new LastAccessTimeTrackingPolicy().withEnable(true) + .withName(Name.ACCESS_TIME_TRACKING) + .withTrackingGranularityInDays(1) + .withBlobType(Arrays.asList("blockBlob"))) + .create(); + } +} +``` + +### DeletedAccounts_Get + +```java +/** + * Samples for DeletedAccounts Get. + */ +public final class DeletedAccountsGetSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/DeletedAccountGet.json + */ + /** + * Sample code: DeletedAccountGet. + * + * @param manager Entry point to StorageManager. + */ + public static void deletedAccountGet(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.deletedAccounts().getWithResponse("sto1125", "eastus", com.azure.core.util.Context.NONE); + } +} +``` + +### DeletedAccounts_List + +```java +/** + * Samples for DeletedAccounts List. + */ +public final class DeletedAccountsListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/DeletedAccountList.json + */ + /** + * Sample code: DeletedAccountList. + * + * @param manager Entry point to StorageManager. + */ + public static void deletedAccountList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.deletedAccounts().list(com.azure.core.util.Context.NONE); + } +} +``` + +### EncryptionScopes_Get + +```java +/** + * Samples for EncryptionScopes Get. + */ +public final class EncryptionScopesGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountGetEncryptionScope.json + */ + /** + * Sample code: StorageAccountGetEncryptionScope. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountGetEncryptionScope(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.encryptionScopes() + .getWithResponse("resource-group-name", "accountname", "{encryption-scope-name}", + com.azure.core.util.Context.NONE); + } +} +``` + +### EncryptionScopes_List + +```java + +/** + * Samples for EncryptionScopes List. + */ +public final class EncryptionScopesListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountEncryptionScopeList.json + */ + /** + * Sample code: StorageAccountEncryptionScopeList. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountEncryptionScopeList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.encryptionScopes() + .list("resource-group-name", "accountname", null, null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### EncryptionScopes_Patch + +```java +import com.azure.resourcemanager.storage.generated.models.EncryptionScope; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeKeyVaultProperties; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeSource; + +/** + * Samples for EncryptionScopes Patch. + */ +public final class EncryptionScopesPatchSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountPatchEncryptionScope.json + */ + /** + * Sample code: StorageAccountPatchEncryptionScope. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountPatchEncryptionScope(com.azure.resourcemanager.storage.generated.StorageManager manager) { + EncryptionScope resource = manager.encryptionScopes() + .getWithResponse("resource-group-name", "accountname", "{encryption-scope-name}", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withSource(EncryptionScopeSource.MICROSOFT_KEY_VAULT) + .withKeyVaultProperties(new EncryptionScopeKeyVaultProperties().withKeyUri("fakeTokenPlaceholder")) + .apply(); + } +} +``` + +### EncryptionScopes_Put + +```java +/** + * Samples for EncryptionScopes Put. + */ +public final class EncryptionScopesPutSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountPutEncryptionScopeWithInfrastructureEncryption.json + */ + /** + * Sample code: StorageAccountPutEncryptionScopeWithInfrastructureEncryption. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountPutEncryptionScopeWithInfrastructureEncryption( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.encryptionScopes() + .define("{encryption-scope-name}") + .withExistingStorageAccount("resource-group-name", "accountname") + .withRequireInfrastructureEncryption(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountPutEncryptionScope.json + */ + /** + * Sample code: StorageAccountPutEncryptionScope. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountPutEncryptionScope(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.encryptionScopes() + .define("{encryption-scope-name}") + .withExistingStorageAccount("resource-group-name", "accountname") + .create(); + } +} +``` + +### FileServices_GetServiceProperties + +```java +/** + * Samples for FileServices GetServiceProperties. + */ +public final class FileServicesGetServicePropertiesSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileServicesGet.json + */ + /** + * Sample code: GetFileServices. + * + * @param manager Entry point to StorageManager. + */ + public static void getFileServices(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileServices().getServicePropertiesWithResponse("res4410", "sto8607", com.azure.core.util.Context.NONE); + } +} +``` + +### FileServices_GetServiceUsage + +```java +/** + * Samples for FileServices GetServiceUsage. + */ +public final class FileServicesGetServiceUsageSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileServicesGetUsage.json + */ + /** + * Sample code: GetFileServiceUsage. + * + * @param manager Entry point to StorageManager. + */ + public static void getFileServiceUsage(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileServices().getServiceUsageWithResponse("res4410", "sto8607", com.azure.core.util.Context.NONE); + } +} +``` + +### FileServices_List + +```java +/** + * Samples for FileServices List. + */ +public final class FileServicesListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileServicesList.json + */ + /** + * Sample code: ListFileServices. + * + * @param manager Entry point to StorageManager. + */ + public static void listFileServices(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileServices().listWithResponse("res9290", "sto1590", com.azure.core.util.Context.NONE); + } +} +``` + +### FileServices_ListServiceUsages + +```java +/** + * Samples for FileServices ListServiceUsages. + */ +public final class FileServicesListServiceUsagesSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileServicesListUsages.json + */ + /** + * Sample code: ListFileServiceUsages. + * + * @param manager Entry point to StorageManager. + */ + public static void listFileServiceUsages(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileServices().listServiceUsages("res4410", "sto8607", null, com.azure.core.util.Context.NONE); + } +} +``` + +### FileServices_SetServiceProperties + +```java +import com.azure.resourcemanager.storage.generated.models.AllowedMethods; +import com.azure.resourcemanager.storage.generated.models.CorsRule; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.azure.resourcemanager.storage.generated.models.Multichannel; +import com.azure.resourcemanager.storage.generated.models.ProtocolSettings; +import com.azure.resourcemanager.storage.generated.models.SmbSetting; +import java.util.Arrays; + +/** + * Samples for FileServices SetServiceProperties. + */ +public final class FileServicesSetServicePropertiesSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileServicesPut.json + */ + /** + * Sample code: PutFileServices. + * + * @param manager Entry point to StorageManager. + */ + public static void putFileServices(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withCors(new CorsRules().withCorsRules(Arrays.asList( + new CorsRule().withAllowedOrigins(Arrays.asList("http://www.contoso.com", "http://www.fabrikam.com")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET, AllowedMethods.HEAD, AllowedMethods.POST, + AllowedMethods.OPTIONS, AllowedMethods.MERGE, AllowedMethods.PUT)) + .withMaxAgeInSeconds(100) + .withExposedHeaders(Arrays.asList("x-ms-meta-*")) + .withAllowedHeaders(Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")), + new CorsRule().withAllowedOrigins(Arrays.asList("*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET)) + .withMaxAgeInSeconds(2) + .withExposedHeaders(Arrays.asList("*")) + .withAllowedHeaders(Arrays.asList("*")), + new CorsRule().withAllowedOrigins(Arrays.asList("http://www.abc23.com", "https://www.fabrikam.com/*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET, AllowedMethods.PUT)) + .withMaxAgeInSeconds(2000) + .withExposedHeaders(Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")) + .withAllowedHeaders(Arrays.asList("x-ms-meta-12345675754564*"))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * FileServicesPut_EnableSecureSmbFeatures.json + */ + /** + * Sample code: PutFileServices_EnableSecureSmbFeatures. + * + * @param manager Entry point to StorageManager. + */ + public static void + putFileServicesEnableSecureSmbFeatures(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withProtocolSettings(new ProtocolSettings().withSmb(new SmbSetting().withVersions("SMB2.1;SMB3.0;SMB3.1.1") + .withAuthenticationMethods("NTLMv2;Kerberos") + .withKerberosTicketEncryption("RC4-HMAC;AES-256") + .withChannelEncryption("AES-128-CCM;AES-128-GCM;AES-256-GCM"))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * FileServicesPut_EnableSMBMultichannel.json + */ + /** + * Sample code: PutFileServices_EnableSMBMultichannel. + * + * @param manager Entry point to StorageManager. + */ + public static void + putFileServicesEnableSMBMultichannel(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withProtocolSettings( + new ProtocolSettings().withSmb(new SmbSetting().withMultichannel(new Multichannel().withEnabled(true)))) + .create(); + } +} +``` + +### FileShares_Create + +```java +import com.azure.resourcemanager.storage.generated.models.EnabledProtocols; +import com.azure.resourcemanager.storage.generated.models.FileSharePropertiesFileSharePaidBursting; +import com.azure.resourcemanager.storage.generated.models.ShareAccessTier; + +/** + * Samples for FileShares Create. + */ +public final class FileSharesCreateSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesPut_ProvisionedV2. + * json + */ + /** + * Sample code: PutSharesProvisionedV2. + * + * @param manager Entry point to StorageManager. + */ + public static void putSharesProvisionedV2(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares() + .define("share1235") + .withExistingStorageAccount("res346", "sto666") + .withShareQuota(100) + .withProvisionedIops(5000) + .withProvisionedBandwidthMibps(200) + .create(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesPut_AccessTier.json + */ + /** + * Sample code: PutShares with Access Tier. + * + * @param manager Entry point to StorageManager. + */ + public static void putSharesWithAccessTier(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares() + .define("share1235") + .withExistingStorageAccount("res346", "sto666") + .withAccessTier(ShareAccessTier.HOT) + .create(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesPut_NFS.json + */ + /** + * Sample code: Create NFS Shares. + * + * @param manager Entry point to StorageManager. + */ + public static void createNFSShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares() + .define("share1235") + .withExistingStorageAccount("res346", "sto666") + .withEnabledProtocols(EnabledProtocols.NFS) + .create(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesPut_PaidBursting. + * json + */ + /** + * Sample code: PutShares with Paid Bursting. + * + * @param manager Entry point to StorageManager. + */ + public static void putSharesWithPaidBursting(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares() + .define("share1235") + .withExistingStorageAccount("res346", "sto666") + .withFileSharePaidBursting(new FileSharePropertiesFileSharePaidBursting().withPaidBurstingEnabled(true) + .withPaidBurstingMaxIops(102400) + .withPaidBurstingMaxBandwidthMibps(10340)) + .create(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesPut.json + */ + /** + * Sample code: PutShares. + * + * @param manager Entry point to StorageManager. + */ + public static void putShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares().define("share6185").withExistingStorageAccount("res3376", "sto328").create(); + } +} +``` + +### FileShares_Delete + +```java +/** + * Samples for FileShares Delete. + */ +public final class FileSharesDeleteSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesDelete.json + */ + /** + * Sample code: DeleteShares. + * + * @param manager Entry point to StorageManager. + */ + public static void deleteShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares() + .deleteWithResponse("res4079", "sto4506", "share9689", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### FileShares_Get + +```java +/** + * Samples for FileShares Get. + */ +public final class FileSharesGetSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesGet_Stats.json + */ + /** + * Sample code: GetShareStats. + * + * @param manager Entry point to StorageManager. + */ + public static void getShareStats(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares() + .getWithResponse("res9871", "sto6217", "share1634", "stats", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesGet_PaidBursting. + * json + */ + /** + * Sample code: GetSharePaidBursting. + * + * @param manager Entry point to StorageManager. + */ + public static void getSharePaidBursting(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares() + .getWithResponse("res9871", "sto6217", "share1634", null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesGet_ProvisionedV2. + * json + */ + /** + * Sample code: GetShareProvisionedV2. + * + * @param manager Entry point to StorageManager. + */ + public static void getShareProvisionedV2(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares() + .getWithResponse("res9871", "sto6217", "share1634", null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesGet.json + */ + /** + * Sample code: GetShares. + * + * @param manager Entry point to StorageManager. + */ + public static void getShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares() + .getWithResponse("res9871", "sto6217", "share1634", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### FileShares_Lease + +```java +import com.azure.resourcemanager.storage.generated.models.LeaseShareAction; +import com.azure.resourcemanager.storage.generated.models.LeaseShareRequest; + +/** + * Samples for FileShares Lease. + */ +public final class FileSharesLeaseSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesLease_Break.json + */ + /** + * Sample code: Break a lease on a share. + * + * @param manager Entry point to StorageManager. + */ + public static void breakALeaseOnAShare(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares() + .leaseWithResponse("res3376", "sto328", "share12", null, + new LeaseShareRequest().withAction(LeaseShareAction.BREAK) + .withLeaseId("8698f513-fa75-44a1-b8eb-30ba336af27d"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesLease_Acquire.json + */ + /** + * Sample code: Acquire a lease on a share. + * + * @param manager Entry point to StorageManager. + */ + public static void acquireALeaseOnAShare(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares() + .leaseWithResponse("res3376", "sto328", "share124", null, + new LeaseShareRequest().withAction(LeaseShareAction.ACQUIRE).withLeaseDuration(-1), + com.azure.core.util.Context.NONE); + } +} +``` + +### FileShares_List + +```java +/** + * Samples for FileShares List. + */ +public final class FileSharesListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesList.json + */ + /** + * Sample code: ListShares. + * + * @param manager Entry point to StorageManager. + */ + public static void listShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares().list("res9290", "sto1590", null, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/DeletedFileSharesList.json + */ + /** + * Sample code: ListDeletedShares. + * + * @param manager Entry point to StorageManager. + */ + public static void listDeletedShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares().list("res9290", "sto1590", null, null, "deleted", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesList_ProvisionedV2. + * json + */ + /** + * Sample code: ListSharesProvisionedV2. + * + * @param manager Entry point to StorageManager. + */ + public static void listSharesProvisionedV2(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares().list("res9290", "sto1590", null, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileShareSnapshotsList.json + */ + /** + * Sample code: ListShareSnapshots. + * + * @param manager Entry point to StorageManager. + */ + public static void listShareSnapshots(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares().list("res9290", "sto1590", null, null, "snapshots", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesList_PaidBursting. + * json + */ + /** + * Sample code: ListSharesPaidBursting. + * + * @param manager Entry point to StorageManager. + */ + public static void listSharesPaidBursting(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares().list("res9290", "sto1590", null, null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### FileShares_Restore + +```java +import com.azure.resourcemanager.storage.generated.models.DeletedShare; + +/** + * Samples for FileShares Restore. + */ +public final class FileSharesRestoreSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesRestore.json + */ + /** + * Sample code: RestoreShares. + * + * @param manager Entry point to StorageManager. + */ + public static void restoreShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares() + .restoreWithResponse("res3376", "sto328", "share1249", + new DeletedShare().withDeletedShareName("share1249").withDeletedShareVersion("1234567890"), + com.azure.core.util.Context.NONE); + } +} +``` + +### FileShares_Update + +```java +import com.azure.resourcemanager.storage.generated.models.AccessPolicy; +import com.azure.resourcemanager.storage.generated.models.FileShare; +import com.azure.resourcemanager.storage.generated.models.FileSharePropertiesFileSharePaidBursting; +import com.azure.resourcemanager.storage.generated.models.SignedIdentifier; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FileShares Update. + */ +public final class FileSharesUpdateSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesPatch.json + */ + /** + * Sample code: UpdateShares. + * + * @param manager Entry point to StorageManager. + */ + public static void updateShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + FileShare resource = manager.fileShares() + .getWithResponse("res3376", "sto328", "share6185", null, null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withMetadata(mapOf("type", "image")).apply(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileShareAclsPatch.json + */ + /** + * Sample code: UpdateShareAcls. + * + * @param manager Entry point to StorageManager. + */ + public static void updateShareAcls(com.azure.resourcemanager.storage.generated.StorageManager manager) { + FileShare resource = manager.fileShares() + .getWithResponse("res3376", "sto328", "share6185", null, null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withSignedIdentifiers(Arrays.asList(new SignedIdentifier() + .withId("MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI") + .withAccessPolicy(new AccessPolicy().withStartTime(OffsetDateTime.parse("2021-04-01T08:49:37.0000000Z")) + .withExpiryTime(OffsetDateTime.parse("2021-05-01T08:49:37.0000000Z")) + .withPermission("rwd")))) + .apply(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesPatch_PaidBursting. + * json + */ + /** + * Sample code: UpdateSharePaidBursting. + * + * @param manager Entry point to StorageManager. + */ + public static void updateSharePaidBursting(com.azure.resourcemanager.storage.generated.StorageManager manager) { + FileShare resource = manager.fileShares() + .getWithResponse("res3376", "sto328", "share6185", null, null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withFileSharePaidBursting(new FileSharePropertiesFileSharePaidBursting().withPaidBurstingEnabled(true) + .withPaidBurstingMaxIops(102400) + .withPaidBurstingMaxBandwidthMibps(10340)) + .apply(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesPatch_ProvisionedV2 + * .json + */ + /** + * Sample code: UpdateShareProvisionedV2. + * + * @param manager Entry point to StorageManager. + */ + public static void updateShareProvisionedV2(com.azure.resourcemanager.storage.generated.StorageManager manager) { + FileShare resource = manager.fileShares() + .getWithResponse("res3376", "sto328", "share6185", null, null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withShareQuota(100).withProvisionedIops(5000).withProvisionedBandwidthMibps(200).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; + } +} +``` + +### LocalUsersOperation_CreateOrUpdate + +```java +import com.azure.resourcemanager.storage.generated.models.LocalUser; +import com.azure.resourcemanager.storage.generated.models.PermissionScope; +import com.azure.resourcemanager.storage.generated.models.SshPublicKey; +import java.util.Arrays; + +/** + * Samples for LocalUsersOperation CreateOrUpdate. + */ +public final class LocalUsersOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/LocalUserCreate.json + */ + /** + * Sample code: CreateLocalUser. + * + * @param manager Entry point to StorageManager. + */ + public static void createLocalUser(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.localUsersOperations() + .define("user1") + .withExistingStorageAccount("res6977", "sto2527") + .withPermissionScopes(Arrays.asList( + new PermissionScope().withPermissions("rwd").withService("file").withResourceName("share1"), + new PermissionScope().withPermissions("rw").withService("file").withResourceName("share2"))) + .withHomeDirectory("homedirectory") + .withSshAuthorizedKeys( + Arrays.asList(new SshPublicKey().withDescription("key name").withKey("fakeTokenPlaceholder"))) + .withHasSshPassword(true) + .withGroupId(2000) + .withAllowAclAuthorization(true) + .create(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/LocalUserCreateNFSv3Enabled. + * json + */ + /** + * Sample code: CreateNFSv3EnabledLocalUser. + * + * @param manager Entry point to StorageManager. + */ + public static void createNFSv3EnabledLocalUser(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.localUsersOperations() + .define("user1") + .withExistingStorageAccount("res6977", "sto2527") + .withExtendedGroups(Arrays.asList(1001, 1005, 2005)) + .withIsNFSv3Enabled(true) + .create(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/LocalUserUpdate.json + */ + /** + * Sample code: UpdateLocalUser. + * + * @param manager Entry point to StorageManager. + */ + public static void updateLocalUser(com.azure.resourcemanager.storage.generated.StorageManager manager) { + LocalUser resource = manager.localUsersOperations() + .getWithResponse("res6977", "sto2527", "user1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withHomeDirectory("homedirectory2") + .withHasSharedKey(false) + .withHasSshKey(false) + .withHasSshPassword(false) + .withGroupId(3000) + .withAllowAclAuthorization(false) + .withExtendedGroups(Arrays.asList(1001, 1005, 2005)) + .withIsNFSv3Enabled(true) + .apply(); + } +} +``` + +### LocalUsersOperation_Delete + +```java +/** + * Samples for LocalUsersOperation Delete. + */ +public final class LocalUsersOperationDeleteSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/LocalUserDelete.json + */ + /** + * Sample code: DeleteLocalUser. + * + * @param manager Entry point to StorageManager. + */ + public static void deleteLocalUser(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.localUsersOperations() + .deleteWithResponse("res6977", "sto2527", "user1", com.azure.core.util.Context.NONE); + } +} +``` + +### LocalUsersOperation_Get + +```java +/** + * Samples for LocalUsersOperation Get. + */ +public final class LocalUsersOperationGetSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/LocalUserGet.json + */ + /** + * Sample code: GetLocalUser. + * + * @param manager Entry point to StorageManager. + */ + public static void getLocalUser(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.localUsersOperations().getWithResponse("res6977", "sto2527", "user1", com.azure.core.util.Context.NONE); + } +} +``` + +### LocalUsersOperation_List + +```java +import com.azure.resourcemanager.storage.generated.models.ListLocalUserIncludeParam; + +/** + * Samples for LocalUsersOperation List. + */ +public final class LocalUsersOperationListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/LocalUsersListNFSv3Enabled. + * json + */ + /** + * Sample code: ListNFSv3EnabledLocalUsers. + * + * @param manager Entry point to StorageManager. + */ + public static void listNFSv3EnabledLocalUsers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.localUsersOperations() + .list("res6977", "sto2527", null, null, ListLocalUserIncludeParam.NFSV3, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/LocalUsersList.json + */ + /** + * Sample code: ListLocalUsers. + * + * @param manager Entry point to StorageManager. + */ + public static void listLocalUsers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.localUsersOperations().list("res6977", "sto2527", null, null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### LocalUsersOperation_ListKeys + +```java +/** + * Samples for LocalUsersOperation ListKeys. + */ +public final class LocalUsersOperationListKeysSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/LocalUserListKeys.json + */ + /** + * Sample code: ListLocalUserKeys. + * + * @param manager Entry point to StorageManager. + */ + public static void listLocalUserKeys(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.localUsersOperations() + .listKeysWithResponse("res6977", "sto2527", "user1", com.azure.core.util.Context.NONE); + } +} +``` + +### LocalUsersOperation_RegeneratePassword + +```java +/** + * Samples for LocalUsersOperation RegeneratePassword. + */ +public final class LocalUsersOperationRegeneratePasswordSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/LocalUserRegeneratePassword. + * json + */ + /** + * Sample code: RegenerateLocalUserPassword. + * + * @param manager Entry point to StorageManager. + */ + public static void regenerateLocalUserPassword(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.localUsersOperations() + .regeneratePasswordWithResponse("res6977", "sto2527", "user1", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagementPolicies_CreateOrUpdate + +```java +import com.azure.resourcemanager.storage.generated.models.DateAfterCreation; +import com.azure.resourcemanager.storage.generated.models.DateAfterModification; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyAction; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyBaseBlob; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyDefinition; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyFilter; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyName; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyRule; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicySchema; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicySnapShot; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyVersion; +import com.azure.resourcemanager.storage.generated.models.RuleType; +import com.azure.resourcemanager.storage.generated.models.TagFilter; +import java.util.Arrays; + +/** + * Samples for ManagementPolicies CreateOrUpdate. + */ +public final class ManagementPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountSetManagementPolicyColdTierActions.json + */ + /** + * Sample code: StorageAccountSetManagementPolicyColdTierActions. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetManagementPolicyColdTierActions( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList( + new ManagementPolicyRule().withEnabled(true) + .withName("olcmtest1") + .withType(RuleType.LIFECYCLE) + .withDefinition(new ManagementPolicyDefinition() + .withActions(new ManagementPolicyAction() + .withBaseBlob(new ManagementPolicyBaseBlob() + .withTierToCool(new DateAfterModification() + .withDaysAfterModificationGreaterThan(30.0F)) + .withTierToArchive(new DateAfterModification() + .withDaysAfterModificationGreaterThan(90.0F)) + .withTierToCold(new DateAfterModification() + .withDaysAfterModificationGreaterThan(30.0F)) + .withDelete(new DateAfterModification() + .withDaysAfterModificationGreaterThan(1000.0F))) + .withSnapshot(new ManagementPolicySnapShot() + .withTierToCold( + new DateAfterCreation().withDaysAfterCreationGreaterThan(30f)) + .withDelete( + new DateAfterCreation().withDaysAfterCreationGreaterThan(30f))) + .withVersion(new ManagementPolicyVersion() + .withTierToCold( + new DateAfterCreation().withDaysAfterCreationGreaterThan(30f)) + .withDelete( + new DateAfterCreation().withDaysAfterCreationGreaterThan(30f)))) + .withFilters(new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer1")) + .withBlobTypes(Arrays.asList("blockBlob"))))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountSetManagementPolicyWithSnapshotAndVersion.json + */ + /** + * Sample code: StorageAccountSetManagementPolicyWithSnapshotAndVersion. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetManagementPolicyWithSnapshotAndVersion( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList( + new ManagementPolicyRule().withEnabled(true) + .withName("olcmtest1") + .withType(RuleType.LIFECYCLE) + .withDefinition(new ManagementPolicyDefinition() + .withActions(new ManagementPolicyAction() + .withBaseBlob(new ManagementPolicyBaseBlob() + .withTierToCool(new DateAfterModification() + .withDaysAfterModificationGreaterThan(30.0F)) + .withTierToArchive(new DateAfterModification() + .withDaysAfterModificationGreaterThan(90.0F)) + .withDelete(new DateAfterModification() + .withDaysAfterModificationGreaterThan(1000.0F))) + .withSnapshot(new ManagementPolicySnapShot() + .withTierToCool( + new DateAfterCreation().withDaysAfterCreationGreaterThan(30f)) + .withTierToArchive( + new DateAfterCreation().withDaysAfterCreationGreaterThan(90f)) + .withDelete( + new DateAfterCreation().withDaysAfterCreationGreaterThan(1000f))) + .withVersion(new ManagementPolicyVersion() + .withTierToCool( + new DateAfterCreation().withDaysAfterCreationGreaterThan(30f)) + .withTierToArchive( + new DateAfterCreation().withDaysAfterCreationGreaterThan(90f)) + .withDelete( + new DateAfterCreation().withDaysAfterCreationGreaterThan(1000f)))) + .withFilters(new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer1")) + .withBlobTypes(Arrays.asList("blockBlob"))))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountSetManagementPolicyForBlockAndAppendBlobs.json + */ + /** + * Sample code: StorageAccountSetManagementPolicyForBlockAndAppendBlobs. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetManagementPolicyForBlockAndAppendBlobs( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList( + new ManagementPolicyRule().withEnabled(true) + .withName("olcmtest1") + .withType(RuleType.LIFECYCLE) + .withDefinition(new ManagementPolicyDefinition() + .withActions(new ManagementPolicyAction() + .withBaseBlob( + new ManagementPolicyBaseBlob().withDelete(new DateAfterModification() + .withDaysAfterModificationGreaterThan(90.0F))) + .withSnapshot(new ManagementPolicySnapShot().withDelete( + new DateAfterCreation().withDaysAfterCreationGreaterThan(90f))) + .withVersion(new ManagementPolicyVersion().withDelete( + new DateAfterCreation().withDaysAfterCreationGreaterThan(90f)))) + .withFilters(new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer1")) + .withBlobTypes(Arrays.asList("blockBlob", "appendBlob"))))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountSetManagementPolicyHotTierActions.json + */ + /** + * Sample code: StorageAccountSetManagementPolicyHotTierActions. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetManagementPolicyHotTierActions( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList( + new ManagementPolicyRule().withEnabled(true) + .withName("olcmtest1") + .withType(RuleType.LIFECYCLE) + .withDefinition(new ManagementPolicyDefinition() + .withActions(new ManagementPolicyAction() + .withBaseBlob( + new ManagementPolicyBaseBlob().withTierToHot(new DateAfterModification() + .withDaysAfterModificationGreaterThan(30.0F))) + .withSnapshot(new ManagementPolicySnapShot().withTierToHot( + new DateAfterCreation().withDaysAfterCreationGreaterThan(30f))) + .withVersion(new ManagementPolicyVersion().withTierToHot( + new DateAfterCreation().withDaysAfterCreationGreaterThan(30f)))) + .withFilters(new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer1")) + .withBlobTypes(Arrays.asList("blockBlob"))))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountSetManagementPolicy_LastAccessTimeBasedBlobActions.json + */ + /** + * Sample code: StorageAccountSetManagementPolicy_LastAccessTimeBasedBlobActions. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetManagementPolicyLastAccessTimeBasedBlobActions( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList(new ManagementPolicyRule().withEnabled(true) + .withName("olcmtest") + .withType(RuleType.LIFECYCLE) + .withDefinition(new ManagementPolicyDefinition() + .withActions(new ManagementPolicyAction() + .withBaseBlob(new ManagementPolicyBaseBlob() + .withTierToCool(new DateAfterModification() + .withDaysAfterLastAccessTimeGreaterThan(30.0F)) + .withTierToArchive(new DateAfterModification() + .withDaysAfterLastAccessTimeGreaterThan(90.0F)) + .withDelete(new DateAfterModification() + .withDaysAfterLastAccessTimeGreaterThan(1000.0F)) + .withEnableAutoTierToHotFromCool(true)) + .withSnapshot(new ManagementPolicySnapShot() + .withDelete(new DateAfterCreation().withDaysAfterCreationGreaterThan(30f)))) + .withFilters( + new ManagementPolicyFilter().withPrefixMatch(Arrays.asList("olcmtestcontainer")) + .withBlobTypes(Arrays.asList("blockBlob"))))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountSetManagementPolicy.json + */ + /** + * Sample code: StorageAccountSetManagementPolicies. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountSetManagementPolicies(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList( + new ManagementPolicyRule().withEnabled(true) + .withName("olcmtest1") + .withType(RuleType.LIFECYCLE) + .withDefinition(new ManagementPolicyDefinition() + .withActions(new ManagementPolicyAction() + .withBaseBlob(new ManagementPolicyBaseBlob() + .withTierToCool(new DateAfterModification() + .withDaysAfterModificationGreaterThan(30.0F)) + .withTierToArchive(new DateAfterModification() + .withDaysAfterModificationGreaterThan(90.0F)) + .withDelete(new DateAfterModification() + .withDaysAfterModificationGreaterThan(1000.0F))) + .withSnapshot(new ManagementPolicySnapShot().withDelete( + new DateAfterCreation().withDaysAfterCreationGreaterThan(30f)))) + .withFilters( + new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer1")) + .withBlobTypes(Arrays.asList("blockBlob")))), + new ManagementPolicyRule().withEnabled(true) + .withName("olcmtest2") + .withType(RuleType.LIFECYCLE) + .withDefinition(new ManagementPolicyDefinition() + .withActions(new ManagementPolicyAction() + .withBaseBlob(new ManagementPolicyBaseBlob() + .withTierToCool(new DateAfterModification() + .withDaysAfterModificationGreaterThan(30.0F)) + .withTierToArchive(new DateAfterModification() + .withDaysAfterModificationGreaterThan(90.0F)) + .withDelete(new DateAfterModification() + .withDaysAfterModificationGreaterThan(1000.0F)))) + .withFilters(new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer2")) + .withBlobTypes(Arrays.asList("blockBlob")) + .withBlobIndexMatch(Arrays.asList( + new TagFilter().withName("tag1").withOp("==").withValue("val1"), + new TagFilter().withName("tag2").withOp("==").withValue("val2")))))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountSetManagementPolicy_BaseBlobDaysAfterCreationActions.json + */ + /** + * Sample code: StorageAccountSetManagementPolicy_BaseBlobDaysAfterCreationActions. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetManagementPolicyBaseBlobDaysAfterCreationActions( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList( + new ManagementPolicyRule().withEnabled(true) + .withName("olcmtest1") + .withType(RuleType.LIFECYCLE) + .withDefinition( + new ManagementPolicyDefinition() + .withActions( + new ManagementPolicyAction().withBaseBlob(new ManagementPolicyBaseBlob() + .withTierToCool(new DateAfterModification() + .withDaysAfterCreationGreaterThan(30.0F)) + .withTierToArchive(new DateAfterModification() + .withDaysAfterCreationGreaterThan(90.0F)) + .withDelete(new DateAfterModification() + .withDaysAfterCreationGreaterThan(1000.0F)))) + .withFilters(new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer1")) + .withBlobTypes(Arrays.asList("blockBlob"))))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountSetManagementPolicy_LastTierChangeTimeActions.json + */ + /** + * Sample code: StorageAccountSetManagementPolicy_LastTierChangeTimeActions. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetManagementPolicyLastTierChangeTimeActions( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList( + new ManagementPolicyRule().withEnabled(true) + .withName("olcmtest") + .withType(RuleType.LIFECYCLE) + .withDefinition(new ManagementPolicyDefinition() + .withActions(new ManagementPolicyAction() + .withBaseBlob(new ManagementPolicyBaseBlob() + .withTierToCool(new DateAfterModification() + .withDaysAfterModificationGreaterThan(30.0F)) + .withTierToArchive(new DateAfterModification() + .withDaysAfterModificationGreaterThan(90.0F) + .withDaysAfterLastTierChangeGreaterThan(120.0F)) + .withDelete(new DateAfterModification() + .withDaysAfterModificationGreaterThan(1000.0F))) + .withSnapshot(new ManagementPolicySnapShot().withTierToArchive( + new DateAfterCreation().withDaysAfterCreationGreaterThan(30f) + .withDaysAfterLastTierChangeGreaterThan(90.0F))) + .withVersion(new ManagementPolicyVersion().withTierToArchive( + new DateAfterCreation().withDaysAfterCreationGreaterThan(30f) + .withDaysAfterLastTierChangeGreaterThan(90.0F)))) + .withFilters(new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer")) + .withBlobTypes(Arrays.asList("blockBlob"))))))) + .create(); + } +} +``` + +### ManagementPolicies_Delete + +```java +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyName; + +/** + * Samples for ManagementPolicies Delete. + */ +public final class ManagementPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountDeleteManagementPolicy.json + */ + /** + * Sample code: StorageAccountDeleteManagementPolicies. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountDeleteManagementPolicies(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.managementPolicies() + .deleteWithResponse("res6977", "sto2527", ManagementPolicyName.DEFAULT, com.azure.core.util.Context.NONE); + } +} +``` + +### ManagementPolicies_Get + +```java +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyName; + +/** + * Samples for ManagementPolicies Get. + */ +public final class ManagementPoliciesGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountGetManagementPolicy.json + */ + /** + * Sample code: StorageAccountGetManagementPolicies. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountGetManagementPolicies(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.managementPolicies() + .getWithResponse("res6977", "sto2527", ManagementPolicyName.DEFAULT, com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkSecurityPerimeterConfigurations_Get + +```java +/** + * Samples for NetworkSecurityPerimeterConfigurations Get. + */ +public final class NetworkSecurityPerimeterConfigurationsGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * NetworkSecurityPerimeterConfigurationGet.json + */ + /** + * Sample code: NetworkSecurityPerimeterConfigurationGet. + * + * @param manager Entry point to StorageManager. + */ + public static void + networkSecurityPerimeterConfigurationGet(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.networkSecurityPerimeterConfigurations() + .getWithResponse("res4410", "sto8607", "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1", + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkSecurityPerimeterConfigurations_List + +```java +/** + * Samples for NetworkSecurityPerimeterConfigurations List. + */ +public final class NetworkSecurityPerimeterConfigurationsListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * NetworkSecurityPerimeterConfigurationList.json + */ + /** + * Sample code: NetworkSecurityPerimeterConfigurationList. + * + * @param manager Entry point to StorageManager. + */ + public static void + networkSecurityPerimeterConfigurationList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.networkSecurityPerimeterConfigurations().list("res4410", "sto8607", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkSecurityPerimeterConfigurations_Reconcile + +```java +/** + * Samples for NetworkSecurityPerimeterConfigurations Reconcile. + */ +public final class NetworkSecurityPerimeterConfigurationsReconcileSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * NetworkSecurityPerimeterConfigurationReconcile.json + */ + /** + * Sample code: NetworkSecurityPerimeterConfigurationReconcile. + * + * @param manager Entry point to StorageManager. + */ + public static void networkSecurityPerimeterConfigurationReconcile( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.networkSecurityPerimeterConfigurations() + .reconcile("res4410", "sto8607", "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1", + com.azure.core.util.Context.NONE); + } +} +``` + +### ObjectReplicationPoliciesOperation_CreateOrUpdate + +```java +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicy; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicyFilter; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicyPropertiesMetrics; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicyRule; +import java.util.Arrays; + +/** + * Samples for ObjectReplicationPoliciesOperation CreateOrUpdate. + */ +public final class ObjectReplicationPoliciesOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountCreateObjectReplicationPolicyOnSource.json + */ + /** + * Sample code: StorageAccountCreateObjectReplicationPolicyOnSource. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateObjectReplicationPolicyOnSource( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.objectReplicationPoliciesOperations() + .define("2a20bb73-5717-4635-985a-5d4cf777438f") + .withExistingStorageAccount("res7687", "src1122") + .withSourceAccount("src1122") + .withDestinationAccount("dst112") + .withRules( + Arrays.asList(new ObjectReplicationPolicyRule().withRuleId("d5d18a48-8801-4554-aeaa-74faf65f5ef9") + .withSourceContainer("scont139") + .withDestinationContainer("dcont139") + .withFilters(new ObjectReplicationPolicyFilter().withPrefixMatch(Arrays.asList("blobA", "blobB")) + .withMinCreationTime("2020-02-19T16:05:00Z")))) + .withMetrics(new ObjectReplicationPolicyPropertiesMetrics().withEnabled(true)) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountCreateObjectReplicationPolicyOnDestination.json + */ + /** + * Sample code: StorageAccountCreateObjectReplicationPolicyOnDestination. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateObjectReplicationPolicyOnDestination( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.objectReplicationPoliciesOperations() + .define("default") + .withExistingStorageAccount("res7687", "dst112") + .withSourceAccount("src1122") + .withDestinationAccount("dst112") + .withRules(Arrays.asList(new ObjectReplicationPolicyRule().withSourceContainer("scont139") + .withDestinationContainer("dcont139") + .withFilters(new ObjectReplicationPolicyFilter().withPrefixMatch(Arrays.asList("blobA", "blobB"))))) + .withMetrics(new ObjectReplicationPolicyPropertiesMetrics().withEnabled(true)) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountUpdateObjectReplicationPolicyOnDestination.json + */ + /** + * Sample code: StorageAccountUpdateObjectReplicationPolicyOnDestination. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdateObjectReplicationPolicyOnDestination( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + ObjectReplicationPolicy resource = manager.objectReplicationPoliciesOperations() + .getWithResponse("res7687", "dst112", "2a20bb73-5717-4635-985a-5d4cf777438f", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withSourceAccount("src1122") + .withDestinationAccount("dst112") + .withRules(Arrays.asList( + new ObjectReplicationPolicyRule().withRuleId("d5d18a48-8801-4554-aeaa-74faf65f5ef9") + .withSourceContainer("scont139") + .withDestinationContainer("dcont139") + .withFilters(new ObjectReplicationPolicyFilter().withPrefixMatch(Arrays.asList("blobA", "blobB"))), + new ObjectReplicationPolicyRule().withSourceContainer("scont179").withDestinationContainer("dcont179"))) + .withMetrics(new ObjectReplicationPolicyPropertiesMetrics().withEnabled(true)) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountUpdateObjectReplicationPolicyOnSource.json + */ + /** + * Sample code: StorageAccountUpdateObjectReplicationPolicyOnSource. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdateObjectReplicationPolicyOnSource( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + ObjectReplicationPolicy resource = manager.objectReplicationPoliciesOperations() + .getWithResponse("res7687", "src1122", "2a20bb73-5717-4635-985a-5d4cf777438f", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withSourceAccount("src1122") + .withDestinationAccount("dst112") + .withRules(Arrays.asList( + new ObjectReplicationPolicyRule().withRuleId("d5d18a48-8801-4554-aeaa-74faf65f5ef9") + .withSourceContainer("scont139") + .withDestinationContainer("dcont139") + .withFilters(new ObjectReplicationPolicyFilter().withPrefixMatch(Arrays.asList("blobA", "blobB"))), + new ObjectReplicationPolicyRule().withRuleId("cfbb4bc2-8b60-429f-b05a-d1e0942b33b2") + .withSourceContainer("scont179") + .withDestinationContainer("dcont179"))) + .withMetrics(new ObjectReplicationPolicyPropertiesMetrics().withEnabled(true)) + .apply(); + } +} +``` + +### ObjectReplicationPoliciesOperation_Delete + +```java +/** + * Samples for ObjectReplicationPoliciesOperation Delete. + */ +public final class ObjectReplicationPoliciesOperationDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountDeleteObjectReplicationPolicy.json + */ + /** + * Sample code: StorageAccountDeleteObjectReplicationPolicies. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountDeleteObjectReplicationPolicies( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.objectReplicationPoliciesOperations() + .deleteWithResponse("res6977", "sto2527", "{objectReplicationPolicy-Id}", com.azure.core.util.Context.NONE); + } +} +``` + +### ObjectReplicationPoliciesOperation_Get + +```java +/** + * Samples for ObjectReplicationPoliciesOperation Get. + */ +public final class ObjectReplicationPoliciesOperationGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountGetObjectReplicationPolicy.json + */ + /** + * Sample code: StorageAccountGetObjectReplicationPolicies. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountGetObjectReplicationPolicies(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.objectReplicationPoliciesOperations() + .getWithResponse("res6977", "sto2527", "{objectReplicationPolicy-Id}", com.azure.core.util.Context.NONE); + } +} +``` + +### ObjectReplicationPoliciesOperation_List + +```java +/** + * Samples for ObjectReplicationPoliciesOperation List. + */ +public final class ObjectReplicationPoliciesOperationListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountListObjectReplicationPolicies.json + */ + /** + * Sample code: StorageAccountListObjectReplicationPolicies. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountListObjectReplicationPolicies( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.objectReplicationPoliciesOperations().list("res6977", "sto2527", com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/OperationsList.json + */ + /** + * Sample code: OperationsList. + * + * @param manager Entry point to StorageManager. + */ + public static void operationsList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +/** + * Samples for PrivateEndpointConnections Delete. + */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountDeletePrivateEndpointConnection.json + */ + /** + * Sample code: StorageAccountDeletePrivateEndpointConnection. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountDeletePrivateEndpointConnection( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.privateEndpointConnections() + .deleteWithResponse("res6977", "sto2527", "{privateEndpointConnectionName}", + com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +/** + * Samples for PrivateEndpointConnections Get. + */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountGetPrivateEndpointConnection.json + */ + /** + * Sample code: StorageAccountGetPrivateEndpointConnection. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountGetPrivateEndpointConnection(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.privateEndpointConnections() + .getWithResponse("res6977", "sto2527", "{privateEndpointConnectionName}", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_List + +```java +/** + * Samples for PrivateEndpointConnections List. + */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountListPrivateEndpointConnections.json + */ + /** + * Sample code: StorageAccountListPrivateEndpointConnections. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountListPrivateEndpointConnections( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.privateEndpointConnections().list("res6977", "sto2527", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Put + +```java +import com.azure.resourcemanager.storage.generated.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.storage.generated.models.PrivateLinkServiceConnectionState; + +/** + * Samples for PrivateEndpointConnections Put. + */ +public final class PrivateEndpointConnectionsPutSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountPutPrivateEndpointConnection.json + */ + /** + * Sample code: StorageAccountPutPrivateEndpointConnection. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountPutPrivateEndpointConnection(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.privateEndpointConnections() + .define("{privateEndpointConnectionName}") + .withExistingStorageAccount("res7687", "sto9699") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Auto-Approved")) + .create(); + } +} +``` + +### PrivateLinkResources_ListByStorageAccount + +```java +/** + * Samples for PrivateLinkResources ListByStorageAccount. + */ +public final class PrivateLinkResourcesListByStorageAccountSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountListPrivateLinkResources.json + */ + /** + * Sample code: StorageAccountListPrivateLinkResources. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountListPrivateLinkResources(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.privateLinkResources() + .listByStorageAccountWithResponse("res6977", "sto2527", com.azure.core.util.Context.NONE); + } +} +``` + +### Queue_Create + +```java +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Queue Create. + */ +public final class QueueCreateSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/QueueOperationPut.json + */ + /** + * Sample code: QueueOperationPut. + * + * @param manager Entry point to StorageManager. + */ + public static void queueOperationPut(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queues().define("queue6185").withExistingStorageAccount("res3376", "sto328").create(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/QueueOperationPutWithMetadata + * .json + */ + /** + * Sample code: QueueOperationPutWithMetadata. + * + * @param manager Entry point to StorageManager. + */ + public static void + queueOperationPutWithMetadata(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queues() + .define("queue6185") + .withExistingStorageAccount("res3376", "sto328") + .withMetadata(mapOf("sample1", "meta1", "sample2", "meta2")) + .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; + } +} +``` + +### Queue_Delete + +```java +/** + * Samples for Queue Delete. + */ +public final class QueueDeleteSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/QueueOperationDelete.json + */ + /** + * Sample code: QueueOperationDelete. + * + * @param manager Entry point to StorageManager. + */ + public static void queueOperationDelete(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queues().deleteWithResponse("res3376", "sto328", "queue6185", com.azure.core.util.Context.NONE); + } +} +``` + +### Queue_Get + +```java +/** + * Samples for Queue Get. + */ +public final class QueueGetSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/QueueOperationGet.json + */ + /** + * Sample code: QueueOperationGet. + * + * @param manager Entry point to StorageManager. + */ + public static void queueOperationGet(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queues().getWithResponse("res3376", "sto328", "queue6185", com.azure.core.util.Context.NONE); + } +} +``` + +### Queue_List + +```java +/** + * Samples for Queue List. + */ +public final class QueueListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/QueueOperationList.json + */ + /** + * Sample code: QueueOperationList. + * + * @param manager Entry point to StorageManager. + */ + public static void queueOperationList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queues().list("res9290", "sto328", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### Queue_Update + +```java +import com.azure.resourcemanager.storage.generated.models.StorageQueue; + +/** + * Samples for Queue Update. + */ +public final class QueueUpdateSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/QueueOperationPatch.json + */ + /** + * Sample code: QueueOperationPatch. + * + * @param manager Entry point to StorageManager. + */ + public static void queueOperationPatch(com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageQueue resource = manager.queues() + .getWithResponse("res3376", "sto328", "queue6185", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } +} +``` + +### QueueServices_GetServiceProperties + +```java +/** + * Samples for QueueServices GetServiceProperties. + */ +public final class QueueServicesGetServicePropertiesSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/QueueServicesGet.json + */ + /** + * Sample code: QueueServicesGet. + * + * @param manager Entry point to StorageManager. + */ + public static void queueServicesGet(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queueServices() + .getServicePropertiesWithResponse("res4410", "sto8607", com.azure.core.util.Context.NONE); + } +} +``` + +### QueueServices_List + +```java +/** + * Samples for QueueServices List. + */ +public final class QueueServicesListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/QueueServicesList.json + */ + /** + * Sample code: QueueServicesList. + * + * @param manager Entry point to StorageManager. + */ + public static void queueServicesList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queueServices().listWithResponse("res9290", "sto1590", com.azure.core.util.Context.NONE); + } +} +``` + +### QueueServices_SetServiceProperties + +```java +import com.azure.resourcemanager.storage.generated.models.AllowedMethods; +import com.azure.resourcemanager.storage.generated.models.CorsRule; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import java.util.Arrays; + +/** + * Samples for QueueServices SetServiceProperties. + */ +public final class QueueServicesSetServicePropertiesSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/QueueServicesPut.json + */ + /** + * Sample code: QueueServicesPut. + * + * @param manager Entry point to StorageManager. + */ + public static void queueServicesPut(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queueServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withCors(new CorsRules().withCorsRules(Arrays.asList( + new CorsRule().withAllowedOrigins(Arrays.asList("http://www.contoso.com", "http://www.fabrikam.com")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET, AllowedMethods.HEAD, AllowedMethods.POST, + AllowedMethods.OPTIONS, AllowedMethods.MERGE, AllowedMethods.PUT)) + .withMaxAgeInSeconds(100) + .withExposedHeaders(Arrays.asList("x-ms-meta-*")) + .withAllowedHeaders(Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")), + new CorsRule().withAllowedOrigins(Arrays.asList("*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET)) + .withMaxAgeInSeconds(2) + .withExposedHeaders(Arrays.asList("*")) + .withAllowedHeaders(Arrays.asList("*")), + new CorsRule().withAllowedOrigins(Arrays.asList("http://www.abc23.com", "https://www.fabrikam.com/*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET, AllowedMethods.PUT)) + .withMaxAgeInSeconds(2000) + .withExposedHeaders(Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")) + .withAllowedHeaders(Arrays.asList("x-ms-meta-12345675754564*"))))) + .create(); + } +} +``` + +### Skus_List + +```java +/** + * Samples for Skus List. + */ +public final class SkusListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/SKUList.json + */ + /** + * Sample code: SkuList. + * + * @param manager Entry point to StorageManager. + */ + public static void skuList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.skus().list(com.azure.core.util.Context.NONE); + } +} +``` + +### StorageAccounts_AbortHierarchicalNamespaceMigration + +```java +/** + * Samples for StorageAccounts AbortHierarchicalNamespaceMigration. + */ +public final class StorageAccountsAbortHierarchicalNamespaceMigrationSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountAbortHierarchicalNamespaceMigration.json + */ + /** + * Sample code: StorageAccountAbortHierarchicalNamespaceMigration. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountAbortHierarchicalNamespaceMigration( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .abortHierarchicalNamespaceMigration("res4228", "sto2434", com.azure.core.util.Context.NONE); + } +} +``` + +### StorageAccounts_CheckNameAvailability + +```java +import com.azure.resourcemanager.storage.generated.models.StorageAccountCheckNameAvailabilityParameters; + +/** + * Samples for StorageAccounts CheckNameAvailability. + */ +public final class StorageAccountsCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountCheckNameAvailability.json + */ + /** + * Sample code: StorageAccountCheckNameAvailability. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountCheckNameAvailability(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .checkNameAvailabilityWithResponse(new StorageAccountCheckNameAvailabilityParameters().withName("sto3363"), + com.azure.core.util.Context.NONE); + } +} +``` + +### StorageAccounts_Create + +```java +import com.azure.resourcemanager.storage.generated.models.AccountImmutabilityPolicyProperties; +import com.azure.resourcemanager.storage.generated.models.AccountImmutabilityPolicyState; +import com.azure.resourcemanager.storage.generated.models.AllowedCopyScope; +import com.azure.resourcemanager.storage.generated.models.Bypass; +import com.azure.resourcemanager.storage.generated.models.DefaultAction; +import com.azure.resourcemanager.storage.generated.models.DnsEndpointType; +import com.azure.resourcemanager.storage.generated.models.Encryption; +import com.azure.resourcemanager.storage.generated.models.EncryptionIdentity; +import com.azure.resourcemanager.storage.generated.models.EncryptionService; +import com.azure.resourcemanager.storage.generated.models.EncryptionServices; +import com.azure.resourcemanager.storage.generated.models.ExpirationAction; +import com.azure.resourcemanager.storage.generated.models.ExtendedLocation; +import com.azure.resourcemanager.storage.generated.models.ExtendedLocationTypes; +import com.azure.resourcemanager.storage.generated.models.Identity; +import com.azure.resourcemanager.storage.generated.models.IdentityType; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageAccount; +import com.azure.resourcemanager.storage.generated.models.KeyPolicy; +import com.azure.resourcemanager.storage.generated.models.KeySource; +import com.azure.resourcemanager.storage.generated.models.KeyType; +import com.azure.resourcemanager.storage.generated.models.KeyVaultProperties; +import com.azure.resourcemanager.storage.generated.models.Kind; +import com.azure.resourcemanager.storage.generated.models.MinimumTlsVersion; +import com.azure.resourcemanager.storage.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.storage.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.storage.generated.models.RoutingChoice; +import com.azure.resourcemanager.storage.generated.models.RoutingPreference; +import com.azure.resourcemanager.storage.generated.models.SasPolicy; +import com.azure.resourcemanager.storage.generated.models.Sku; +import com.azure.resourcemanager.storage.generated.models.SkuName; +import com.azure.resourcemanager.storage.generated.models.UserAssignedIdentity; +import com.azure.resourcemanager.storage.generated.models.VirtualNetworkRule; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for StorageAccounts Create. + */ +public final class StorageAccountsCreateSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/NfsV3AccountCreate.json + */ + /** + * Sample code: NfsV3AccountCreate. + * + * @param manager Entry point to StorageManager. + */ + public static void nfsV3AccountCreate(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.PREMIUM_LRS)) + .withKind(Kind.BLOCK_BLOB_STORAGE) + .withNetworkRuleSet(new NetworkRuleSet().withBypass(Bypass.AZURE_SERVICES) + .withVirtualNetworkRules(Arrays.asList(new VirtualNetworkRule().withVirtualNetworkResourceId( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.Network/virtualNetworks/net123/subnets/subnet12"))) + .withIpRules(Arrays.asList()) + .withDefaultAction(DefaultAction.ALLOW)) + .withEnableHttpsTrafficOnly(false) + .withEnableExtendedGroups(true) + .withIsHnsEnabled(true) + .withEnableNfsV3(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountCreatePremiumBlockBlobStorage.json + */ + /** + * Sample code: StorageAccountCreatePremiumBlockBlobStorage. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreatePremiumBlockBlobStorage( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.PREMIUM_LRS)) + .withKind(Kind.BLOCK_BLOB_STORAGE) + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountCreateWithImmutabilityPolicy.json + */ + /** + * Sample code: StorageAccountCreateWithImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountCreateWithImmutabilityPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withExtendedLocation( + new ExtendedLocation().withName("losangeles001").withType(ExtendedLocationTypes.EDGE_ZONE)) + .withImmutableStorageWithVersioning(new ImmutableStorageAccount().withEnabled(true) + .withImmutabilityPolicy( + new AccountImmutabilityPolicyProperties().withImmutabilityPeriodSinceCreationInDays(15) + .withState(AccountImmutabilityPolicyState.UNLOCKED) + .withAllowProtectedAppendWrites(true))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountCreateAllowedCopyScopeToPrivateLink.json + */ + /** + * Sample code: StorageAccountCreateAllowedCopyScopeToPrivateLink. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateAllowedCopyScopeToPrivateLink( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withAllowedCopyScope(AllowedCopyScope.PRIVATE_LINK) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsHnsEnabled(true) + .withRoutingPreference(new RoutingPreference().withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .create(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountCreate.json + */ + /** + * Sample code: StorageAccountCreate. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreate(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withExtendedLocation( + new ExtendedLocation().withName("losangeles001").withType(ExtendedLocationTypes.EDGE_ZONE)) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsSftpEnabled(true) + .withIsHnsEnabled(true) + .withRoutingPreference(new RoutingPreference().withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .withDefaultToOAuthAuthentication(false) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountCreateEnablePublicNetworkAccess.json + */ + /** + * Sample code: StorageAccountCreateEnablePublicNetworkAccess. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateEnablePublicNetworkAccess( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withExtendedLocation( + new ExtendedLocation().withName("losangeles001").withType(ExtendedLocationTypes.EDGE_ZONE)) + .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsHnsEnabled(true) + .withRoutingPreference(new RoutingPreference().withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountCreateAllowedCopyScopeToAAD.json + */ + /** + * Sample code: StorageAccountCreateAllowedCopyScopeToAAD. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountCreateAllowedCopyScopeToAAD(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withAllowedCopyScope(AllowedCopyScope.AAD) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsHnsEnabled(true) + .withRoutingPreference(new RoutingPreference().withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountCreateUserAssignedIdentityWithFederatedIdentityClientId.json + */ + /** + * Sample code: StorageAccountCreateUserAssignedIdentityWithFederatedIdentityClientId. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateUserAssignedIdentityWithFederatedIdentityClientId( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .define("sto131918") + .withRegion("eastus") + .withExistingResourceGroup("res131918") + .withSku(new Sku().withName(SkuName.STANDARD_LRS)) + .withKind(Kind.STORAGE) + .withIdentity(new Identity().withType(IdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}", + new UserAssignedIdentity()))) + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_KEYVAULT) + .withKeyVaultProperties(new KeyVaultProperties().withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder") + .withKeyVaultUri("fakeTokenPlaceholder")) + .withEncryptionIdentity(new EncryptionIdentity().withEncryptionUserAssignedIdentity( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}") + .withEncryptionFederatedIdentityClientId("f83c6b1b-4d34-47e4-bb34-9d83df58b540"))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountCreateDisallowPublicNetworkAccess.json + */ + /** + * Sample code: StorageAccountCreateDisallowPublicNetworkAccess. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateDisallowPublicNetworkAccess( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withExtendedLocation( + new ExtendedLocation().withName("losangeles001").withType(ExtendedLocationTypes.EDGE_ZONE)) + .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsHnsEnabled(true) + .withRoutingPreference(new RoutingPreference().withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountCreateDnsEndpointTypeToStandard.json + */ + /** + * Sample code: StorageAccountCreateDnsEndpointTypeToStandard. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateDnsEndpointTypeToStandard( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withExtendedLocation( + new ExtendedLocation().withName("losangeles001").withType(ExtendedLocationTypes.EDGE_ZONE)) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsSftpEnabled(true) + .withIsHnsEnabled(true) + .withRoutingPreference(new RoutingPreference().withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .withDefaultToOAuthAuthentication(false) + .withDnsEndpointType(DnsEndpointType.STANDARD) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountCreateDnsEndpointTypeToAzureDnsZone.json + */ + /** + * Sample code: StorageAccountCreateDnsEndpointTypeToAzureDnsZone. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateDnsEndpointTypeToAzureDnsZone( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withExtendedLocation( + new ExtendedLocation().withName("losangeles001").withType(ExtendedLocationTypes.EDGE_ZONE)) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsSftpEnabled(true) + .withIsHnsEnabled(true) + .withRoutingPreference(new RoutingPreference().withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .withDefaultToOAuthAuthentication(false) + .withDnsEndpointType(DnsEndpointType.AZURE_DNS_ZONE) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountCreateUserAssignedEncryptionIdentityWithCMK.json + */ + /** + * Sample code: StorageAccountCreateUserAssignedEncryptionIdentityWithCMK. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateUserAssignedEncryptionIdentityWithCMK( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_LRS)) + .withKind(Kind.STORAGE) + .withIdentity(new Identity().withType(IdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}", + new UserAssignedIdentity()))) + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_KEYVAULT) + .withKeyVaultProperties(new KeyVaultProperties().withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder") + .withKeyVaultUri("fakeTokenPlaceholder")) + .withEncryptionIdentity(new EncryptionIdentity().withEncryptionUserAssignedIdentity( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}"))) + .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; + } +} +``` + +### StorageAccounts_CustomerInitiatedMigration + +```java +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountMigrationInner; +import com.azure.resourcemanager.storage.generated.models.SkuName; + +/** + * Samples for StorageAccounts CustomerInitiatedMigration. + */ +public final class StorageAccountsCustomerInitiatedMigrationSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountPostMigration. + * json + */ + /** + * Sample code: StorageAccountPostMigration. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountPostMigration(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .customerInitiatedMigration("resource-group-name", "accountname", + new StorageAccountMigrationInner().withTargetSkuName(SkuName.STANDARD_ZRS), + com.azure.core.util.Context.NONE); + } +} +``` + +### StorageAccounts_Delete + +```java +/** + * Samples for StorageAccounts Delete. + */ +public final class StorageAccountsDeleteSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountDelete.json + */ + /** + * Sample code: StorageAccountDelete. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountDelete(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .deleteByResourceGroupWithResponse("res4228", "sto2434", com.azure.core.util.Context.NONE); + } +} +``` + +### StorageAccounts_Failover + +```java +import com.azure.resourcemanager.storage.generated.models.FailoverType; + +/** + * Samples for StorageAccounts Failover. + */ +public final class StorageAccountsFailoverSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountFailover.json + */ + /** + * Sample code: StorageAccountFailover. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountFailover(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().failover("res4228", "sto2434", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountFailoverPlanned + * .json + */ + /** + * Sample code: StorageAccountFailoverPlanned. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountFailoverPlanned(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .failover("res4228", "sto2434", FailoverType.PLANNED, com.azure.core.util.Context.NONE); + } +} +``` + +### StorageAccounts_GetByResourceGroup + +```java +import com.azure.resourcemanager.storage.generated.models.StorageAccountExpand; + +/** + * Samples for StorageAccounts GetByResourceGroup. + */ +public final class StorageAccountsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountGetPropertiesGeoReplicationStatscanFailoverTrue.json + */ + /** + * Sample code: StorageAccountGetPropertiesGeoReplicationStatscanFailoverTrue. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetPropertiesGeoReplicationStatscanFailoverTrue( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", StorageAccountExpand.GEO_REPLICATION_STATS, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountGetProperties. + * json + */ + /** + * Sample code: StorageAccountGetProperties. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetProperties(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountGetPropertiesCMKVersionExpirationTime.json + */ + /** + * Sample code: StorageAccountGetPropertiesCMKVersionExpirationTime. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetPropertiesCMKVersionExpirationTime( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountGetPropertiesGeoReplicationStatscanFailoverFalse.json + */ + /** + * Sample code: StorageAccountGetPropertiesGeoReplicationStatscanFailoverFalse. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetPropertiesGeoReplicationStatscanFailoverFalse( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", StorageAccountExpand.GEO_REPLICATION_STATS, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountGetAsyncSkuConversionStatus.json + */ + /** + * Sample code: StorageAccountGetAsyncSkuConversionStatus. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountGetAsyncSkuConversionStatus(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountGetPropertiesCMKEnabled.json + */ + /** + * Sample code: StorageAccountGetPropertiesCMKEnabled. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountGetPropertiesCMKEnabled(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, com.azure.core.util.Context.NONE); + } +} +``` + +### StorageAccounts_GetCustomerInitiatedMigration + +```java +import com.azure.resourcemanager.storage.generated.models.MigrationName; + +/** + * Samples for StorageAccounts GetCustomerInitiatedMigration. + */ +public final class StorageAccountsGetCustomerInitiatedMigrationSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountGetMigrationInProgress.json + */ + /** + * Sample code: StorageAccountGetMigrationInProgress. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountGetMigrationInProgress(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .getCustomerInitiatedMigrationWithResponse("resource-group-name", "accountname", MigrationName.DEFAULT, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountGetMigrationFailed.json + */ + /** + * Sample code: StorageAccountGetMigrationFailed. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountGetMigrationFailed(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .getCustomerInitiatedMigrationWithResponse("resource-group-name", "accountname", MigrationName.DEFAULT, + com.azure.core.util.Context.NONE); + } +} +``` + +### StorageAccounts_HierarchicalNamespaceMigration + +```java +/** + * Samples for StorageAccounts HierarchicalNamespaceMigration. + */ +public final class StorageAccountsHierarchicalNamespaceMigrationSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountHierarchicalNamespaceMigration.json + */ + /** + * Sample code: StorageAccountHierarchicalNamespaceMigration. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountHierarchicalNamespaceMigration( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .hierarchicalNamespaceMigration("res4228", "sto2434", "HnsOnValidationRequest", + com.azure.core.util.Context.NONE); + } +} +``` + +### StorageAccounts_List + +```java +/** + * Samples for StorageAccounts List. + */ +public final class StorageAccountsListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountList.json + */ + /** + * Sample code: StorageAccountList. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().list(com.azure.core.util.Context.NONE); + } +} +``` + +### StorageAccounts_ListAccountSas + +```java +import com.azure.resourcemanager.storage.generated.models.AccountSasParameters; +import com.azure.resourcemanager.storage.generated.models.HttpProtocol; +import com.azure.resourcemanager.storage.generated.models.Permissions; +import com.azure.resourcemanager.storage.generated.models.Services; +import com.azure.resourcemanager.storage.generated.models.SignedResourceTypes; +import java.time.OffsetDateTime; + +/** + * Samples for StorageAccounts ListAccountSas. + */ +public final class StorageAccountsListAccountSasSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountListAccountSAS. + * json + */ + /** + * Sample code: StorageAccountListAccountSAS. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountListAccountSAS(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .listAccountSasWithResponse("res7985", "sto8588", + new AccountSasParameters().withServices(Services.B) + .withResourceTypes(SignedResourceTypes.S) + .withPermissions(Permissions.R) + .withProtocols(HttpProtocol.HTTPS_HTTP) + .withSharedAccessStartTime(OffsetDateTime.parse("2017-05-24T10:42:03.1567373Z")) + .withSharedAccessExpiryTime(OffsetDateTime.parse("2017-05-24T11:42:03.1567373Z")) + .withKeyToSign("fakeTokenPlaceholder"), + com.azure.core.util.Context.NONE); + } +} +``` + +### StorageAccounts_ListByResourceGroup + +```java +/** + * Samples for StorageAccounts ListByResourceGroup. + */ +public final class StorageAccountsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountListByResourceGroup.json + */ + /** + * Sample code: StorageAccountListByResourceGroup. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountListByResourceGroup(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().listByResourceGroup("res6117", com.azure.core.util.Context.NONE); + } +} +``` + +### StorageAccounts_ListKeys + +```java + +/** + * Samples for StorageAccounts ListKeys. + */ +public final class StorageAccountsListKeysSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountListKeys.json + */ + /** + * Sample code: StorageAccountListKeys. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountListKeys(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().listKeysWithResponse("res418", "sto2220", null, com.azure.core.util.Context.NONE); + } +} +``` + +### StorageAccounts_ListServiceSas + +```java +import com.azure.resourcemanager.storage.generated.models.Permissions; +import com.azure.resourcemanager.storage.generated.models.ServiceSasParameters; +import com.azure.resourcemanager.storage.generated.models.SignedResource; +import java.time.OffsetDateTime; + +/** + * Samples for StorageAccounts ListServiceSas. + */ +public final class StorageAccountsListServiceSasSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountListServiceSAS. + * json + */ + /** + * Sample code: StorageAccountListServiceSAS. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountListServiceSAS(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .listServiceSasWithResponse("res7439", "sto1299", + new ServiceSasParameters().withCanonicalizedResource("/blob/sto1299/music") + .withResource(SignedResource.C) + .withPermissions(Permissions.L) + .withSharedAccessExpiryTime(OffsetDateTime.parse("2017-05-24T11:32:48.8457197Z")), + com.azure.core.util.Context.NONE); + } +} +``` + +### StorageAccounts_RegenerateKey + +```java +import com.azure.resourcemanager.storage.generated.models.StorageAccountRegenerateKeyParameters; + +/** + * Samples for StorageAccounts RegenerateKey. + */ +public final class StorageAccountsRegenerateKeySamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountRegenerateKey. + * json + */ + /** + * Sample code: StorageAccountRegenerateKey. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountRegenerateKey(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .regenerateKeyWithResponse("res4167", "sto3539", + new StorageAccountRegenerateKeyParameters().withKeyName("fakeTokenPlaceholder"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountRegenerateKerbKey.json + */ + /** + * Sample code: StorageAccountRegenerateKerbKey. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountRegenerateKerbKey(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .regenerateKeyWithResponse("res4167", "sto3539", + new StorageAccountRegenerateKeyParameters().withKeyName("fakeTokenPlaceholder"), + com.azure.core.util.Context.NONE); + } +} +``` + +### StorageAccounts_RestoreBlobRanges + +```java +import com.azure.resourcemanager.storage.generated.models.BlobRestoreParameters; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreRange; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for StorageAccounts RestoreBlobRanges. + */ +public final class StorageAccountsRestoreBlobRangesSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/BlobRangesRestore.json + */ + /** + * Sample code: BlobRangesRestore. + * + * @param manager Entry point to StorageManager. + */ + public static void blobRangesRestore(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .restoreBlobRanges("res9101", "sto4445", + new BlobRestoreParameters().withTimeToRestore(OffsetDateTime.parse("2019-04-20T15:30:00.0000000Z")) + .withBlobRanges(Arrays.asList( + new BlobRestoreRange().withStartRange("container/blobpath1") + .withEndRange("container/blobpath2"), + new BlobRestoreRange().withStartRange("container2/blobpath3").withEndRange(""))), + com.azure.core.util.Context.NONE); + } +} +``` + +### StorageAccounts_RevokeUserDelegationKeys + +```java +/** + * Samples for StorageAccounts RevokeUserDelegationKeys. + */ +public final class StorageAccountsRevokeUserDelegationKeysSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountRevokeUserDelegationKeys.json + */ + /** + * Sample code: StorageAccountRevokeUserDelegationKeys. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountRevokeUserDelegationKeys(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .revokeUserDelegationKeysWithResponse("res4167", "sto3539", com.azure.core.util.Context.NONE); + } +} +``` + +### StorageAccounts_Update + +```java +import com.azure.resourcemanager.storage.generated.models.AccountImmutabilityPolicyProperties; +import com.azure.resourcemanager.storage.generated.models.AccountImmutabilityPolicyState; +import com.azure.resourcemanager.storage.generated.models.AccountType; +import com.azure.resourcemanager.storage.generated.models.ActiveDirectoryProperties; +import com.azure.resourcemanager.storage.generated.models.AllowedCopyScope; +import com.azure.resourcemanager.storage.generated.models.AzureFilesIdentityBasedAuthentication; +import com.azure.resourcemanager.storage.generated.models.DefaultAction; +import com.azure.resourcemanager.storage.generated.models.DirectoryServiceOptions; +import com.azure.resourcemanager.storage.generated.models.Encryption; +import com.azure.resourcemanager.storage.generated.models.EncryptionIdentity; +import com.azure.resourcemanager.storage.generated.models.EncryptionService; +import com.azure.resourcemanager.storage.generated.models.EncryptionServices; +import com.azure.resourcemanager.storage.generated.models.ExpirationAction; +import com.azure.resourcemanager.storage.generated.models.Identity; +import com.azure.resourcemanager.storage.generated.models.IdentityType; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageAccount; +import com.azure.resourcemanager.storage.generated.models.KeyPolicy; +import com.azure.resourcemanager.storage.generated.models.KeySource; +import com.azure.resourcemanager.storage.generated.models.KeyType; +import com.azure.resourcemanager.storage.generated.models.KeyVaultProperties; +import com.azure.resourcemanager.storage.generated.models.Kind; +import com.azure.resourcemanager.storage.generated.models.MinimumTlsVersion; +import com.azure.resourcemanager.storage.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.storage.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.storage.generated.models.ResourceAccessRule; +import com.azure.resourcemanager.storage.generated.models.RoutingChoice; +import com.azure.resourcemanager.storage.generated.models.RoutingPreference; +import com.azure.resourcemanager.storage.generated.models.SasPolicy; +import com.azure.resourcemanager.storage.generated.models.Sku; +import com.azure.resourcemanager.storage.generated.models.SkuName; +import com.azure.resourcemanager.storage.generated.models.StorageAccount; +import com.azure.resourcemanager.storage.generated.models.UserAssignedIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for StorageAccounts Update. + */ +public final class StorageAccountsUpdateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountUpdateWithImmutabilityPolicy.json + */ + /** + * Sample code: StorageAccountUpdateWithImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountUpdateWithImmutabilityPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = manager.storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withImmutableStorageWithVersioning(new ImmutableStorageAccount().withEnabled(true) + .withImmutabilityPolicy( + new AccountImmutabilityPolicyProperties().withImmutabilityPeriodSinceCreationInDays(15) + .withState(AccountImmutabilityPolicyState.LOCKED) + .withAllowProtectedAppendWrites(true))) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountUpdateUserAssignedIdentityWithFederatedIdentityClientId.json + */ + /** + * Sample code: StorageAccountUpdateUserAssignedIdentityWithFederatedIdentityClientId. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdateUserAssignedIdentityWithFederatedIdentityClientId( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = manager.storageAccounts() + .getByResourceGroupWithResponse("res131918", "sto131918", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withSku(new Sku().withName(SkuName.STANDARD_LRS)) + .withIdentity(new Identity().withType(IdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}", + new UserAssignedIdentity()))) + .withKind(Kind.STORAGE) + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_KEYVAULT) + .withKeyVaultProperties(new KeyVaultProperties().withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder") + .withKeyVaultUri("fakeTokenPlaceholder")) + .withEncryptionIdentity(new EncryptionIdentity().withEncryptionUserAssignedIdentity( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}") + .withEncryptionFederatedIdentityClientId("3109d1c4-a5de-4d84-8832-feabb916a4b6"))) + .apply(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountEnableAD.json + */ + /** + * Sample code: StorageAccountEnableAD. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountEnableAD(com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = manager.storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withAzureFilesIdentityBasedAuthentication( + new AzureFilesIdentityBasedAuthentication().withDirectoryServiceOptions(DirectoryServiceOptions.AD) + .withActiveDirectoryProperties(new ActiveDirectoryProperties().withDomainName("adtest.com") + .withNetBiosDomainName("adtest.com") + .withForestName("adtest.com") + .withDomainGuid("aebfc118-9fa9-4732-a21f-d98e41a77ae1") + .withDomainSid("S-1-5-21-2400535526-2334094090-2402026252") + .withAzureStorageSid("S-1-5-21-2400535526-2334094090-2402026252-0012") + .withSamAccountName("sam12498") + .withAccountType(AccountType.USER))) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountUpdateAllowedCopyScopeToAAD.json + */ + /** + * Sample code: StorageAccountUpdateAllowedCopyScopeToAAD. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountUpdateAllowedCopyScopeToAAD(com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = manager.storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE)) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withNetworkRuleSet(new NetworkRuleSet().withResourceAccessRules(Arrays.asList(new ResourceAccessRule() + .withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47") + .withResourceId( + "/subscriptions/a7e99807-abbf-4642-bdec-2c809a96a8bc/resourceGroups/res9407/providers/Microsoft.Synapse/workspaces/testworkspace"))) + .withDefaultAction(DefaultAction.ALLOW)) + .withRoutingPreference(new RoutingPreference().withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .withAllowedCopyScope(AllowedCopyScope.AAD) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountUpdateDisablePublicNetworkAccess.json + */ + /** + * Sample code: StorageAccountUpdateDisablePublicNetworkAccess. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdateDisablePublicNetworkAccess( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = manager.storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE)) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withNetworkRuleSet(new NetworkRuleSet().withResourceAccessRules(Arrays.asList(new ResourceAccessRule() + .withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47") + .withResourceId( + "/subscriptions/a7e99807-abbf-4642-bdec-2c809a96a8bc/resourceGroups/res9407/providers/Microsoft.Synapse/workspaces/testworkspace"))) + .withDefaultAction(DefaultAction.ALLOW)) + .withRoutingPreference(new RoutingPreference().withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) + .apply(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountEnableCMK.json + */ + /** + * Sample code: StorageAccountEnableCMK. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountEnableCMK(com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = manager.storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_KEYVAULT) + .withKeyVaultProperties(new KeyVaultProperties().withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder") + .withKeyVaultUri("fakeTokenPlaceholder"))) + .apply(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountUpdate.json + */ + /** + * Sample code: StorageAccountUpdate. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdate(com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = manager.storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE)) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withIsSftpEnabled(true) + .withIsLocalUserEnabled(true) + .withEnableExtendedGroups(true) + .withNetworkRuleSet(new NetworkRuleSet().withResourceAccessRules(Arrays.asList(new ResourceAccessRule() + .withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47") + .withResourceId( + "/subscriptions/a7e99807-abbf-4642-bdec-2c809a96a8bc/resourceGroups/res9407/providers/Microsoft.Synapse/workspaces/testworkspace"))) + .withDefaultAction(DefaultAction.ALLOW)) + .withRoutingPreference(new RoutingPreference().withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .withDefaultToOAuthAuthentication(false) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountUpdateUserAssignedEncryptionIdentityWithCMK.json + */ + /** + * Sample code: StorageAccountUpdateUserAssignedEncryptionIdentityWithCMK. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdateUserAssignedEncryptionIdentityWithCMK( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = manager.storageAccounts() + .getByResourceGroupWithResponse("res9101", "sto4445", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withSku(new Sku().withName(SkuName.STANDARD_LRS)) + .withIdentity(new Identity().withType(IdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}", + new UserAssignedIdentity()))) + .withKind(Kind.STORAGE) + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_KEYVAULT) + .withKeyVaultProperties(new KeyVaultProperties().withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder") + .withKeyVaultUri("fakeTokenPlaceholder")) + .withEncryptionIdentity(new EncryptionIdentity().withEncryptionUserAssignedIdentity( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}"))) + .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; + } +} +``` + +### StorageTaskAssignmentInstancesReport_List + +```java +/** + * Samples for StorageTaskAssignmentInstancesReport List. + */ +public final class StorageTaskAssignmentInstancesReportListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/storageTaskAssignmentsList/ + * ListStorageTaskAssignmentInstancesReportSummary.json + */ + /** + * Sample code: ListStorageTaskAssignmentInstancesReportSummary. + * + * @param manager Entry point to StorageManager. + */ + public static void listStorageTaskAssignmentInstancesReportSummary( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageTaskAssignmentInstancesReports() + .list("res4228", "sto4445", "myassignment1", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### StorageTaskAssignments_Create + +```java +import com.azure.resourcemanager.storage.generated.models.ExecutionTarget; +import com.azure.resourcemanager.storage.generated.models.ExecutionTrigger; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignmentExecutionContext; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignmentProperties; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignmentReport; +import com.azure.resourcemanager.storage.generated.models.TriggerParameters; +import com.azure.resourcemanager.storage.generated.models.TriggerType; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for StorageTaskAssignments Create. + */ +public final class StorageTaskAssignmentsCreateSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/storageTaskAssignmentsCrud/ + * PutStorageTaskAssignment.json + */ + /** + * Sample code: PutStorageTaskAssignment. + * + * @param manager Entry point to StorageManager. + */ + public static void putStorageTaskAssignment(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageTaskAssignments() + .define("myassignment1") + .withExistingStorageAccount("res4228", "sto4445") + .withProperties(new StorageTaskAssignmentProperties().withTaskId( + "/subscriptions/1f31ba14-ce16-4281-b9b4-3e78da6e1616/resourceGroups/res4228/providers/Microsoft.StorageActions/storageTasks/mytask1") + .withEnabled(true) + .withDescription("My Storage task assignment") + .withExecutionContext( + new StorageTaskAssignmentExecutionContext() + .withTarget(new ExecutionTarget().withPrefix(Arrays.asList("prefix1", "prefix2")) + .withExcludePrefix(Arrays.asList())) + .withTrigger(new ExecutionTrigger().withType(TriggerType.RUN_ONCE) + .withParameters(new TriggerParameters() + .withStartOn(OffsetDateTime.parse("2022-11-15T21:52:47.8145095Z"))))) + .withReport(new StorageTaskAssignmentReport().withPrefix("container1"))) + .create(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/storageTaskAssignmentsCrud/ + * PutStorageTaskAssignmentRequiredProperties.json + */ + /** + * Sample code: PutStorageTaskAssignmentRequiredProperties. + * + * @param manager Entry point to StorageManager. + */ + public static void + putStorageTaskAssignmentRequiredProperties(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageTaskAssignments() + .define("myassignment1") + .withExistingStorageAccount("res4228", "sto4445") + .withProperties(new StorageTaskAssignmentProperties().withTaskId( + "/subscriptions/1f31ba14-ce16-4281-b9b4-3e78da6e1616/resourceGroups/res4228/providers/Microsoft.StorageActions/storageTasks/mytask1") + .withEnabled(true) + .withDescription("My Storage task assignment") + .withExecutionContext( + new StorageTaskAssignmentExecutionContext() + .withTrigger(new ExecutionTrigger().withType(TriggerType.RUN_ONCE) + .withParameters(new TriggerParameters() + .withStartOn(OffsetDateTime.parse("2022-11-15T21:52:47.8145095Z"))))) + .withReport(new StorageTaskAssignmentReport().withPrefix("container1"))) + .create(); + } +} +``` + +### StorageTaskAssignments_Delete + +```java +/** + * Samples for StorageTaskAssignments Delete. + */ +public final class StorageTaskAssignmentsDeleteSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/storageTaskAssignmentsCrud/ + * DeleteStorageTaskAssignment.json + */ + /** + * Sample code: DeleteStorageTaskAssignment. + * + * @param manager Entry point to StorageManager. + */ + public static void deleteStorageTaskAssignment(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageTaskAssignments() + .delete("res4228", "sto4445", "myassignment1", com.azure.core.util.Context.NONE); + } +} +``` + +### StorageTaskAssignments_Get + +```java +/** + * Samples for StorageTaskAssignments Get. + */ +public final class StorageTaskAssignmentsGetSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/storageTaskAssignmentsCrud/ + * GetStorageTaskAssignment.json + */ + /** + * Sample code: GetStorageTaskAssignment. + * + * @param manager Entry point to StorageManager. + */ + public static void getStorageTaskAssignment(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageTaskAssignments() + .getWithResponse("res4228", "sto4445", "myassignment1", com.azure.core.util.Context.NONE); + } +} +``` + +### StorageTaskAssignments_List + +```java +/** + * Samples for StorageTaskAssignments List. + */ +public final class StorageTaskAssignmentsListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/storageTaskAssignmentsList/ + * ListStorageTaskAssignmentsForAccount.json + */ + /** + * Sample code: ListStorageTaskAssignmentsForAccount. + * + * @param manager Entry point to StorageManager. + */ + public static void + listStorageTaskAssignmentsForAccount(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageTaskAssignments().list("res4228", "sto4445", null, com.azure.core.util.Context.NONE); + } +} +``` + +### StorageTaskAssignments_Update + +```java +import com.azure.resourcemanager.storage.generated.models.ExecutionTarget; +import com.azure.resourcemanager.storage.generated.models.ExecutionTriggerUpdate; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignment; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignmentUpdateExecutionContext; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignmentUpdateProperties; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignmentUpdateReport; +import com.azure.resourcemanager.storage.generated.models.TriggerParametersUpdate; +import com.azure.resourcemanager.storage.generated.models.TriggerType; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for StorageTaskAssignments Update. + */ +public final class StorageTaskAssignmentsUpdateSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/storageTaskAssignmentsCrud/ + * PatchStorageTaskAssignment.json + */ + /** + * Sample code: PatchStorageTaskAssignment. + * + * @param manager Entry point to StorageManager. + */ + public static void patchStorageTaskAssignment(com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageTaskAssignment resource = manager.storageTaskAssignments() + .getWithResponse("res4228", "sto4445", "myassignment1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new StorageTaskAssignmentUpdateProperties().withEnabled(true) + .withDescription("My Storage task assignment") + .withExecutionContext(new StorageTaskAssignmentUpdateExecutionContext() + .withTarget(new ExecutionTarget().withPrefix(Arrays.asList("prefix1", "prefix2")) + .withExcludePrefix(Arrays.asList())) + .withTrigger(new ExecutionTriggerUpdate().withType(TriggerType.RUN_ONCE) + .withParameters(new TriggerParametersUpdate() + .withStartOn(OffsetDateTime.parse("2022-11-15T21:52:47.8145095Z"))))) + .withReport(new StorageTaskAssignmentUpdateReport().withPrefix("container1"))) + .apply(); + } +} +``` + +### StorageTaskAssignmentsInstancesReport_List + +```java +/** + * Samples for StorageTaskAssignmentsInstancesReport List. + */ +public final class StorageTaskAssignmentsInstancesReportListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/storageTaskAssignmentsList/ + * ListStorageTaskAssignmentsInstancesReportSummary.json + */ + /** + * Sample code: ListStorageTaskAssignmentsInstancesReportSummary. + * + * @param manager Entry point to StorageManager. + */ + public static void listStorageTaskAssignmentsInstancesReportSummary( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageTaskAssignmentsInstancesReports() + .list("res4228", "sto4445", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### Table_Create + +```java +import com.azure.resourcemanager.storage.generated.models.TableAccessPolicy; +import com.azure.resourcemanager.storage.generated.models.TableSignedIdentifier; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for Table Create. + */ +public final class TableCreateSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/TableOperationPut.json + */ + /** + * Sample code: TableOperationPut. + * + * @param manager Entry point to StorageManager. + */ + public static void tableOperationPut(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tables().define("table6185").withExistingStorageAccount("res3376", "sto328").create(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/TableOperationPutOrPatchAcls. + * json + */ + /** + * Sample code: TableOperationPutOrPatchAcls. + * + * @param manager Entry point to StorageManager. + */ + public static void + tableOperationPutOrPatchAcls(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tables() + .define("table6185") + .withExistingStorageAccount("res3376", "sto328") + .withSignedIdentifiers(Arrays.asList( + new TableSignedIdentifier().withId("MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI") + .withAccessPolicy( + new TableAccessPolicy().withStartTime(OffsetDateTime.parse("2022-03-17T08:49:37.0000000Z")) + .withExpiryTime(OffsetDateTime.parse("2022-03-20T08:49:37.0000000Z")) + .withPermission("raud")), + new TableSignedIdentifier().withId("PTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODklMTI") + .withAccessPolicy( + new TableAccessPolicy().withStartTime(OffsetDateTime.parse("2022-03-17T08:49:37.0000000Z")) + .withExpiryTime(OffsetDateTime.parse("2022-03-20T08:49:37.0000000Z")) + .withPermission("rad")))) + .create(); + } +} +``` + +### Table_Delete + +```java +/** + * Samples for Table Delete. + */ +public final class TableDeleteSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/TableOperationDelete.json + */ + /** + * Sample code: TableOperationDelete. + * + * @param manager Entry point to StorageManager. + */ + public static void tableOperationDelete(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tables().deleteWithResponse("res3376", "sto328", "table6185", com.azure.core.util.Context.NONE); + } +} +``` + +### Table_Get + +```java +/** + * Samples for Table Get. + */ +public final class TableGetSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/TableOperationGet.json + */ + /** + * Sample code: TableOperationGet. + * + * @param manager Entry point to StorageManager. + */ + public static void tableOperationGet(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tables().getWithResponse("res3376", "sto328", "table6185", com.azure.core.util.Context.NONE); + } +} +``` + +### Table_List + +```java +/** + * Samples for Table List. + */ +public final class TableListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/TableOperationList.json + */ + /** + * Sample code: TableOperationList. + * + * @param manager Entry point to StorageManager. + */ + public static void tableOperationList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tables().list("res9290", "sto328", com.azure.core.util.Context.NONE); + } +} +``` + +### Table_Update + +```java +import com.azure.resourcemanager.storage.generated.models.Table; +import com.azure.resourcemanager.storage.generated.models.TableAccessPolicy; +import com.azure.resourcemanager.storage.generated.models.TableSignedIdentifier; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for Table Update. + */ +public final class TableUpdateSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/TableOperationPutOrPatchAcls. + * json + */ + /** + * Sample code: TableOperationPutOrPatchAcls. + * + * @param manager Entry point to StorageManager. + */ + public static void + tableOperationPutOrPatchAcls(com.azure.resourcemanager.storage.generated.StorageManager manager) { + Table resource = manager.tables() + .getWithResponse("res3376", "sto328", "table6185", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withSignedIdentifiers(Arrays.asList( + new TableSignedIdentifier().withId("MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI") + .withAccessPolicy( + new TableAccessPolicy().withStartTime(OffsetDateTime.parse("2022-03-17T08:49:37.0000000Z")) + .withExpiryTime(OffsetDateTime.parse("2022-03-20T08:49:37.0000000Z")) + .withPermission("raud")), + new TableSignedIdentifier().withId("PTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODklMTI") + .withAccessPolicy( + new TableAccessPolicy().withStartTime(OffsetDateTime.parse("2022-03-17T08:49:37.0000000Z")) + .withExpiryTime(OffsetDateTime.parse("2022-03-20T08:49:37.0000000Z")) + .withPermission("rad")))) + .apply(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/TableOperationPatch.json + */ + /** + * Sample code: TableOperationPatch. + * + * @param manager Entry point to StorageManager. + */ + public static void tableOperationPatch(com.azure.resourcemanager.storage.generated.StorageManager manager) { + Table resource = manager.tables() + .getWithResponse("res3376", "sto328", "table6185", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } +} +``` + +### TableServices_GetServiceProperties + +```java +/** + * Samples for TableServices GetServiceProperties. + */ +public final class TableServicesGetServicePropertiesSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/TableServicesGet.json + */ + /** + * Sample code: TableServicesGet. + * + * @param manager Entry point to StorageManager. + */ + public static void tableServicesGet(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tableServices() + .getServicePropertiesWithResponse("res4410", "sto8607", com.azure.core.util.Context.NONE); + } +} +``` + +### TableServices_List + +```java +/** + * Samples for TableServices List. + */ +public final class TableServicesListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/TableServicesList.json + */ + /** + * Sample code: TableServicesList. + * + * @param manager Entry point to StorageManager. + */ + public static void tableServicesList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tableServices().listWithResponse("res9290", "sto1590", com.azure.core.util.Context.NONE); + } +} +``` + +### TableServices_SetServiceProperties + +```java +import com.azure.resourcemanager.storage.generated.models.AllowedMethods; +import com.azure.resourcemanager.storage.generated.models.CorsRule; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import java.util.Arrays; + +/** + * Samples for TableServices SetServiceProperties. + */ +public final class TableServicesSetServicePropertiesSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/TableServicesPut.json + */ + /** + * Sample code: TableServicesPut. + * + * @param manager Entry point to StorageManager. + */ + public static void tableServicesPut(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tableServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withCors(new CorsRules().withCorsRules(Arrays.asList( + new CorsRule().withAllowedOrigins(Arrays.asList("http://www.contoso.com", "http://www.fabrikam.com")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET, AllowedMethods.HEAD, AllowedMethods.POST, + AllowedMethods.OPTIONS, AllowedMethods.MERGE, AllowedMethods.PUT)) + .withMaxAgeInSeconds(100) + .withExposedHeaders(Arrays.asList("x-ms-meta-*")) + .withAllowedHeaders(Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")), + new CorsRule().withAllowedOrigins(Arrays.asList("*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET)) + .withMaxAgeInSeconds(2) + .withExposedHeaders(Arrays.asList("*")) + .withAllowedHeaders(Arrays.asList("*")), + new CorsRule().withAllowedOrigins(Arrays.asList("http://www.abc23.com", "https://www.fabrikam.com/*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET, AllowedMethods.PUT)) + .withMaxAgeInSeconds(2000) + .withExposedHeaders(Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")) + .withAllowedHeaders(Arrays.asList("x-ms-meta-12345675754564*"))))) + .create(); + } +} +``` + +### Usages_ListByLocation + +```java +/** + * Samples for Usages ListByLocation. + */ +public final class UsagesListByLocationSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountListLocationUsage.json + */ + /** + * Sample code: UsageList. + * + * @param manager Entry point to StorageManager. + */ + public static void usageList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.usages().listByLocation("eastus2(stage)", com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/storage/azure-resourcemanager-storage-generated/pom.xml b/sdk/storage/azure-resourcemanager-storage-generated/pom.xml new file mode 100644 index 0000000000000..eea836ece6678 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/pom.xml @@ -0,0 +1,63 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-storage-generated + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Storage Management + This package contains Microsoft Azure SDK for Storage Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Azure Storage Management API. Package tag package-2024-01. + 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 + false + + + + com.azure + azure-core + 1.54.1 + + + com.azure + azure-core-management + 1.15.6 + + + diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/StorageManager.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/StorageManager.java new file mode 100644 index 0000000000000..229ddb8fc1720 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/StorageManager.java @@ -0,0 +1,649 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated; + +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.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.StorageManagementClient; +import com.azure.resourcemanager.storage.generated.implementation.BlobContainersImpl; +import com.azure.resourcemanager.storage.generated.implementation.BlobInventoryPoliciesImpl; +import com.azure.resourcemanager.storage.generated.implementation.BlobServicesImpl; +import com.azure.resourcemanager.storage.generated.implementation.DeletedAccountsImpl; +import com.azure.resourcemanager.storage.generated.implementation.EncryptionScopesImpl; +import com.azure.resourcemanager.storage.generated.implementation.FileServicesImpl; +import com.azure.resourcemanager.storage.generated.implementation.FileSharesImpl; +import com.azure.resourcemanager.storage.generated.implementation.LocalUsersOperationsImpl; +import com.azure.resourcemanager.storage.generated.implementation.ManagementPoliciesImpl; +import com.azure.resourcemanager.storage.generated.implementation.NetworkSecurityPerimeterConfigurationsImpl; +import com.azure.resourcemanager.storage.generated.implementation.ObjectReplicationPoliciesOperationsImpl; +import com.azure.resourcemanager.storage.generated.implementation.OperationsImpl; +import com.azure.resourcemanager.storage.generated.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.storage.generated.implementation.PrivateLinkResourcesImpl; +import com.azure.resourcemanager.storage.generated.implementation.QueueServicesImpl; +import com.azure.resourcemanager.storage.generated.implementation.QueuesImpl; +import com.azure.resourcemanager.storage.generated.implementation.SkusImpl; +import com.azure.resourcemanager.storage.generated.implementation.StorageAccountsImpl; +import com.azure.resourcemanager.storage.generated.implementation.StorageManagementClientBuilder; +import com.azure.resourcemanager.storage.generated.implementation.StorageTaskAssignmentInstancesReportsImpl; +import com.azure.resourcemanager.storage.generated.implementation.StorageTaskAssignmentsImpl; +import com.azure.resourcemanager.storage.generated.implementation.StorageTaskAssignmentsInstancesReportsImpl; +import com.azure.resourcemanager.storage.generated.implementation.TableServicesImpl; +import com.azure.resourcemanager.storage.generated.implementation.TablesImpl; +import com.azure.resourcemanager.storage.generated.implementation.UsagesImpl; +import com.azure.resourcemanager.storage.generated.models.BlobContainers; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicies; +import com.azure.resourcemanager.storage.generated.models.BlobServices; +import com.azure.resourcemanager.storage.generated.models.DeletedAccounts; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopes; +import com.azure.resourcemanager.storage.generated.models.FileServices; +import com.azure.resourcemanager.storage.generated.models.FileShares; +import com.azure.resourcemanager.storage.generated.models.LocalUsersOperations; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicies; +import com.azure.resourcemanager.storage.generated.models.NetworkSecurityPerimeterConfigurations; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPoliciesOperations; +import com.azure.resourcemanager.storage.generated.models.Operations; +import com.azure.resourcemanager.storage.generated.models.PrivateEndpointConnections; +import com.azure.resourcemanager.storage.generated.models.PrivateLinkResources; +import com.azure.resourcemanager.storage.generated.models.QueueServices; +import com.azure.resourcemanager.storage.generated.models.Queues; +import com.azure.resourcemanager.storage.generated.models.Skus; +import com.azure.resourcemanager.storage.generated.models.StorageAccounts; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignmentInstancesReports; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignments; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignmentsInstancesReports; +import com.azure.resourcemanager.storage.generated.models.TableServices; +import com.azure.resourcemanager.storage.generated.models.Tables; +import com.azure.resourcemanager.storage.generated.models.Usages; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to StorageManager. + * The Azure Storage Management API. + */ +public final class StorageManager { + private BlobServices blobServices; + + private BlobContainers blobContainers; + + private FileServices fileServices; + + private FileShares fileShares; + + private QueueServices queueServices; + + private Queues queues; + + private Operations operations; + + private Skus skus; + + private StorageAccounts storageAccounts; + + private DeletedAccounts deletedAccounts; + + private Usages usages; + + private ManagementPolicies managementPolicies; + + private BlobInventoryPolicies blobInventoryPolicies; + + private PrivateEndpointConnections privateEndpointConnections; + + private PrivateLinkResources privateLinkResources; + + private ObjectReplicationPoliciesOperations objectReplicationPoliciesOperations; + + private LocalUsersOperations localUsersOperations; + + private EncryptionScopes encryptionScopes; + + private TableServices tableServices; + + private Tables tables; + + private NetworkSecurityPerimeterConfigurations networkSecurityPerimeterConfigurations; + + private StorageTaskAssignments storageTaskAssignments; + + private StorageTaskAssignmentsInstancesReports storageTaskAssignmentsInstancesReports; + + private StorageTaskAssignmentInstancesReports storageTaskAssignmentInstancesReports; + + private final StorageManagementClient clientObject; + + private StorageManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new StorageManagementClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Storage service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Storage service API instance. + */ + public static StorageManager 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 Storage service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Storage service API instance. + */ + public static StorageManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new StorageManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create StorageManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new StorageManager.Configurable(); + } + + /** + * The Configurable allowing configurations to be set. + */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + + 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 Storage service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Storage service API instance. + */ + public StorageManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder.append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.storage.generated") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder.append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (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 StorageManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of BlobServices. It manages BlobServiceProperties. + * + * @return Resource collection API of BlobServices. + */ + public BlobServices blobServices() { + if (this.blobServices == null) { + this.blobServices = new BlobServicesImpl(clientObject.getBlobServices(), this); + } + return blobServices; + } + + /** + * Gets the resource collection API of BlobContainers. It manages BlobContainer, ImmutabilityPolicy. + * + * @return Resource collection API of BlobContainers. + */ + public BlobContainers blobContainers() { + if (this.blobContainers == null) { + this.blobContainers = new BlobContainersImpl(clientObject.getBlobContainers(), this); + } + return blobContainers; + } + + /** + * Gets the resource collection API of FileServices. It manages FileServiceProperties. + * + * @return Resource collection API of FileServices. + */ + public FileServices fileServices() { + if (this.fileServices == null) { + this.fileServices = new FileServicesImpl(clientObject.getFileServices(), this); + } + return fileServices; + } + + /** + * Gets the resource collection API of FileShares. It manages FileShare. + * + * @return Resource collection API of FileShares. + */ + public FileShares fileShares() { + if (this.fileShares == null) { + this.fileShares = new FileSharesImpl(clientObject.getFileShares(), this); + } + return fileShares; + } + + /** + * Gets the resource collection API of QueueServices. It manages QueueServiceProperties. + * + * @return Resource collection API of QueueServices. + */ + public QueueServices queueServices() { + if (this.queueServices == null) { + this.queueServices = new QueueServicesImpl(clientObject.getQueueServices(), this); + } + return queueServices; + } + + /** + * Gets the resource collection API of Queues. It manages StorageQueue. + * + * @return Resource collection API of Queues. + */ + public Queues queues() { + if (this.queues == null) { + this.queues = new QueuesImpl(clientObject.getQueues(), this); + } + return queues; + } + + /** + * 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 Skus. + * + * @return Resource collection API of Skus. + */ + public Skus skus() { + if (this.skus == null) { + this.skus = new SkusImpl(clientObject.getSkus(), this); + } + return skus; + } + + /** + * Gets the resource collection API of StorageAccounts. It manages StorageAccount. + * + * @return Resource collection API of StorageAccounts. + */ + public StorageAccounts storageAccounts() { + if (this.storageAccounts == null) { + this.storageAccounts = new StorageAccountsImpl(clientObject.getStorageAccounts(), this); + } + return storageAccounts; + } + + /** + * Gets the resource collection API of DeletedAccounts. + * + * @return Resource collection API of DeletedAccounts. + */ + public DeletedAccounts deletedAccounts() { + if (this.deletedAccounts == null) { + this.deletedAccounts = new DeletedAccountsImpl(clientObject.getDeletedAccounts(), this); + } + return deletedAccounts; + } + + /** + * Gets the resource collection API of Usages. + * + * @return Resource collection API of Usages. + */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(clientObject.getUsages(), this); + } + return usages; + } + + /** + * Gets the resource collection API of ManagementPolicies. It manages ManagementPolicy. + * + * @return Resource collection API of ManagementPolicies. + */ + public ManagementPolicies managementPolicies() { + if (this.managementPolicies == null) { + this.managementPolicies = new ManagementPoliciesImpl(clientObject.getManagementPolicies(), this); + } + return managementPolicies; + } + + /** + * Gets the resource collection API of BlobInventoryPolicies. It manages BlobInventoryPolicy. + * + * @return Resource collection API of BlobInventoryPolicies. + */ + public BlobInventoryPolicies blobInventoryPolicies() { + if (this.blobInventoryPolicies == null) { + this.blobInventoryPolicies = new BlobInventoryPoliciesImpl(clientObject.getBlobInventoryPolicies(), this); + } + return blobInventoryPolicies; + } + + /** + * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection. + * + * @return Resource collection API of PrivateEndpointConnections. + */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections + = new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** + * Gets the resource collection API of PrivateLinkResources. + * + * @return Resource collection API of PrivateLinkResources. + */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; + } + + /** + * Gets the resource collection API of ObjectReplicationPoliciesOperations. It manages ObjectReplicationPolicy. + * + * @return Resource collection API of ObjectReplicationPoliciesOperations. + */ + public ObjectReplicationPoliciesOperations objectReplicationPoliciesOperations() { + if (this.objectReplicationPoliciesOperations == null) { + this.objectReplicationPoliciesOperations = new ObjectReplicationPoliciesOperationsImpl( + clientObject.getObjectReplicationPoliciesOperations(), this); + } + return objectReplicationPoliciesOperations; + } + + /** + * Gets the resource collection API of LocalUsersOperations. It manages LocalUser. + * + * @return Resource collection API of LocalUsersOperations. + */ + public LocalUsersOperations localUsersOperations() { + if (this.localUsersOperations == null) { + this.localUsersOperations = new LocalUsersOperationsImpl(clientObject.getLocalUsersOperations(), this); + } + return localUsersOperations; + } + + /** + * Gets the resource collection API of EncryptionScopes. It manages EncryptionScope. + * + * @return Resource collection API of EncryptionScopes. + */ + public EncryptionScopes encryptionScopes() { + if (this.encryptionScopes == null) { + this.encryptionScopes = new EncryptionScopesImpl(clientObject.getEncryptionScopes(), this); + } + return encryptionScopes; + } + + /** + * Gets the resource collection API of TableServices. It manages TableServiceProperties. + * + * @return Resource collection API of TableServices. + */ + public TableServices tableServices() { + if (this.tableServices == null) { + this.tableServices = new TableServicesImpl(clientObject.getTableServices(), this); + } + return tableServices; + } + + /** + * Gets the resource collection API of Tables. It manages Table. + * + * @return Resource collection API of Tables. + */ + public Tables tables() { + if (this.tables == null) { + this.tables = new TablesImpl(clientObject.getTables(), this); + } + return tables; + } + + /** + * Gets the resource collection API of NetworkSecurityPerimeterConfigurations. + * + * @return Resource collection API of NetworkSecurityPerimeterConfigurations. + */ + public NetworkSecurityPerimeterConfigurations networkSecurityPerimeterConfigurations() { + if (this.networkSecurityPerimeterConfigurations == null) { + this.networkSecurityPerimeterConfigurations = new NetworkSecurityPerimeterConfigurationsImpl( + clientObject.getNetworkSecurityPerimeterConfigurations(), this); + } + return networkSecurityPerimeterConfigurations; + } + + /** + * Gets the resource collection API of StorageTaskAssignments. It manages StorageTaskAssignment. + * + * @return Resource collection API of StorageTaskAssignments. + */ + public StorageTaskAssignments storageTaskAssignments() { + if (this.storageTaskAssignments == null) { + this.storageTaskAssignments + = new StorageTaskAssignmentsImpl(clientObject.getStorageTaskAssignments(), this); + } + return storageTaskAssignments; + } + + /** + * Gets the resource collection API of StorageTaskAssignmentsInstancesReports. + * + * @return Resource collection API of StorageTaskAssignmentsInstancesReports. + */ + public StorageTaskAssignmentsInstancesReports storageTaskAssignmentsInstancesReports() { + if (this.storageTaskAssignmentsInstancesReports == null) { + this.storageTaskAssignmentsInstancesReports = new StorageTaskAssignmentsInstancesReportsImpl( + clientObject.getStorageTaskAssignmentsInstancesReports(), this); + } + return storageTaskAssignmentsInstancesReports; + } + + /** + * Gets the resource collection API of StorageTaskAssignmentInstancesReports. + * + * @return Resource collection API of StorageTaskAssignmentInstancesReports. + */ + public StorageTaskAssignmentInstancesReports storageTaskAssignmentInstancesReports() { + if (this.storageTaskAssignmentInstancesReports == null) { + this.storageTaskAssignmentInstancesReports = new StorageTaskAssignmentInstancesReportsImpl( + clientObject.getStorageTaskAssignmentInstancesReports(), this); + } + return storageTaskAssignmentInstancesReports; + } + + /** + * Gets wrapped service client StorageManagementClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client StorageManagementClient. + */ + public StorageManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/BlobContainersClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/BlobContainersClient.java new file mode 100644 index 0000000000000..6827a610aac08 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/BlobContainersClient.java @@ -0,0 +1,670 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.models.BlobContainerInner; +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LeaseContainerResponseInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LegalHoldInner; +import com.azure.resourcemanager.storage.generated.fluent.models.ListContainerItemInner; +import com.azure.resourcemanager.storage.generated.models.BlobContainersCreateOrUpdateImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.BlobContainersDeleteImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.BlobContainersExtendImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.BlobContainersGetImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.BlobContainersLockImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.LeaseContainerRequest; +import com.azure.resourcemanager.storage.generated.models.ListContainersInclude; + +/** + * An instance of this class provides access to all the operations defined in BlobContainersClient. + */ +public interface BlobContainersClient { + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation + * token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 response schema as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation + * token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. + * @param filter Optional. When specified, only container names starting with the filter will be listed. + * @param include Optional, used to include the properties for soft deleted blob containers. + * @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 response schema as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, String maxpagesize, + String filter, ListContainersInclude include, Context context); + + /** + * Creates a new container under the specified account as described by request body. The container resource includes + * metadata and properties for that container. It does not include a list of the blobs contained by the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties of the blob container to create. + * @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 properties of the blob container, including Id, resource name, resource type, Etag along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse(String resourceGroupName, String accountName, String containerName, + BlobContainerInner blobContainer, Context context); + + /** + * Creates a new container under the specified account as described by request body. The container resource includes + * metadata and properties for that container. It does not include a list of the blobs contained by the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties of the blob container to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 properties of the blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobContainerInner create(String resourceGroupName, String accountName, String containerName, + BlobContainerInner blobContainer); + + /** + * Updates container properties as specified in request body. Properties not mentioned in the request will be + * unchanged. Update fails if the specified container doesn't already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties to update for the blob container. + * @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 properties of the blob container, including Id, resource name, resource type, Etag along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String accountName, String containerName, + BlobContainerInner blobContainer, Context context); + + /** + * Updates container properties as specified in request body. Properties not mentioned in the request will be + * unchanged. Update fails if the specified container doesn't already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties to update for the blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 properties of the blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobContainerInner update(String resourceGroupName, String accountName, String containerName, + BlobContainerInner blobContainer); + + /** + * Gets properties of a specified container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @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 properties of a specified container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, String containerName, + Context context); + + /** + * Gets properties of a specified container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 properties of a specified container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobContainerInner get(String resourceGroupName, String accountName, String containerName); + + /** + * Deletes specified container under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, String containerName, + Context context); + + /** + * Deletes specified container under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String containerName); + + /** + * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append + * pattern and does not clear out the existing tags that are not specified in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be set to a blob container. + * @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 LegalHold property of a blob container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response setLegalHoldWithResponse(String resourceGroupName, String accountName, + String containerName, LegalHoldInner legalHold, Context context); + + /** + * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append + * pattern and does not clear out the existing tags that are not specified in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be set to a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 LegalHold property of a blob container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LegalHoldInner setLegalHold(String resourceGroupName, String accountName, String containerName, + LegalHoldInner legalHold); + + /** + * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold + * clears out only the specified tags in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be clear from a blob container. + * @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 LegalHold property of a blob container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response clearLegalHoldWithResponse(String resourceGroupName, String accountName, + String containerName, LegalHoldInner legalHold, Context context); + + /** + * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold + * clears out only the specified tags in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be clear from a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 LegalHold property of a blob container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LegalHoldInner clearLegalHold(String resourceGroupName, String accountName, String containerName, + LegalHoldInner legalHold); + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for + * this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @param parameters The ImmutabilityPolicy Properties that will be created or updated to a blob container. + * @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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobContainersCreateOrUpdateImmutabilityPolicyResponse createOrUpdateImmutabilityPolicyWithResponse( + String resourceGroupName, String accountName, String containerName, String ifMatch, + ImmutabilityPolicyInner parameters, Context context); + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for + * this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImmutabilityPolicyInner createOrUpdateImmutabilityPolicy(String resourceGroupName, String accountName, + String containerName); + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @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 existing immutability policy along with the corresponding ETag in response headers and body. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobContainersGetImmutabilityPolicyResponse getImmutabilityPolicyWithResponse(String resourceGroupName, + String accountName, String containerName, String ifMatch, Context context); + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 existing immutability policy along with the corresponding ETag in response headers and body. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImmutabilityPolicyInner getImmutabilityPolicy(String resourceGroupName, String accountName, String containerName); + + /** + * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to + * 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the + * only way is to delete the container after deleting all expired blobs inside the policy locked container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobContainersDeleteImmutabilityPolicyResponse deleteImmutabilityPolicyWithResponse(String resourceGroupName, + String accountName, String containerName, String ifMatch, Context context); + + /** + * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to + * 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the + * only way is to delete the container after deleting all expired blobs inside the policy locked container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImmutabilityPolicyInner deleteImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, + String ifMatch); + + /** + * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is + * ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobContainersLockImmutabilityPolicyResponse lockImmutabilityPolicyWithResponse(String resourceGroupName, + String accountName, String containerName, String ifMatch, Context context); + + /** + * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is + * ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImmutabilityPolicyInner lockImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, + String ifMatch); + + /** + * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a + * Locked policy will be this action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @param parameters The ImmutabilityPolicy Properties that will be extended for a blob container. + * @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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobContainersExtendImmutabilityPolicyResponse extendImmutabilityPolicyWithResponse(String resourceGroupName, + String accountName, String containerName, String ifMatch, ImmutabilityPolicyInner parameters, Context context); + + /** + * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a + * Locked policy will be this action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImmutabilityPolicyInner extendImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, + String ifMatch); + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock + * duration can be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @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 lease Container response schema along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response leaseWithResponse(String resourceGroupName, String accountName, + String containerName, LeaseContainerRequest parameters, Context context); + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock + * duration can be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 lease Container response schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LeaseContainerResponseInner lease(String resourceGroupName, String accountName, String containerName); + + /** + * This operation migrates a blob container from container level WORM to object level immutability enabled + * container. Prerequisites require a container level immutability policy either in locked or unlocked state, + * Account level versioning must be enabled and there should be no Legal hold on the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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> beginObjectLevelWorm(String resourceGroupName, String accountName, + String containerName); + + /** + * This operation migrates a blob container from container level WORM to object level immutability enabled + * container. Prerequisites require a container level immutability policy either in locked or unlocked state, + * Account level versioning must be enabled and there should be no Legal hold on the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @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> beginObjectLevelWorm(String resourceGroupName, String accountName, + String containerName, Context context); + + /** + * This operation migrates a blob container from container level WORM to object level immutability enabled + * container. Prerequisites require a container level immutability policy either in locked or unlocked state, + * Account level versioning must be enabled and there should be no Legal hold on the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 objectLevelWorm(String resourceGroupName, String accountName, String containerName); + + /** + * This operation migrates a blob container from container level WORM to object level immutability enabled + * container. Prerequisites require a container level immutability policy either in locked or unlocked state, + * Account level versioning must be enabled and there should be no Legal hold on the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @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 objectLevelWorm(String resourceGroupName, String accountName, String containerName, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/BlobInventoryPoliciesClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/BlobInventoryPoliciesClient.java new file mode 100644 index 0000000000000..07590b95e13ac --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/BlobInventoryPoliciesClient.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobInventoryPolicyInner; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyName; + +/** + * An instance of this class provides access to all the operations defined in BlobInventoryPoliciesClient. + */ +public interface BlobInventoryPoliciesClient { + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @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 blob inventory policy associated with the specified storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, Context context); + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 blob inventory policy associated with the specified storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobInventoryPolicyInner get(String resourceGroupName, String accountName, + BlobInventoryPolicyName blobInventoryPolicyName); + + /** + * Sets the blob inventory policy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @param properties The blob inventory policy set to a storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account blob inventory policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, BlobInventoryPolicyInner properties, Context context); + + /** + * Sets the blob inventory policy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @param properties The blob inventory policy set to a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account blob inventory policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobInventoryPolicyInner createOrUpdate(String resourceGroupName, String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, BlobInventoryPolicyInner properties); + + /** + * Deletes the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, Context context); + + /** + * Deletes the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName); + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 blob inventory policy associated with the specified storage account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 blob inventory policy associated with the specified storage account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/BlobServicesClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/BlobServicesClient.java new file mode 100644 index 0000000000000..bdcf9589d6f8e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/BlobServicesClient.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobServicePropertiesInner; + +/** + * An instance of this class provides access to all the operations defined in BlobServicesClient. + */ +public interface BlobServicesClient { + /** + * List blob services of storage account. It returns a collection of one object named default. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List blob services of storage account. It returns a collection of one object named default. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics + * and CORS (Cross-Origin Resource Sharing) rules. + * @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 properties of a storage account’s Blob service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response setServicePropertiesWithResponse(String resourceGroupName, String accountName, + BlobServicePropertiesInner parameters, Context context); + + /** + * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics + * and CORS (Cross-Origin Resource Sharing) rules. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 properties of a storage account’s Blob service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobServicePropertiesInner setServiceProperties(String resourceGroupName, String accountName, + BlobServicePropertiesInner parameters); + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getServicePropertiesWithResponse(String resourceGroupName, String accountName, + Context context); + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/DeletedAccountsClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/DeletedAccountsClient.java new file mode 100644 index 0000000000000..2c9d76d06a37b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/DeletedAccountsClient.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.DeletedAccountInner; + +/** + * An instance of this class provides access to all the operations defined in DeletedAccountsClient. + */ +public interface DeletedAccountsClient { + /** + * Lists deleted accounts under the subscription. + * + * @throws com.azure.core.management.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 from the List Deleted Accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists deleted accounts under the subscription. + * + * @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 from the List Deleted Accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Get properties of specified deleted account resource. + * + * @param deletedAccountName Name of the deleted storage account. + * @param location The location of the deleted storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of specified deleted account resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String deletedAccountName, String location, Context context); + + /** + * Get properties of specified deleted account resource. + * + * @param deletedAccountName Name of the deleted storage account. + * @param location The location of the deleted storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of specified deleted account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeletedAccountInner get(String deletedAccountName, String location); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/EncryptionScopesClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/EncryptionScopesClient.java new file mode 100644 index 0000000000000..a8f6be6c8efec --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/EncryptionScopesClient.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.EncryptionScopeInner; +import com.azure.resourcemanager.storage.generated.models.ListEncryptionScopesInclude; + +/** + * An instance of this class provides access to all the operations defined in EncryptionScopesClient. + */ +public interface EncryptionScopesClient { + /** + * Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope + * is already created and a subsequent request is issued with different properties, the encryption scope properties + * will be updated per the specified request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption + * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + * Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param encryptionScope Encryption scope properties to be used for the create or update. + * @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 Encryption Scope resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response putWithResponse(String resourceGroupName, String accountName, + String encryptionScopeName, EncryptionScopeInner encryptionScope, Context context); + + /** + * Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope + * is already created and a subsequent request is issued with different properties, the encryption scope properties + * will be updated per the specified request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption + * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + * Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param encryptionScope Encryption scope properties to be used for the create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Encryption Scope resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EncryptionScopeInner put(String resourceGroupName, String accountName, String encryptionScopeName, + EncryptionScopeInner encryptionScope); + + /** + * Update encryption scope properties as specified in the request body. Update fails if the specified encryption + * scope does not already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption + * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + * Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param encryptionScope Encryption scope properties to be used for the update. + * @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 Encryption Scope resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response patchWithResponse(String resourceGroupName, String accountName, + String encryptionScopeName, EncryptionScopeInner encryptionScope, Context context); + + /** + * Update encryption scope properties as specified in the request body. Update fails if the specified encryption + * scope does not already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption + * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + * Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param encryptionScope Encryption scope properties to be used for the update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Encryption Scope resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EncryptionScopeInner patch(String resourceGroupName, String accountName, String encryptionScopeName, + EncryptionScopeInner encryptionScope); + + /** + * Returns the properties for the specified encryption scope. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption + * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + * Every dash (-) character must be immediately preceded and followed by a letter or number. + * @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 Encryption Scope resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, + String encryptionScopeName, Context context); + + /** + * Returns the properties for the specified encryption scope. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption + * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + * Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Encryption Scope resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EncryptionScopeInner get(String resourceGroupName, String accountName, String encryptionScopeName); + + /** + * Lists all the encryption scopes available under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Lists all the encryption scopes available under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of encryption scopes that will be included in the list + * response. + * @param filter Optional. When specified, only encryption scope names starting with the filter will be listed. + * @param include Optional, when specified, will list encryption scopes with the specific state. Defaults to All. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Integer maxpagesize, + String filter, ListEncryptionScopesInclude include, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/FileServicesClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/FileServicesClient.java new file mode 100644 index 0000000000000..f9af186de1d9a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/FileServicesClient.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.FileServiceItemsInner; +import com.azure.resourcemanager.storage.generated.fluent.models.FileServicePropertiesInner; +import com.azure.resourcemanager.storage.generated.fluent.models.FileServiceUsageInner; + +/** + * An instance of this class provides access to all the operations defined in FileServicesClient. + */ +public interface FileServicesClient { + /** + * List all file services in storage accounts. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * List all file services in storage accounts. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileServiceItemsInner list(String resourceGroupName, String accountName); + + /** + * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of file services in storage accounts, including CORS (Cross-Origin Resource + * Sharing) rules. + * @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 properties of File services in storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response setServicePropertiesWithResponse(String resourceGroupName, String accountName, + FileServicePropertiesInner parameters, Context context); + + /** + * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of file services in storage accounts, including CORS (Cross-Origin Resource + * Sharing) rules. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 properties of File services in storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileServicePropertiesInner setServiceProperties(String resourceGroupName, String accountName, + FileServicePropertiesInner parameters); + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getServicePropertiesWithResponse(String resourceGroupName, String accountName, + Context context); + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) + * rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName); + + /** + * Gets the usages of file service in storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 usages of file service in storage account as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listServiceUsages(String resourceGroupName, String accountName); + + /** + * Gets the usages of file service in storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of file service usages to be included in the list + * response. + * @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 usages of file service in storage account as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listServiceUsages(String resourceGroupName, String accountName, + Integer maxpagesize, Context context); + + /** + * Gets the usage of file service in storage account including account limits, file share limits and constants used + * in recommendations and bursting formula. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 usage of file service in storage account including account limits, file share limits and constants + * used in recommendations and bursting formula along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getServiceUsageWithResponse(String resourceGroupName, String accountName, + Context context); + + /** + * Gets the usage of file service in storage account including account limits, file share limits and constants used + * in recommendations and bursting formula. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 usage of file service in storage account including account limits, file share limits and constants + * used in recommendations and bursting formula. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileServiceUsageInner getServiceUsage(String resourceGroupName, String accountName); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/FileSharesClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/FileSharesClient.java new file mode 100644 index 0000000000000..c21858c42aa0b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/FileSharesClient.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.FileShareInner; +import com.azure.resourcemanager.storage.generated.fluent.models.FileShareItemInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LeaseShareResponseInner; +import com.azure.resourcemanager.storage.generated.models.DeletedShare; +import com.azure.resourcemanager.storage.generated.models.FileSharesLeaseResponse; +import com.azure.resourcemanager.storage.generated.models.LeaseShareRequest; + +/** + * An instance of this class provides access to all the operations defined in FileSharesClient. + */ +public interface FileSharesClient { + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 response schema as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. + * @param filter Optional. When specified, only share names starting with the filter will be listed. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: deleted, + * snapshots. Should be passed as a string with delimiter ','. + * @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 response schema as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, String maxpagesize, + String filter, String expand, Context context); + + /** + * Creates a new share under the specified account as described by request body. The share resource includes + * metadata and properties for that share. It does not include a list of the files contained by the share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties of the file share to create. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: snapshots. + * Should be passed as a string with delimiter ','. + * @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 properties of the file share, including Id, resource name, resource type, Etag along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse(String resourceGroupName, String accountName, String shareName, + FileShareInner fileShare, String expand, Context context); + + /** + * Creates a new share under the specified account as described by request body. The share resource includes + * metadata and properties for that share. It does not include a list of the files contained by the share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties of the file share to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 properties of the file share, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileShareInner create(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare); + + /** + * Updates share properties as specified in request body. Properties not mentioned in the request will not be + * changed. Update fails if the specified share does not already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties to update for the file share. + * @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 properties of the file share, including Id, resource name, resource type, Etag along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String accountName, String shareName, + FileShareInner fileShare, Context context); + + /** + * Updates share properties as specified in request body. Properties not mentioned in the request will not be + * changed. Update fails if the specified share does not already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties to update for the file share. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 properties of the file share, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileShareInner update(String resourceGroupName, String accountName, String shareName, FileShareInner fileShare); + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: stats. Should + * be passed as a string with delimiter ','. + * @param xMsSnapshot Optional, used to retrieve properties of a snapshot. + * @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 properties of a specified share along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, String shareName, + String expand, String xMsSnapshot, Context context); + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 properties of a specified share. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileShareInner get(String resourceGroupName, String accountName, String shareName); + + /** + * Deletes specified share under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param xMsSnapshot Optional, used to delete a snapshot. + * @param include Optional. Valid values are: snapshots, leased-snapshots, none. The default value is snapshots. For + * 'snapshots', the file share is deleted including all of its file share snapshots. If the file share contains + * leased-snapshots, the deletion fails. For 'leased-snapshots', the file share is deleted included all of its file + * share snapshots (leased/unleased). For 'none', the file share is deleted if it has no share snapshots. If the + * file share contains any snapshots (leased or unleased), the deletion fails. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, String shareName, + String xMsSnapshot, String include, Context context); + + /** + * Deletes specified share under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String shareName); + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param deletedShare The deletedShare parameter. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response restoreWithResponse(String resourceGroupName, String accountName, String shareName, + DeletedShare deletedShare, Context context); + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param deletedShare The deletedShare parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 restore(String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare); + + /** + * The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param xMsSnapshot Optional. Specify the snapshot time to lease a snapshot. + * @param parameters Lease Share request body. + * @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 lease Share response schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileSharesLeaseResponse leaseWithResponse(String resourceGroupName, String accountName, String shareName, + String xMsSnapshot, LeaseShareRequest parameters, Context context); + + /** + * The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 lease Share response schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LeaseShareResponseInner lease(String resourceGroupName, String accountName, String shareName); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/LocalUsersOperationsClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/LocalUsersOperationsClient.java new file mode 100644 index 0000000000000..8319ee63a72d1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/LocalUsersOperationsClient.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserKeysInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserRegeneratePasswordResultInner; +import com.azure.resourcemanager.storage.generated.models.ListLocalUserIncludeParam; + +/** + * An instance of this class provides access to all the operations defined in LocalUsersOperationsClient. + */ +public interface LocalUsersOperationsClient { + /** + * List the local users associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of local users requested, and if paging is required, a URL to the next page of local users as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List the local users associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of local users that will be included in the list + * response. + * @param filter Optional. When specified, only local user names starting with the filter will be listed. + * @param include Optional, when specified, will list local users enabled for the specific protocol. Lists all users + * by default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of local users requested, and if paging is required, a URL to the next page of local users as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Integer maxpagesize, String filter, + ListLocalUserIncludeParam include, Context context); + + /** + * Get the local user of the storage account by username. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user of the storage account by username along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, String username, + Context context); + + /** + * Get the local user of the storage account by username. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user of the storage account by username. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LocalUserInner get(String resourceGroupName, String accountName, String username); + + /** + * Create or update the properties of a local user associated with the storage account. Properties for NFSv3 + * enablement and extended groups cannot be set with other properties. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param properties The local user associated with a storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user associated with the storage accounts along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String accountName, String username, + LocalUserInner properties, Context context); + + /** + * Create or update the properties of a local user associated with the storage account. Properties for NFSv3 + * enablement and extended groups cannot be set with other properties. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param properties The local user associated with a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user associated with the storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LocalUserInner createOrUpdate(String resourceGroupName, String accountName, String username, + LocalUserInner properties); + + /** + * Deletes the local user associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, String username, Context context); + + /** + * Deletes the local user associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String username); + + /** + * List SSH authorized keys and shared key of the local user. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Storage Account Local User keys along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listKeysWithResponse(String resourceGroupName, String accountName, String username, + Context context); + + /** + * List SSH authorized keys and shared key of the local user. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Storage Account Local User keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LocalUserKeysInner listKeys(String resourceGroupName, String accountName, String username); + + /** + * Regenerate the local user SSH password. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secrets of Storage Account Local User along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regeneratePasswordWithResponse(String resourceGroupName, + String accountName, String username, Context context); + + /** + * Regenerate the local user SSH password. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secrets of Storage Account Local User. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LocalUserRegeneratePasswordResultInner regeneratePassword(String resourceGroupName, String accountName, + String username); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/ManagementPoliciesClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/ManagementPoliciesClient.java new file mode 100644 index 0000000000000..58bc220fb3312 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/ManagementPoliciesClient.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.ManagementPolicyInner; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyName; + +/** + * An instance of this class provides access to all the operations defined in ManagementPoliciesClient. + */ +public interface ManagementPoliciesClient { + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @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 managementpolicy associated with the specified storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, + ManagementPolicyName managementPolicyName, Context context); + + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 managementpolicy associated with the specified storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagementPolicyInner get(String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName); + + /** + * Sets the managementpolicy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @param properties The ManagementPolicy set to a storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Get Storage Account ManagementPolicies operation response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String accountName, + ManagementPolicyName managementPolicyName, ManagementPolicyInner properties, Context context); + + /** + * Sets the managementpolicy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @param properties The ManagementPolicy set to a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Get Storage Account ManagementPolicies operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagementPolicyInner createOrUpdate(String resourceGroupName, String accountName, + ManagementPolicyName managementPolicyName, ManagementPolicyInner properties); + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, + ManagementPolicyName managementPolicyName, Context context); + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/NetworkSecurityPerimeterConfigurationsClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/NetworkSecurityPerimeterConfigurationsClient.java new file mode 100644 index 0000000000000..4c70555510044 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/NetworkSecurityPerimeterConfigurationsClient.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.models.NetworkSecurityPerimeterConfigurationInner; + +/** + * An instance of this class provides access to all the operations defined in + * NetworkSecurityPerimeterConfigurationsClient. + */ +public interface NetworkSecurityPerimeterConfigurationsClient { + /** + * Gets list of effective NetworkSecurityPerimeterConfiguration for storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of effective NetworkSecurityPerimeterConfiguration for storage account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Gets list of effective NetworkSecurityPerimeterConfiguration for storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of effective NetworkSecurityPerimeterConfiguration for storage account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, + Context context); + + /** + * Gets effective NetworkSecurityPerimeterConfiguration for association. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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 effective NetworkSecurityPerimeterConfiguration for association along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName, Context context); + + /** + * Gets effective NetworkSecurityPerimeterConfiguration for association. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 effective NetworkSecurityPerimeterConfiguration for association. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkSecurityPerimeterConfigurationInner get(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName); + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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> beginReconcile(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName); + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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> beginReconcile(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName, Context context); + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reconcile(String resourceGroupName, String accountName, String networkSecurityPerimeterConfigurationName); + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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 reconcile(String resourceGroupName, String accountName, String networkSecurityPerimeterConfigurationName, + Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/ObjectReplicationPoliciesOperationsClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/ObjectReplicationPoliciesOperationsClient.java new file mode 100644 index 0000000000000..8196e6228718a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/ObjectReplicationPoliciesOperationsClient.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.ObjectReplicationPolicyInner; + +/** + * An instance of this class provides access to all the operations defined in ObjectReplicationPoliciesOperationsClient. + */ +public interface ObjectReplicationPoliciesOperationsClient { + /** + * List the object replication policies associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account object replication policies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List the object replication policies associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account object replication policies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure the policy + * on the destination account first. For the source account, provide the value of the policy ID that is returned + * when you download the policy that was defined on the destination account. The policy is downloaded as a JSON + * file. + * @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 object replication policy of the storage account by policy ID along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, + String objectReplicationPolicyId, Context context); + + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure the policy + * on the destination account first. For the source account, provide the value of the policy ID that is returned + * when you download the policy that was defined on the destination account. The policy is downloaded as a JSON + * file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 object replication policy of the storage account by policy ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ObjectReplicationPolicyInner get(String resourceGroupName, String accountName, String objectReplicationPolicyId); + + /** + * Create or update the object replication policy of the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure the policy + * on the destination account first. For the source account, provide the value of the policy ID that is returned + * when you download the policy that was defined on the destination account. The policy is downloaded as a JSON + * file. + * @param properties The object replication policy set to a storage account. A unique policy ID will be created if + * absent. + * @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 replication policy between two storage accounts along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String accountName, + String objectReplicationPolicyId, ObjectReplicationPolicyInner properties, Context context); + + /** + * Create or update the object replication policy of the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure the policy + * on the destination account first. For the source account, provide the value of the policy ID that is returned + * when you download the policy that was defined on the destination account. The policy is downloaded as a JSON + * file. + * @param properties The object replication policy set to a storage account. A unique policy ID will be created if + * absent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 replication policy between two storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ObjectReplicationPolicyInner createOrUpdate(String resourceGroupName, String accountName, + String objectReplicationPolicyId, ObjectReplicationPolicyInner properties); + + /** + * Deletes the object replication policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure the policy + * on the destination account first. For the source account, provide the value of the policy ID that is returned + * when you download the policy that was defined on the destination account. The policy is downloaded as a JSON + * file. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, String objectReplicationPolicyId, + Context context); + + /** + * Deletes the object replication policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure the policy + * on the destination account first. For the source account, provide the value of the policy ID that is returned + * when you download the policy that was defined on the destination account. The policy is downloaded as a JSON + * file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String objectReplicationPolicyId); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/OperationsClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/OperationsClient.java new file mode 100644 index 0000000000000..f68d33a037e78 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/OperationsClient.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.models.OperationInner; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public interface OperationsClient { + /** + * Lists all of the available Storage Rest API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available Storage Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/PrivateEndpointConnectionsClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 0000000000000..a89f35ce6beec --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateEndpointConnectionInner; + +/** + * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. + */ +public interface PrivateEndpointConnectionsClient { + /** + * List all the private endpoint connections associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List all the private endpoint connections associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * Gets the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 specified private endpoint connection associated with the storage account along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, + String privateEndpointConnectionName, Context context); + + /** + * Gets the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 specified private endpoint connection associated with the storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get(String resourceGroupName, String accountName, + String privateEndpointConnectionName); + + /** + * Update the state of specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @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 Private Endpoint Connection resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response putWithResponse(String resourceGroupName, String accountName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner properties, Context context); + + /** + * Update the state of specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner put(String resourceGroupName, String accountName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner properties); + + /** + * Deletes the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, + String privateEndpointConnectionName, Context context); + + /** + * Deletes the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 accountName, String privateEndpointConnectionName); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/PrivateLinkResourcesClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/PrivateLinkResourcesClient.java new file mode 100644 index 0000000000000..cee06a618599a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/PrivateLinkResourcesClient.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateLinkResourceListResultInner; + +/** + * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. + */ +public interface PrivateLinkResourcesClient { + /** + * Gets the private link resources that need to be created for a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 private link resources that need to be created for a storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByStorageAccountWithResponse(String resourceGroupName, + String accountName, Context context); + + /** + * Gets the private link resources that need to be created for a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 private link resources that need to be created for a storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceListResultInner listByStorageAccount(String resourceGroupName, String accountName); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/QueueServicesClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/QueueServicesClient.java new file mode 100644 index 0000000000000..c5580b1f8ae7a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/QueueServicesClient.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.ListQueueServicesInner; +import com.azure.resourcemanager.storage.generated.fluent.models.QueueServicePropertiesInner; + +/** + * An instance of this class provides access to all the operations defined in QueueServicesClient. + */ +public interface QueueServicesClient { + /** + * List all queue services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * List all queue services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ListQueueServicesInner list(String resourceGroupName, String accountName); + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Queue service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @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 properties of a storage account’s Queue service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response setServicePropertiesWithResponse(String resourceGroupName, String accountName, + QueueServicePropertiesInner parameters, Context context); + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Queue service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 properties of a storage account’s Queue service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + QueueServicePropertiesInner setServiceProperties(String resourceGroupName, String accountName, + QueueServicePropertiesInner parameters); + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getServicePropertiesWithResponse(String resourceGroupName, String accountName, + Context context); + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + QueueServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/QueuesClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/QueuesClient.java new file mode 100644 index 0000000000000..874a22d0201c9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/QueuesClient.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.ListQueueInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageQueueInner; + +/** + * An instance of this class provides access to all the operations defined in QueuesClient. + */ +public interface QueuesClient { + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param queue Queue properties and metadata to be created with. + * @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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse(String resourceGroupName, String accountName, String queueName, + StorageQueueInner queue, Context context); + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param queue Queue properties and metadata to be created with. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageQueueInner create(String resourceGroupName, String accountName, String queueName, StorageQueueInner queue); + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param queue Queue properties and metadata to be created with. + * @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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String accountName, String queueName, + StorageQueueInner queue, Context context); + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param queue Queue properties and metadata to be created with. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageQueueInner update(String resourceGroupName, String accountName, String queueName, StorageQueueInner queue); + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @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 queue with the specified queue name, under the specified account if it exists along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, String queueName, + Context context); + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 queue with the specified queue name, under the specified account if it exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageQueueInner get(String resourceGroupName, String accountName, String queueName); + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, String queueName, Context context); + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String queueName); + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 all the queues under the specified storage account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response. + * @param filter Optional, When specified, only the queues with a name starting with the given filter will be + * listed. + * @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 all the queues under the specified storage account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, String maxpagesize, String filter, + Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/SkusClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/SkusClient.java new file mode 100644 index 0000000000000..5e42c16f999a7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/SkusClient.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.models.SkuInformationInner; + +/** + * An instance of this class provides access to all the operations defined in SkusClient. + */ +public interface SkusClient { + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @throws com.azure.core.management.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 from the List Storage SKUs operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @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 from the List Storage SKUs operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/StorageAccountsClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/StorageAccountsClient.java new file mode 100644 index 0000000000000..6688eb74324fb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/StorageAccountsClient.java @@ -0,0 +1,893 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.models.BlobRestoreStatusInner; +import com.azure.resourcemanager.storage.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.storage.generated.fluent.models.ListAccountSasResponseInner; +import com.azure.resourcemanager.storage.generated.fluent.models.ListServiceSasResponseInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountListKeysResultInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountMigrationInner; +import com.azure.resourcemanager.storage.generated.models.AccountSasParameters; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreParameters; +import com.azure.resourcemanager.storage.generated.models.FailoverType; +import com.azure.resourcemanager.storage.generated.models.ListKeyExpand; +import com.azure.resourcemanager.storage.generated.models.MigrationName; +import com.azure.resourcemanager.storage.generated.models.ServiceSasParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccountCheckNameAvailabilityParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccountCreateParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccountExpand; +import com.azure.resourcemanager.storage.generated.models.StorageAccountRegenerateKeyParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccountUpdateParameters; + +/** + * An instance of this class provides access to all the operations defined in StorageAccountsClient. + */ +public interface StorageAccountsClient { + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 CheckNameAvailability operation response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response + checkNameAvailabilityWithResponse(StorageAccountCheckNameAvailabilityParameters accountName, Context context); + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 CheckNameAvailability operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityResultInner checkNameAvailability(StorageAccountCheckNameAvailabilityParameters accountName); + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and + * a subsequent create request is issued with different properties, the account properties will be updated. If an + * account is already created and a subsequent create or update request is issued with the exact same set of + * properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the storage account. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, StorageAccountInner> beginCreate(String resourceGroupName, + String accountName, StorageAccountCreateParameters parameters); + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and + * a subsequent create request is issued with different properties, the account properties will be updated. If an + * account is already created and a subsequent create or update request is issued with the exact same set of + * properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the storage account. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, StorageAccountInner> beginCreate(String resourceGroupName, + String accountName, StorageAccountCreateParameters parameters, Context context); + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and + * a subsequent create request is issued with different properties, the account properties will be updated. If an + * account is already created and a subsequent create or update request is issued with the exact same set of + * properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageAccountInner create(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters); + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and + * a subsequent create request is issued with different properties, the account properties will be updated. If an + * account is already created and a subsequent create or update request is issued with the exact same set of + * properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageAccountInner create(String resourceGroupName, String accountName, StorageAccountCreateParameters parameters, + Context context); + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName); + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, + * and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand May be used to expand the properties within account's properties. By default, data is not included + * when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. + * @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 storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, + StorageAccountExpand expand, Context context); + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, + * and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageAccountInner getByResourceGroup(String resourceGroupName, String accountName); + + /** + * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It + * can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; + * the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value + * must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This + * call does not change the storage keys for the account. If you want to change the storage account keys, use the + * regenerate keys operation. The location and name of the storage account cannot be changed after creation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the updated account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String accountName, + StorageAccountUpdateParameters parameters, Context context); + + /** + * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It + * can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; + * the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value + * must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This + * call does not change the storage keys for the account. If you want to change the storage account keys, use the + * regenerate keys operation. The location and name of the storage account cannot be changed after creation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the updated account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageAccountInner update(String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters); + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the + * ListKeys operation for this. + * + * @throws com.azure.core.management.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 from the List Storage Accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the + * ListKeys operation for this. + * + * @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 from the List Storage Accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; + * use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 from the List Storage Accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; + * use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 from the List Storage Accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand Specifies type of the key to be listed. Possible value is kerb. + * @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 from the ListKeys operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listKeysWithResponse(String resourceGroupName, String accountName, + ListKeyExpand expand, Context context); + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 from the ListKeys operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageAccountListKeysResultInner listKeys(String resourceGroupName, String accountName); + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. + * @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 from the ListKeys operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateKeyWithResponse(String resourceGroupName, String accountName, + StorageAccountRegenerateKeyParameters regenerateKey, Context context); + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 from the ListKeys operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageAccountListKeysResultInner regenerateKey(String resourceGroupName, String accountName, + StorageAccountRegenerateKeyParameters regenerateKey); + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List SAS credentials operation response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAccountSasWithResponse(String resourceGroupName, String accountName, + AccountSasParameters parameters, Context context); + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List SAS credentials operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ListAccountSasResponseInner listAccountSas(String resourceGroupName, String accountName, + AccountSasParameters parameters); + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @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 List service SAS credentials operation response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listServiceSasWithResponse(String resourceGroupName, String accountName, + ServiceSasParameters parameters, Context context); + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List service SAS credentials operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ListServiceSasResponseInner listServiceSas(String resourceGroupName, String accountName, + ServiceSasParameters parameters); + + /** + * A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable for + * any reason. The failover occurs from the storage account's primary cluster to the secondary cluster for RA-GRS + * accounts. The secondary cluster will become primary after failover and the account is converted to LRS. In the + * case of a Planned Failover, the primary and secondary clusters are swapped after failover and the account remains + * geo-replicated. Failover should continue to be used in the event of availability issues as Planned failover is + * only available while the primary and secondary endpoints are available. The primary use case of a Planned + * Failover is disaster recovery testing drills. This type of failover is invoked by setting FailoverType parameter + * to 'Planned'. Learn more about the failover options here- + * https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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> beginFailover(String resourceGroupName, String accountName); + + /** + * A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable for + * any reason. The failover occurs from the storage account's primary cluster to the secondary cluster for RA-GRS + * accounts. The secondary cluster will become primary after failover and the account is converted to LRS. In the + * case of a Planned Failover, the primary and secondary clusters are swapped after failover and the account remains + * geo-replicated. Failover should continue to be used in the event of availability issues as Planned failover is + * only available while the primary and secondary endpoints are available. The primary use case of a Planned + * Failover is disaster recovery testing drills. This type of failover is invoked by setting FailoverType parameter + * to 'Planned'. Learn more about the failover options here- + * https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param failoverType The parameter is set to 'Planned' to indicate whether a Planned failover is requested. + * @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> beginFailover(String resourceGroupName, String accountName, + FailoverType failoverType, Context context); + + /** + * A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable for + * any reason. The failover occurs from the storage account's primary cluster to the secondary cluster for RA-GRS + * accounts. The secondary cluster will become primary after failover and the account is converted to LRS. In the + * case of a Planned Failover, the primary and secondary clusters are swapped after failover and the account remains + * geo-replicated. Failover should continue to be used in the event of availability issues as Planned failover is + * only available while the primary and secondary endpoints are available. The primary use case of a Planned + * Failover is disaster recovery testing drills. This type of failover is invoked by setting FailoverType parameter + * to 'Planned'. Learn more about the failover options here- + * https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 failover(String resourceGroupName, String accountName); + + /** + * A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable for + * any reason. The failover occurs from the storage account's primary cluster to the secondary cluster for RA-GRS + * accounts. The secondary cluster will become primary after failover and the account is converted to LRS. In the + * case of a Planned Failover, the primary and secondary clusters are swapped after failover and the account remains + * geo-replicated. Failover should continue to be used in the event of availability issues as Planned failover is + * only available while the primary and secondary endpoints are available. The primary use case of a Planned + * Failover is disaster recovery testing drills. This type of failover is invoked by setting FailoverType parameter + * to 'Planned'. Learn more about the failover options here- + * https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param failoverType The parameter is set to 'Planned' to indicate whether a Planned failover is requested. + * @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 failover(String resourceGroupName, String accountName, FailoverType failoverType, Context context); + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param requestType Required. Hierarchical namespace migration type can either be a hierarchical namespace + * validation request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation + * request will validate the migration whereas the hydration request will migrate the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginHierarchicalNamespaceMigration(String resourceGroupName, String accountName, + String requestType); + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param requestType Required. Hierarchical namespace migration type can either be a hierarchical namespace + * validation request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation + * request will validate the migration whereas the hydration request will migrate the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginHierarchicalNamespaceMigration(String resourceGroupName, String accountName, + String requestType, Context context); + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param requestType Required. Hierarchical namespace migration type can either be a hierarchical namespace + * validation request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation + * request will validate the migration whereas the hydration request will migrate the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void hierarchicalNamespaceMigration(String resourceGroupName, String accountName, String requestType); + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param requestType Required. Hierarchical namespace migration type can either be a hierarchical namespace + * validation request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation + * request will validate the migration whereas the hydration request will migrate the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void hierarchicalNamespaceMigration(String resourceGroupName, String accountName, String requestType, + Context context); + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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> beginAbortHierarchicalNamespaceMigration(String resourceGroupName, + String accountName); + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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> beginAbortHierarchicalNamespaceMigration(String resourceGroupName, + String accountName, Context context); + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 abortHierarchicalNamespaceMigration(String resourceGroupName, String accountName); + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 abortHierarchicalNamespaceMigration(String resourceGroupName, String accountName, Context context); + + /** + * Account Migration request can be triggered for a storage account to change its redundancy level. The migration + * updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have + * better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously + * across three Azure availability zones in the primary region. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The request parameters required to perform storage account migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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> beginCustomerInitiatedMigration(String resourceGroupName, String accountName, + StorageAccountMigrationInner parameters); + + /** + * Account Migration request can be triggered for a storage account to change its redundancy level. The migration + * updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have + * better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously + * across three Azure availability zones in the primary region. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The request parameters required to perform storage account migration. + * @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> beginCustomerInitiatedMigration(String resourceGroupName, String accountName, + StorageAccountMigrationInner parameters, Context context); + + /** + * Account Migration request can be triggered for a storage account to change its redundancy level. The migration + * updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have + * better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously + * across three Azure availability zones in the primary region. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The request parameters required to perform storage account migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 customerInitiatedMigration(String resourceGroupName, String accountName, + StorageAccountMigrationInner parameters); + + /** + * Account Migration request can be triggered for a storage account to change its redundancy level. The migration + * updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have + * better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously + * across three Azure availability zones in the primary region. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The request parameters required to perform storage account migration. + * @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 customerInitiatedMigration(String resourceGroupName, String accountName, + StorageAccountMigrationInner parameters, Context context); + + /** + * Gets the status of the ongoing migration for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param migrationName The name of the Storage Account Migration. It should always be 'default'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the ongoing migration for the specified storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getCustomerInitiatedMigrationWithResponse(String resourceGroupName, + String accountName, MigrationName migrationName, Context context); + + /** + * Gets the status of the ongoing migration for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param migrationName The name of the Storage Account Migration. It should always be 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the ongoing migration for the specified storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageAccountMigrationInner getCustomerInitiatedMigration(String resourceGroupName, String accountName, + MigrationName migrationName); + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 blob restore status. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BlobRestoreStatusInner> + beginRestoreBlobRanges(String resourceGroupName, String accountName, BlobRestoreParameters parameters); + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @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 blob restore status. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BlobRestoreStatusInner> beginRestoreBlobRanges( + String resourceGroupName, String accountName, BlobRestoreParameters parameters, Context context); + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 blob restore status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobRestoreStatusInner restoreBlobRanges(String resourceGroupName, String accountName, + BlobRestoreParameters parameters); + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @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 blob restore status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BlobRestoreStatusInner restoreBlobRanges(String resourceGroupName, String accountName, + BlobRestoreParameters parameters, Context context); + + /** + * Revoke user delegation keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response revokeUserDelegationKeysWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * Revoke user delegation keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 revokeUserDelegationKeys(String resourceGroupName, String accountName); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/StorageManagementClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/StorageManagementClient.java new file mode 100644 index 0000000000000..0760331c5a14f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/StorageManagementClient.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for StorageManagementClient class. + */ +public interface StorageManagementClient { + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the BlobServicesClient object to access its operations. + * + * @return the BlobServicesClient object. + */ + BlobServicesClient getBlobServices(); + + /** + * Gets the BlobContainersClient object to access its operations. + * + * @return the BlobContainersClient object. + */ + BlobContainersClient getBlobContainers(); + + /** + * Gets the FileServicesClient object to access its operations. + * + * @return the FileServicesClient object. + */ + FileServicesClient getFileServices(); + + /** + * Gets the FileSharesClient object to access its operations. + * + * @return the FileSharesClient object. + */ + FileSharesClient getFileShares(); + + /** + * Gets the QueueServicesClient object to access its operations. + * + * @return the QueueServicesClient object. + */ + QueueServicesClient getQueueServices(); + + /** + * Gets the QueuesClient object to access its operations. + * + * @return the QueuesClient object. + */ + QueuesClient getQueues(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + SkusClient getSkus(); + + /** + * Gets the StorageAccountsClient object to access its operations. + * + * @return the StorageAccountsClient object. + */ + StorageAccountsClient getStorageAccounts(); + + /** + * Gets the DeletedAccountsClient object to access its operations. + * + * @return the DeletedAccountsClient object. + */ + DeletedAccountsClient getDeletedAccounts(); + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + UsagesClient getUsages(); + + /** + * Gets the ManagementPoliciesClient object to access its operations. + * + * @return the ManagementPoliciesClient object. + */ + ManagementPoliciesClient getManagementPolicies(); + + /** + * Gets the BlobInventoryPoliciesClient object to access its operations. + * + * @return the BlobInventoryPoliciesClient object. + */ + BlobInventoryPoliciesClient getBlobInventoryPolicies(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the ObjectReplicationPoliciesOperationsClient object to access its operations. + * + * @return the ObjectReplicationPoliciesOperationsClient object. + */ + ObjectReplicationPoliciesOperationsClient getObjectReplicationPoliciesOperations(); + + /** + * Gets the LocalUsersOperationsClient object to access its operations. + * + * @return the LocalUsersOperationsClient object. + */ + LocalUsersOperationsClient getLocalUsersOperations(); + + /** + * Gets the EncryptionScopesClient object to access its operations. + * + * @return the EncryptionScopesClient object. + */ + EncryptionScopesClient getEncryptionScopes(); + + /** + * Gets the TableServicesClient object to access its operations. + * + * @return the TableServicesClient object. + */ + TableServicesClient getTableServices(); + + /** + * Gets the TablesClient object to access its operations. + * + * @return the TablesClient object. + */ + TablesClient getTables(); + + /** + * Gets the NetworkSecurityPerimeterConfigurationsClient object to access its operations. + * + * @return the NetworkSecurityPerimeterConfigurationsClient object. + */ + NetworkSecurityPerimeterConfigurationsClient getNetworkSecurityPerimeterConfigurations(); + + /** + * Gets the StorageTaskAssignmentsClient object to access its operations. + * + * @return the StorageTaskAssignmentsClient object. + */ + StorageTaskAssignmentsClient getStorageTaskAssignments(); + + /** + * Gets the StorageTaskAssignmentsInstancesReportsClient object to access its operations. + * + * @return the StorageTaskAssignmentsInstancesReportsClient object. + */ + StorageTaskAssignmentsInstancesReportsClient getStorageTaskAssignmentsInstancesReports(); + + /** + * Gets the StorageTaskAssignmentInstancesReportsClient object to access its operations. + * + * @return the StorageTaskAssignmentInstancesReportsClient object. + */ + StorageTaskAssignmentInstancesReportsClient getStorageTaskAssignmentInstancesReports(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/StorageTaskAssignmentInstancesReportsClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/StorageTaskAssignmentInstancesReportsClient.java new file mode 100644 index 0000000000000..b4d69524c5117 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/StorageTaskAssignmentInstancesReportsClient.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.models.StorageTaskReportInstanceInner; + +/** + * An instance of this class provides access to all the operations defined in + * StorageTaskAssignmentInstancesReportsClient. + */ +public interface StorageTaskAssignmentInstancesReportsClient { + /** + * Fetch the report summary of a single storage task assignment's instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, + String storageTaskAssignmentName); + + /** + * Fetch the report summary of a single storage task assignment's instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment instances to be included in + * the list response. + * @param filter Optional. When specified, it can be used to query using reporting properties. See [Constructing + * Filter + * Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) + * for details. + * @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 fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, + String storageTaskAssignmentName, Integer maxpagesize, String filter, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/StorageTaskAssignmentsClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/StorageTaskAssignmentsClient.java new file mode 100644 index 0000000000000..09193372e4283 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/StorageTaskAssignmentsClient.java @@ -0,0 +1,329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.models.StorageTaskAssignmentInner; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignmentUpdateParameters; + +/** + * An instance of this class provides access to all the operations defined in StorageTaskAssignmentsClient. + */ +public interface StorageTaskAssignmentsClient { + /** + * Asynchronously creates a new storage task assignment sub-resource with the specified parameters. If a storage + * task assignment is already created and a subsequent create request is issued with different properties, the + * storage task assignment properties will be updated. If a storage task assignment is already created and a + * subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to create a Storage Task Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 the storage task assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, StorageTaskAssignmentInner> beginCreate(String resourceGroupName, + String accountName, String storageTaskAssignmentName, StorageTaskAssignmentInner parameters); + + /** + * Asynchronously creates a new storage task assignment sub-resource with the specified parameters. If a storage + * task assignment is already created and a subsequent create request is issued with different properties, the + * storage task assignment properties will be updated. If a storage task assignment is already created and a + * subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to create a Storage Task Assignment. + * @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 the storage task assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, StorageTaskAssignmentInner> beginCreate(String resourceGroupName, + String accountName, String storageTaskAssignmentName, StorageTaskAssignmentInner parameters, Context context); + + /** + * Asynchronously creates a new storage task assignment sub-resource with the specified parameters. If a storage + * task assignment is already created and a subsequent create request is issued with different properties, the + * storage task assignment properties will be updated. If a storage task assignment is already created and a + * subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to create a Storage Task Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 storage task assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageTaskAssignmentInner create(String resourceGroupName, String accountName, String storageTaskAssignmentName, + StorageTaskAssignmentInner parameters); + + /** + * Asynchronously creates a new storage task assignment sub-resource with the specified parameters. If a storage + * task assignment is already created and a subsequent create request is issued with different properties, the + * storage task assignment properties will be updated. If a storage task assignment is already created and a + * subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to create a Storage Task Assignment. + * @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 storage task assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageTaskAssignmentInner create(String resourceGroupName, String accountName, String storageTaskAssignmentName, + StorageTaskAssignmentInner parameters, Context context); + + /** + * Update storage task assignment properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to update a Storage Task Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 the storage task assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, StorageTaskAssignmentInner> beginUpdate(String resourceGroupName, + String accountName, String storageTaskAssignmentName, StorageTaskAssignmentUpdateParameters parameters); + + /** + * Update storage task assignment properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to update a Storage Task Assignment. + * @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 the storage task assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, StorageTaskAssignmentInner> beginUpdate(String resourceGroupName, + String accountName, String storageTaskAssignmentName, StorageTaskAssignmentUpdateParameters parameters, + Context context); + + /** + * Update storage task assignment properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to update a Storage Task Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 storage task assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageTaskAssignmentInner update(String resourceGroupName, String accountName, String storageTaskAssignmentName, + StorageTaskAssignmentUpdateParameters parameters); + + /** + * Update storage task assignment properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to update a Storage Task Assignment. + * @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 storage task assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageTaskAssignmentInner update(String resourceGroupName, String accountName, String storageTaskAssignmentName, + StorageTaskAssignmentUpdateParameters parameters, Context context); + + /** + * Get the storage task assignment properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @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 storage task assignment properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, + String storageTaskAssignmentName, Context context); + + /** + * Get the storage task assignment properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 storage task assignment properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageTaskAssignmentInner get(String resourceGroupName, String accountName, String storageTaskAssignmentName); + + /** + * Delete the storage task assignment sub-resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 accountName, + String storageTaskAssignmentName); + + /** + * Delete the storage task assignment sub-resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @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 accountName, + String storageTaskAssignmentName, Context context); + + /** + * Delete the storage task assignment sub-resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String storageTaskAssignmentName); + + /** + * Delete the storage task assignment sub-resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String storageTaskAssignmentName, Context context); + + /** + * List all the storage task assignments in an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of storage task assignments for the storage account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List all the storage task assignments in an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the + * list response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of storage task assignments for the storage account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Integer maxpagesize, + Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/StorageTaskAssignmentsInstancesReportsClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/StorageTaskAssignmentsInstancesReportsClient.java new file mode 100644 index 0000000000000..be7aa81510712 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/StorageTaskAssignmentsInstancesReportsClient.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.models.StorageTaskReportInstanceInner; + +/** + * An instance of this class provides access to all the operations defined in + * StorageTaskAssignmentsInstancesReportsClient. + */ +public interface StorageTaskAssignmentsInstancesReportsClient { + /** + * Fetch the report summary of all the storage task assignments and instances in an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Fetch the report summary of all the storage task assignments and instances in an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment instances to be included in + * the list response. + * @param filter Optional. When specified, it can be used to query using reporting properties. See [Constructing + * Filter + * Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) + * for details. + * @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 fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, + Integer maxpagesize, String filter, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/TableServicesClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/TableServicesClient.java new file mode 100644 index 0000000000000..eea1a34ca926c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/TableServicesClient.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.ListTableServicesInner; +import com.azure.resourcemanager.storage.generated.fluent.models.TableServicePropertiesInner; + +/** + * An instance of this class provides access to all the operations defined in TableServicesClient. + */ +public interface TableServicesClient { + /** + * List all table services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * List all table services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ListTableServicesInner list(String resourceGroupName, String accountName); + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Table service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @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 properties of a storage account’s Table service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response setServicePropertiesWithResponse(String resourceGroupName, String accountName, + TableServicePropertiesInner parameters, Context context); + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Table service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 properties of a storage account’s Table service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TableServicePropertiesInner setServiceProperties(String resourceGroupName, String accountName, + TableServicePropertiesInner parameters); + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getServicePropertiesWithResponse(String resourceGroupName, String accountName, + Context context); + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TableServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/TablesClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/TablesClient.java new file mode 100644 index 0000000000000..2bd378385e73e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/TablesClient.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.TableInner; + +/** + * An instance of this class provides access to all the operations defined in TablesClient. + */ +public interface TablesClient { + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @param parameters The parameters to provide to create a table. + * @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 properties of the table, including Id, resource name, resource type along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse(String resourceGroupName, String accountName, String tableName, + TableInner parameters, Context context); + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 properties of the table, including Id, resource name, resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TableInner create(String resourceGroupName, String accountName, String tableName); + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @param parameters The parameters to provide to create a table. + * @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 properties of the table, including Id, resource name, resource type along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String accountName, String tableName, + TableInner parameters, Context context); + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 properties of the table, including Id, resource name, resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TableInner update(String resourceGroupName, String accountName, String tableName); + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @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 table with the specified table name, under the specified account if it exists along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, String tableName, + Context context); + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 table with the specified table name, under the specified account if it exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TableInner get(String resourceGroupName, String accountName, String tableName); + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, String tableName, Context context); + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String tableName); + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 all the tables under the specified storage account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 all the tables under the specified storage account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/UsagesClient.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/UsagesClient.java new file mode 100644 index 0000000000000..c4d025bec5839 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/UsagesClient.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.models.UsageInner; + +/** + * An instance of this class provides access to all the operations defined in UsagesClient. + */ +public interface UsagesClient { + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage 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 current usage count and the limit for the resources of the location under the subscription as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByLocation(String location); + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage 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 current usage count and the limit for the resources of the location under the subscription as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByLocation(String location, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobContainerInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobContainerInner.java new file mode 100644 index 0000000000000..9d0b098a007c6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobContainerInner.java @@ -0,0 +1,453 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.storage.generated.models.AzureEntityResource; +import com.azure.resourcemanager.storage.generated.models.ImmutabilityPolicyProperties; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageWithVersioning; +import com.azure.resourcemanager.storage.generated.models.LeaseDuration; +import com.azure.resourcemanager.storage.generated.models.LeaseState; +import com.azure.resourcemanager.storage.generated.models.LeaseStatus; +import com.azure.resourcemanager.storage.generated.models.LegalHoldProperties; +import com.azure.resourcemanager.storage.generated.models.PublicAccess; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Map; + +/** + * Properties of the blob container, including Id, resource name, resource type, Etag. + */ +@Fluent +public final class BlobContainerInner extends AzureEntityResource { + /* + * Properties of the blob container. + */ + private ContainerProperties innerContainerProperties; + + /* + * Resource Etag. + */ + private String etag; + + /* + * 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 BlobContainerInner class. + */ + public BlobContainerInner() { + } + + /** + * Get the innerContainerProperties property: Properties of the blob container. + * + * @return the innerContainerProperties value. + */ + private ContainerProperties innerContainerProperties() { + return this.innerContainerProperties; + } + + /** + * Get the etag property: Resource Etag. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + + /** + * 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; + } + + /** + * Get the version property: The version of the deleted blob container. + * + * @return the version value. + */ + public String version() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().version(); + } + + /** + * Get the deleted property: Indicates whether the blob container was deleted. + * + * @return the deleted value. + */ + public Boolean deleted() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().deleted(); + } + + /** + * Get the deletedTime property: Blob container deletion time. + * + * @return the deletedTime value. + */ + public OffsetDateTime deletedTime() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().deletedTime(); + } + + /** + * Get the remainingRetentionDays property: Remaining retention days for soft deleted blob container. + * + * @return the remainingRetentionDays value. + */ + public Integer remainingRetentionDays() { + return this.innerContainerProperties() == null + ? null + : this.innerContainerProperties().remainingRetentionDays(); + } + + /** + * Get the defaultEncryptionScope property: Default the container to use specified encryption scope for all writes. + * + * @return the defaultEncryptionScope value. + */ + public String defaultEncryptionScope() { + return this.innerContainerProperties() == null + ? null + : this.innerContainerProperties().defaultEncryptionScope(); + } + + /** + * Set the defaultEncryptionScope property: Default the container to use specified encryption scope for all writes. + * + * @param defaultEncryptionScope the defaultEncryptionScope value to set. + * @return the BlobContainerInner object itself. + */ + public BlobContainerInner withDefaultEncryptionScope(String defaultEncryptionScope) { + if (this.innerContainerProperties() == null) { + this.innerContainerProperties = new ContainerProperties(); + } + this.innerContainerProperties().withDefaultEncryptionScope(defaultEncryptionScope); + return this; + } + + /** + * Get the denyEncryptionScopeOverride property: Block override of encryption scope from the container default. + * + * @return the denyEncryptionScopeOverride value. + */ + public Boolean denyEncryptionScopeOverride() { + return this.innerContainerProperties() == null + ? null + : this.innerContainerProperties().denyEncryptionScopeOverride(); + } + + /** + * Set the denyEncryptionScopeOverride property: Block override of encryption scope from the container default. + * + * @param denyEncryptionScopeOverride the denyEncryptionScopeOverride value to set. + * @return the BlobContainerInner object itself. + */ + public BlobContainerInner withDenyEncryptionScopeOverride(Boolean denyEncryptionScopeOverride) { + if (this.innerContainerProperties() == null) { + this.innerContainerProperties = new ContainerProperties(); + } + this.innerContainerProperties().withDenyEncryptionScopeOverride(denyEncryptionScopeOverride); + return this; + } + + /** + * Get the publicAccess property: Specifies whether data in the container may be accessed publicly and the level of + * access. + * + * @return the publicAccess value. + */ + public PublicAccess publicAccess() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().publicAccess(); + } + + /** + * Set the publicAccess property: Specifies whether data in the container may be accessed publicly and the level of + * access. + * + * @param publicAccess the publicAccess value to set. + * @return the BlobContainerInner object itself. + */ + public BlobContainerInner withPublicAccess(PublicAccess publicAccess) { + if (this.innerContainerProperties() == null) { + this.innerContainerProperties = new ContainerProperties(); + } + this.innerContainerProperties().withPublicAccess(publicAccess); + return this; + } + + /** + * Get the lastModifiedTime property: Returns the date and time the container was last modified. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().lastModifiedTime(); + } + + /** + * Get the leaseStatus property: The lease status of the container. + * + * @return the leaseStatus value. + */ + public LeaseStatus leaseStatus() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().leaseStatus(); + } + + /** + * Get the leaseState property: Lease state of the container. + * + * @return the leaseState value. + */ + public LeaseState leaseState() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().leaseState(); + } + + /** + * Get the leaseDuration property: Specifies whether the lease on a container is of infinite or fixed duration, only + * when the container is leased. + * + * @return the leaseDuration value. + */ + public LeaseDuration leaseDuration() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().leaseDuration(); + } + + /** + * Get the metadata property: A name-value pair to associate with the container as metadata. + * + * @return the metadata value. + */ + public Map metadata() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().metadata(); + } + + /** + * Set the metadata property: A name-value pair to associate with the container as metadata. + * + * @param metadata the metadata value to set. + * @return the BlobContainerInner object itself. + */ + public BlobContainerInner withMetadata(Map metadata) { + if (this.innerContainerProperties() == null) { + this.innerContainerProperties = new ContainerProperties(); + } + this.innerContainerProperties().withMetadata(metadata); + return this; + } + + /** + * Get the immutabilityPolicy property: The ImmutabilityPolicy property of the container. + * + * @return the immutabilityPolicy value. + */ + public ImmutabilityPolicyProperties immutabilityPolicy() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().immutabilityPolicy(); + } + + /** + * Get the legalHold property: The LegalHold property of the container. + * + * @return the legalHold value. + */ + public LegalHoldProperties legalHold() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().legalHold(); + } + + /** + * Get the hasLegalHold property: The hasLegalHold public property is set to true by SRP if there are at least one + * existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared + * out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. + * + * @return the hasLegalHold value. + */ + public Boolean hasLegalHold() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().hasLegalHold(); + } + + /** + * Get the hasImmutabilityPolicy property: The hasImmutabilityPolicy public property is set to true by SRP if + * ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false + * by SRP if ImmutabilityPolicy has not been created for this container. + * + * @return the hasImmutabilityPolicy value. + */ + public Boolean hasImmutabilityPolicy() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().hasImmutabilityPolicy(); + } + + /** + * Get the immutableStorageWithVersioning property: The object level immutability property of the container. The + * property is immutable and can only be set to true at the container creation time. Existing containers must + * undergo a migration process. + * + * @return the immutableStorageWithVersioning value. + */ + public ImmutableStorageWithVersioning immutableStorageWithVersioning() { + return this.innerContainerProperties() == null + ? null + : this.innerContainerProperties().immutableStorageWithVersioning(); + } + + /** + * Set the immutableStorageWithVersioning property: The object level immutability property of the container. The + * property is immutable and can only be set to true at the container creation time. Existing containers must + * undergo a migration process. + * + * @param immutableStorageWithVersioning the immutableStorageWithVersioning value to set. + * @return the BlobContainerInner object itself. + */ + public BlobContainerInner + withImmutableStorageWithVersioning(ImmutableStorageWithVersioning immutableStorageWithVersioning) { + if (this.innerContainerProperties() == null) { + this.innerContainerProperties = new ContainerProperties(); + } + this.innerContainerProperties().withImmutableStorageWithVersioning(immutableStorageWithVersioning); + return this; + } + + /** + * Get the enableNfsV3RootSquash property: Enable NFSv3 root squash on blob container. + * + * @return the enableNfsV3RootSquash value. + */ + public Boolean enableNfsV3RootSquash() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().enableNfsV3RootSquash(); + } + + /** + * Set the enableNfsV3RootSquash property: Enable NFSv3 root squash on blob container. + * + * @param enableNfsV3RootSquash the enableNfsV3RootSquash value to set. + * @return the BlobContainerInner object itself. + */ + public BlobContainerInner withEnableNfsV3RootSquash(Boolean enableNfsV3RootSquash) { + if (this.innerContainerProperties() == null) { + this.innerContainerProperties = new ContainerProperties(); + } + this.innerContainerProperties().withEnableNfsV3RootSquash(enableNfsV3RootSquash); + return this; + } + + /** + * Get the enableNfsV3AllSquash property: Enable NFSv3 all squash on blob container. + * + * @return the enableNfsV3AllSquash value. + */ + public Boolean enableNfsV3AllSquash() { + return this.innerContainerProperties() == null ? null : this.innerContainerProperties().enableNfsV3AllSquash(); + } + + /** + * Set the enableNfsV3AllSquash property: Enable NFSv3 all squash on blob container. + * + * @param enableNfsV3AllSquash the enableNfsV3AllSquash value to set. + * @return the BlobContainerInner object itself. + */ + public BlobContainerInner withEnableNfsV3AllSquash(Boolean enableNfsV3AllSquash) { + if (this.innerContainerProperties() == null) { + this.innerContainerProperties = new ContainerProperties(); + } + this.innerContainerProperties().withEnableNfsV3AllSquash(enableNfsV3AllSquash); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerContainerProperties() != null) { + innerContainerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerContainerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobContainerInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobContainerInner 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 BlobContainerInner. + */ + public static BlobContainerInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobContainerInner deserializedBlobContainerInner = new BlobContainerInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedBlobContainerInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedBlobContainerInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBlobContainerInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedBlobContainerInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedBlobContainerInner.innerContainerProperties = ContainerProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobContainerInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobInventoryPolicyInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobInventoryPolicyInner.java new file mode 100644 index 0000000000000..ebfc4b571b878 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobInventoryPolicyInner.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +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.storage.generated.models.BlobInventoryPolicySchema; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The storage account blob inventory policy. + */ +@Fluent +public final class BlobInventoryPolicyInner extends ProxyResource { + /* + * Returns the storage account blob inventory policy rules. + */ + private BlobInventoryPolicyProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + 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 BlobInventoryPolicyInner class. + */ + public BlobInventoryPolicyInner() { + } + + /** + * Get the innerProperties property: Returns the storage account blob inventory policy rules. + * + * @return the innerProperties value. + */ + private BlobInventoryPolicyProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @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; + } + + /** + * Get the lastModifiedTime property: Returns the last modified date and time of the blob inventory policy. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTime(); + } + + /** + * Get the policy property: The storage account blob inventory policy object. It is composed of policy rules. + * + * @return the policy value. + */ + public BlobInventoryPolicySchema policy() { + return this.innerProperties() == null ? null : this.innerProperties().policy(); + } + + /** + * Set the policy property: The storage account blob inventory policy object. It is composed of policy rules. + * + * @param policy the policy value to set. + * @return the BlobInventoryPolicyInner object itself. + */ + public BlobInventoryPolicyInner withPolicy(BlobInventoryPolicySchema policy) { + if (this.innerProperties() == null) { + this.innerProperties = new BlobInventoryPolicyProperties(); + } + this.innerProperties().withPolicy(policy); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobInventoryPolicyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobInventoryPolicyInner 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 BlobInventoryPolicyInner. + */ + public static BlobInventoryPolicyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobInventoryPolicyInner deserializedBlobInventoryPolicyInner = new BlobInventoryPolicyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedBlobInventoryPolicyInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedBlobInventoryPolicyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBlobInventoryPolicyInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedBlobInventoryPolicyInner.innerProperties + = BlobInventoryPolicyProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedBlobInventoryPolicyInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobInventoryPolicyInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobInventoryPolicyProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobInventoryPolicyProperties.java new file mode 100644 index 0000000000000..cb0964e3e1bae --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobInventoryPolicyProperties.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +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.storage.generated.models.BlobInventoryPolicySchema; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The storage account blob inventory policy properties. + */ +@Fluent +public final class BlobInventoryPolicyProperties implements JsonSerializable { + /* + * Returns the last modified date and time of the blob inventory policy. + */ + private OffsetDateTime lastModifiedTime; + + /* + * The storage account blob inventory policy object. It is composed of policy rules. + */ + private BlobInventoryPolicySchema policy; + + /** + * Creates an instance of BlobInventoryPolicyProperties class. + */ + public BlobInventoryPolicyProperties() { + } + + /** + * Get the lastModifiedTime property: Returns the last modified date and time of the blob inventory policy. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the policy property: The storage account blob inventory policy object. It is composed of policy rules. + * + * @return the policy value. + */ + public BlobInventoryPolicySchema policy() { + return this.policy; + } + + /** + * Set the policy property: The storage account blob inventory policy object. It is composed of policy rules. + * + * @param policy the policy value to set. + * @return the BlobInventoryPolicyProperties object itself. + */ + public BlobInventoryPolicyProperties withPolicy(BlobInventoryPolicySchema policy) { + this.policy = policy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (policy() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property policy in model BlobInventoryPolicyProperties")); + } else { + policy().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BlobInventoryPolicyProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("policy", this.policy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobInventoryPolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobInventoryPolicyProperties 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 BlobInventoryPolicyProperties. + */ + public static BlobInventoryPolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobInventoryPolicyProperties deserializedBlobInventoryPolicyProperties + = new BlobInventoryPolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("policy".equals(fieldName)) { + deserializedBlobInventoryPolicyProperties.policy = BlobInventoryPolicySchema.fromJson(reader); + } else if ("lastModifiedTime".equals(fieldName)) { + deserializedBlobInventoryPolicyProperties.lastModifiedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobInventoryPolicyProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobRestoreStatusInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobRestoreStatusInner.java new file mode 100644 index 0000000000000..4c38d17e85ab4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobRestoreStatusInner.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.models.BlobRestoreParameters; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreProgressStatus; +import java.io.IOException; + +/** + * Blob restore status. + */ +@Immutable +public final class BlobRestoreStatusInner implements JsonSerializable { + /* + * The status of blob restore progress. Possible values are: - InProgress: Indicates that blob restore is ongoing. - + * Complete: Indicates that blob restore has been completed successfully. - Failed: Indicates that blob restore is + * failed. + */ + private BlobRestoreProgressStatus status; + + /* + * Failure reason when blob restore is failed. + */ + private String failureReason; + + /* + * Id for tracking blob restore request. + */ + private String restoreId; + + /* + * Blob restore request parameters. + */ + private BlobRestoreParameters parameters; + + /** + * Creates an instance of BlobRestoreStatusInner class. + */ + public BlobRestoreStatusInner() { + } + + /** + * Get the status property: The status of blob restore progress. Possible values are: - InProgress: Indicates that + * blob restore is ongoing. - Complete: Indicates that blob restore has been completed successfully. - Failed: + * Indicates that blob restore is failed. + * + * @return the status value. + */ + public BlobRestoreProgressStatus status() { + return this.status; + } + + /** + * Get the failureReason property: Failure reason when blob restore is failed. + * + * @return the failureReason value. + */ + public String failureReason() { + return this.failureReason; + } + + /** + * Get the restoreId property: Id for tracking blob restore request. + * + * @return the restoreId value. + */ + public String restoreId() { + return this.restoreId; + } + + /** + * Get the parameters property: Blob restore request parameters. + * + * @return the parameters value. + */ + public BlobRestoreParameters parameters() { + return this.parameters; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (parameters() != null) { + parameters().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobRestoreStatusInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobRestoreStatusInner 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 BlobRestoreStatusInner. + */ + public static BlobRestoreStatusInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobRestoreStatusInner deserializedBlobRestoreStatusInner = new BlobRestoreStatusInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedBlobRestoreStatusInner.status + = BlobRestoreProgressStatus.fromString(reader.getString()); + } else if ("failureReason".equals(fieldName)) { + deserializedBlobRestoreStatusInner.failureReason = reader.getString(); + } else if ("restoreId".equals(fieldName)) { + deserializedBlobRestoreStatusInner.restoreId = reader.getString(); + } else if ("parameters".equals(fieldName)) { + deserializedBlobRestoreStatusInner.parameters = BlobRestoreParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobRestoreStatusInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobServicePropertiesInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobServicePropertiesInner.java new file mode 100644 index 0000000000000..0afd3bc4a23f5 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobServicePropertiesInner.java @@ -0,0 +1,394 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.storage.generated.models.ChangeFeed; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.azure.resourcemanager.storage.generated.models.DeleteRetentionPolicy; +import com.azure.resourcemanager.storage.generated.models.LastAccessTimeTrackingPolicy; +import com.azure.resourcemanager.storage.generated.models.RestorePolicyProperties; +import com.azure.resourcemanager.storage.generated.models.Sku; +import java.io.IOException; + +/** + * The properties of a storage account’s Blob service. + */ +@Fluent +public final class BlobServicePropertiesInner extends ProxyResource { + /* + * The properties of a storage account’s Blob service. + */ + private BlobServicePropertiesProperties innerBlobServiceProperties; + + /* + * Sku name and tier. + */ + private Sku sku; + + /* + * 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 BlobServicePropertiesInner class. + */ + public BlobServicePropertiesInner() { + } + + /** + * Get the innerBlobServiceProperties property: The properties of a storage account’s Blob service. + * + * @return the innerBlobServiceProperties value. + */ + private BlobServicePropertiesProperties innerBlobServiceProperties() { + return this.innerBlobServiceProperties; + } + + /** + * Get the sku property: Sku name and tier. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * 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; + } + + /** + * Get the cors property: Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in + * the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS + * will be disabled for the Blob service. + * + * @return the cors value. + */ + public CorsRules cors() { + return this.innerBlobServiceProperties() == null ? null : this.innerBlobServiceProperties().cors(); + } + + /** + * Set the cors property: Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in + * the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS + * will be disabled for the Blob service. + * + * @param cors the cors value to set. + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withCors(CorsRules cors) { + if (this.innerBlobServiceProperties() == null) { + this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); + } + this.innerBlobServiceProperties().withCors(cors); + return this; + } + + /** + * Get the defaultServiceVersion property: DefaultServiceVersion indicates the default version to use for requests + * to the Blob service if an incoming request’s version is not specified. Possible values include version 2008-10-27 + * and all more recent versions. + * + * @return the defaultServiceVersion value. + */ + public String defaultServiceVersion() { + return this.innerBlobServiceProperties() == null + ? null + : this.innerBlobServiceProperties().defaultServiceVersion(); + } + + /** + * Set the defaultServiceVersion property: DefaultServiceVersion indicates the default version to use for requests + * to the Blob service if an incoming request’s version is not specified. Possible values include version 2008-10-27 + * and all more recent versions. + * + * @param defaultServiceVersion the defaultServiceVersion value to set. + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withDefaultServiceVersion(String defaultServiceVersion) { + if (this.innerBlobServiceProperties() == null) { + this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); + } + this.innerBlobServiceProperties().withDefaultServiceVersion(defaultServiceVersion); + return this; + } + + /** + * Get the deleteRetentionPolicy property: The blob service properties for blob soft delete. + * + * @return the deleteRetentionPolicy value. + */ + public DeleteRetentionPolicy deleteRetentionPolicy() { + return this.innerBlobServiceProperties() == null + ? null + : this.innerBlobServiceProperties().deleteRetentionPolicy(); + } + + /** + * Set the deleteRetentionPolicy property: The blob service properties for blob soft delete. + * + * @param deleteRetentionPolicy the deleteRetentionPolicy value to set. + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy) { + if (this.innerBlobServiceProperties() == null) { + this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); + } + this.innerBlobServiceProperties().withDeleteRetentionPolicy(deleteRetentionPolicy); + return this; + } + + /** + * Get the isVersioningEnabled property: Versioning is enabled if set to true. + * + * @return the isVersioningEnabled value. + */ + public Boolean isVersioningEnabled() { + return this.innerBlobServiceProperties() == null + ? null + : this.innerBlobServiceProperties().isVersioningEnabled(); + } + + /** + * Set the isVersioningEnabled property: Versioning is enabled if set to true. + * + * @param isVersioningEnabled the isVersioningEnabled value to set. + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withIsVersioningEnabled(Boolean isVersioningEnabled) { + if (this.innerBlobServiceProperties() == null) { + this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); + } + this.innerBlobServiceProperties().withIsVersioningEnabled(isVersioningEnabled); + return this; + } + + /** + * Get the automaticSnapshotPolicyEnabled property: Deprecated in favor of isVersioningEnabled property. + * + * @return the automaticSnapshotPolicyEnabled value. + */ + public Boolean automaticSnapshotPolicyEnabled() { + return this.innerBlobServiceProperties() == null + ? null + : this.innerBlobServiceProperties().automaticSnapshotPolicyEnabled(); + } + + /** + * Set the automaticSnapshotPolicyEnabled property: Deprecated in favor of isVersioningEnabled property. + * + * @param automaticSnapshotPolicyEnabled the automaticSnapshotPolicyEnabled value to set. + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withAutomaticSnapshotPolicyEnabled(Boolean automaticSnapshotPolicyEnabled) { + if (this.innerBlobServiceProperties() == null) { + this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); + } + this.innerBlobServiceProperties().withAutomaticSnapshotPolicyEnabled(automaticSnapshotPolicyEnabled); + return this; + } + + /** + * Get the changeFeed property: The blob service properties for change feed events. + * + * @return the changeFeed value. + */ + public ChangeFeed changeFeed() { + return this.innerBlobServiceProperties() == null ? null : this.innerBlobServiceProperties().changeFeed(); + } + + /** + * Set the changeFeed property: The blob service properties for change feed events. + * + * @param changeFeed the changeFeed value to set. + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withChangeFeed(ChangeFeed changeFeed) { + if (this.innerBlobServiceProperties() == null) { + this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); + } + this.innerBlobServiceProperties().withChangeFeed(changeFeed); + return this; + } + + /** + * Get the restorePolicy property: The blob service properties for blob restore policy. + * + * @return the restorePolicy value. + */ + public RestorePolicyProperties restorePolicy() { + return this.innerBlobServiceProperties() == null ? null : this.innerBlobServiceProperties().restorePolicy(); + } + + /** + * Set the restorePolicy property: The blob service properties for blob restore policy. + * + * @param restorePolicy the restorePolicy value to set. + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withRestorePolicy(RestorePolicyProperties restorePolicy) { + if (this.innerBlobServiceProperties() == null) { + this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); + } + this.innerBlobServiceProperties().withRestorePolicy(restorePolicy); + return this; + } + + /** + * Get the containerDeleteRetentionPolicy property: The blob service properties for container soft delete. + * + * @return the containerDeleteRetentionPolicy value. + */ + public DeleteRetentionPolicy containerDeleteRetentionPolicy() { + return this.innerBlobServiceProperties() == null + ? null + : this.innerBlobServiceProperties().containerDeleteRetentionPolicy(); + } + + /** + * Set the containerDeleteRetentionPolicy property: The blob service properties for container soft delete. + * + * @param containerDeleteRetentionPolicy the containerDeleteRetentionPolicy value to set. + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner + withContainerDeleteRetentionPolicy(DeleteRetentionPolicy containerDeleteRetentionPolicy) { + if (this.innerBlobServiceProperties() == null) { + this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); + } + this.innerBlobServiceProperties().withContainerDeleteRetentionPolicy(containerDeleteRetentionPolicy); + return this; + } + + /** + * Get the lastAccessTimeTrackingPolicy property: The blob service property to configure last access time based + * tracking policy. + * + * @return the lastAccessTimeTrackingPolicy value. + */ + public LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy() { + return this.innerBlobServiceProperties() == null + ? null + : this.innerBlobServiceProperties().lastAccessTimeTrackingPolicy(); + } + + /** + * Set the lastAccessTimeTrackingPolicy property: The blob service property to configure last access time based + * tracking policy. + * + * @param lastAccessTimeTrackingPolicy the lastAccessTimeTrackingPolicy value to set. + * @return the BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner + withLastAccessTimeTrackingPolicy(LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy) { + if (this.innerBlobServiceProperties() == null) { + this.innerBlobServiceProperties = new BlobServicePropertiesProperties(); + } + this.innerBlobServiceProperties().withLastAccessTimeTrackingPolicy(lastAccessTimeTrackingPolicy); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerBlobServiceProperties() != null) { + innerBlobServiceProperties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerBlobServiceProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobServicePropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobServicePropertiesInner 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 BlobServicePropertiesInner. + */ + public static BlobServicePropertiesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobServicePropertiesInner deserializedBlobServicePropertiesInner = new BlobServicePropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedBlobServicePropertiesInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedBlobServicePropertiesInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBlobServicePropertiesInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedBlobServicePropertiesInner.innerBlobServiceProperties + = BlobServicePropertiesProperties.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedBlobServicePropertiesInner.sku = Sku.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobServicePropertiesInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobServicePropertiesProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobServicePropertiesProperties.java new file mode 100644 index 0000000000000..32a914eac7274 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobServicePropertiesProperties.java @@ -0,0 +1,362 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.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 com.azure.resourcemanager.storage.generated.models.ChangeFeed; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.azure.resourcemanager.storage.generated.models.DeleteRetentionPolicy; +import com.azure.resourcemanager.storage.generated.models.LastAccessTimeTrackingPolicy; +import com.azure.resourcemanager.storage.generated.models.RestorePolicyProperties; +import java.io.IOException; + +/** + * The properties of a storage account’s Blob service. + */ +@Fluent +public final class BlobServicePropertiesProperties implements JsonSerializable { + /* + * Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no + * CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for + * the Blob service. + */ + private CorsRules cors; + + /* + * DefaultServiceVersion indicates the default version to use for requests to the Blob service if an incoming + * request’s version is not specified. Possible values include version 2008-10-27 and all more recent versions. + */ + private String defaultServiceVersion; + + /* + * The blob service properties for blob soft delete. + */ + private DeleteRetentionPolicy deleteRetentionPolicy; + + /* + * Versioning is enabled if set to true. + */ + private Boolean isVersioningEnabled; + + /* + * Deprecated in favor of isVersioningEnabled property. + */ + private Boolean automaticSnapshotPolicyEnabled; + + /* + * The blob service properties for change feed events. + */ + private ChangeFeed changeFeed; + + /* + * The blob service properties for blob restore policy. + */ + private RestorePolicyProperties restorePolicy; + + /* + * The blob service properties for container soft delete. + */ + private DeleteRetentionPolicy containerDeleteRetentionPolicy; + + /* + * The blob service property to configure last access time based tracking policy. + */ + private LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy; + + /** + * Creates an instance of BlobServicePropertiesProperties class. + */ + public BlobServicePropertiesProperties() { + } + + /** + * Get the cors property: Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in + * the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS + * will be disabled for the Blob service. + * + * @return the cors value. + */ + public CorsRules cors() { + return this.cors; + } + + /** + * Set the cors property: Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in + * the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS + * will be disabled for the Blob service. + * + * @param cors the cors value to set. + * @return the BlobServicePropertiesProperties object itself. + */ + public BlobServicePropertiesProperties withCors(CorsRules cors) { + this.cors = cors; + return this; + } + + /** + * Get the defaultServiceVersion property: DefaultServiceVersion indicates the default version to use for requests + * to the Blob service if an incoming request’s version is not specified. Possible values include version 2008-10-27 + * and all more recent versions. + * + * @return the defaultServiceVersion value. + */ + public String defaultServiceVersion() { + return this.defaultServiceVersion; + } + + /** + * Set the defaultServiceVersion property: DefaultServiceVersion indicates the default version to use for requests + * to the Blob service if an incoming request’s version is not specified. Possible values include version 2008-10-27 + * and all more recent versions. + * + * @param defaultServiceVersion the defaultServiceVersion value to set. + * @return the BlobServicePropertiesProperties object itself. + */ + public BlobServicePropertiesProperties withDefaultServiceVersion(String defaultServiceVersion) { + this.defaultServiceVersion = defaultServiceVersion; + return this; + } + + /** + * Get the deleteRetentionPolicy property: The blob service properties for blob soft delete. + * + * @return the deleteRetentionPolicy value. + */ + public DeleteRetentionPolicy deleteRetentionPolicy() { + return this.deleteRetentionPolicy; + } + + /** + * Set the deleteRetentionPolicy property: The blob service properties for blob soft delete. + * + * @param deleteRetentionPolicy the deleteRetentionPolicy value to set. + * @return the BlobServicePropertiesProperties object itself. + */ + public BlobServicePropertiesProperties withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy) { + this.deleteRetentionPolicy = deleteRetentionPolicy; + return this; + } + + /** + * Get the isVersioningEnabled property: Versioning is enabled if set to true. + * + * @return the isVersioningEnabled value. + */ + public Boolean isVersioningEnabled() { + return this.isVersioningEnabled; + } + + /** + * Set the isVersioningEnabled property: Versioning is enabled if set to true. + * + * @param isVersioningEnabled the isVersioningEnabled value to set. + * @return the BlobServicePropertiesProperties object itself. + */ + public BlobServicePropertiesProperties withIsVersioningEnabled(Boolean isVersioningEnabled) { + this.isVersioningEnabled = isVersioningEnabled; + return this; + } + + /** + * Get the automaticSnapshotPolicyEnabled property: Deprecated in favor of isVersioningEnabled property. + * + * @return the automaticSnapshotPolicyEnabled value. + */ + public Boolean automaticSnapshotPolicyEnabled() { + return this.automaticSnapshotPolicyEnabled; + } + + /** + * Set the automaticSnapshotPolicyEnabled property: Deprecated in favor of isVersioningEnabled property. + * + * @param automaticSnapshotPolicyEnabled the automaticSnapshotPolicyEnabled value to set. + * @return the BlobServicePropertiesProperties object itself. + */ + public BlobServicePropertiesProperties withAutomaticSnapshotPolicyEnabled(Boolean automaticSnapshotPolicyEnabled) { + this.automaticSnapshotPolicyEnabled = automaticSnapshotPolicyEnabled; + return this; + } + + /** + * Get the changeFeed property: The blob service properties for change feed events. + * + * @return the changeFeed value. + */ + public ChangeFeed changeFeed() { + return this.changeFeed; + } + + /** + * Set the changeFeed property: The blob service properties for change feed events. + * + * @param changeFeed the changeFeed value to set. + * @return the BlobServicePropertiesProperties object itself. + */ + public BlobServicePropertiesProperties withChangeFeed(ChangeFeed changeFeed) { + this.changeFeed = changeFeed; + return this; + } + + /** + * Get the restorePolicy property: The blob service properties for blob restore policy. + * + * @return the restorePolicy value. + */ + public RestorePolicyProperties restorePolicy() { + return this.restorePolicy; + } + + /** + * Set the restorePolicy property: The blob service properties for blob restore policy. + * + * @param restorePolicy the restorePolicy value to set. + * @return the BlobServicePropertiesProperties object itself. + */ + public BlobServicePropertiesProperties withRestorePolicy(RestorePolicyProperties restorePolicy) { + this.restorePolicy = restorePolicy; + return this; + } + + /** + * Get the containerDeleteRetentionPolicy property: The blob service properties for container soft delete. + * + * @return the containerDeleteRetentionPolicy value. + */ + public DeleteRetentionPolicy containerDeleteRetentionPolicy() { + return this.containerDeleteRetentionPolicy; + } + + /** + * Set the containerDeleteRetentionPolicy property: The blob service properties for container soft delete. + * + * @param containerDeleteRetentionPolicy the containerDeleteRetentionPolicy value to set. + * @return the BlobServicePropertiesProperties object itself. + */ + public BlobServicePropertiesProperties + withContainerDeleteRetentionPolicy(DeleteRetentionPolicy containerDeleteRetentionPolicy) { + this.containerDeleteRetentionPolicy = containerDeleteRetentionPolicy; + return this; + } + + /** + * Get the lastAccessTimeTrackingPolicy property: The blob service property to configure last access time based + * tracking policy. + * + * @return the lastAccessTimeTrackingPolicy value. + */ + public LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy() { + return this.lastAccessTimeTrackingPolicy; + } + + /** + * Set the lastAccessTimeTrackingPolicy property: The blob service property to configure last access time based + * tracking policy. + * + * @param lastAccessTimeTrackingPolicy the lastAccessTimeTrackingPolicy value to set. + * @return the BlobServicePropertiesProperties object itself. + */ + public BlobServicePropertiesProperties + withLastAccessTimeTrackingPolicy(LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy) { + this.lastAccessTimeTrackingPolicy = lastAccessTimeTrackingPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (cors() != null) { + cors().validate(); + } + if (deleteRetentionPolicy() != null) { + deleteRetentionPolicy().validate(); + } + if (changeFeed() != null) { + changeFeed().validate(); + } + if (restorePolicy() != null) { + restorePolicy().validate(); + } + if (containerDeleteRetentionPolicy() != null) { + containerDeleteRetentionPolicy().validate(); + } + if (lastAccessTimeTrackingPolicy() != null) { + lastAccessTimeTrackingPolicy().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("cors", this.cors); + jsonWriter.writeStringField("defaultServiceVersion", this.defaultServiceVersion); + jsonWriter.writeJsonField("deleteRetentionPolicy", this.deleteRetentionPolicy); + jsonWriter.writeBooleanField("isVersioningEnabled", this.isVersioningEnabled); + jsonWriter.writeBooleanField("automaticSnapshotPolicyEnabled", this.automaticSnapshotPolicyEnabled); + jsonWriter.writeJsonField("changeFeed", this.changeFeed); + jsonWriter.writeJsonField("restorePolicy", this.restorePolicy); + jsonWriter.writeJsonField("containerDeleteRetentionPolicy", this.containerDeleteRetentionPolicy); + jsonWriter.writeJsonField("lastAccessTimeTrackingPolicy", this.lastAccessTimeTrackingPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobServicePropertiesProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobServicePropertiesProperties 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 BlobServicePropertiesProperties. + */ + public static BlobServicePropertiesProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobServicePropertiesProperties deserializedBlobServicePropertiesProperties + = new BlobServicePropertiesProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cors".equals(fieldName)) { + deserializedBlobServicePropertiesProperties.cors = CorsRules.fromJson(reader); + } else if ("defaultServiceVersion".equals(fieldName)) { + deserializedBlobServicePropertiesProperties.defaultServiceVersion = reader.getString(); + } else if ("deleteRetentionPolicy".equals(fieldName)) { + deserializedBlobServicePropertiesProperties.deleteRetentionPolicy + = DeleteRetentionPolicy.fromJson(reader); + } else if ("isVersioningEnabled".equals(fieldName)) { + deserializedBlobServicePropertiesProperties.isVersioningEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("automaticSnapshotPolicyEnabled".equals(fieldName)) { + deserializedBlobServicePropertiesProperties.automaticSnapshotPolicyEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("changeFeed".equals(fieldName)) { + deserializedBlobServicePropertiesProperties.changeFeed = ChangeFeed.fromJson(reader); + } else if ("restorePolicy".equals(fieldName)) { + deserializedBlobServicePropertiesProperties.restorePolicy + = RestorePolicyProperties.fromJson(reader); + } else if ("containerDeleteRetentionPolicy".equals(fieldName)) { + deserializedBlobServicePropertiesProperties.containerDeleteRetentionPolicy + = DeleteRetentionPolicy.fromJson(reader); + } else if ("lastAccessTimeTrackingPolicy".equals(fieldName)) { + deserializedBlobServicePropertiesProperties.lastAccessTimeTrackingPolicy + = LastAccessTimeTrackingPolicy.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobServicePropertiesProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/CheckNameAvailabilityResultInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/CheckNameAvailabilityResultInner.java new file mode 100644 index 0000000000000..d244dca0acabc --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/CheckNameAvailabilityResultInner.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.models.Reason; +import java.io.IOException; + +/** + * The CheckNameAvailability operation response. + */ +@Immutable +public final class CheckNameAvailabilityResultInner implements JsonSerializable { + /* + * Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. + * If false, the name has already been taken or is invalid and cannot be used. + */ + private Boolean nameAvailable; + + /* + * Gets the reason that a storage account name could not be used. The Reason element is only returned if + * NameAvailable is false. + */ + private Reason reason; + + /* + * Gets an error message explaining the Reason value in more detail. + */ + private String message; + + /** + * Creates an instance of CheckNameAvailabilityResultInner class. + */ + public CheckNameAvailabilityResultInner() { + } + + /** + * Get the nameAvailable property: Gets a boolean value that indicates whether the name is available for you to use. + * If true, the name is available. If false, the name has already been taken or is invalid and cannot be used. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get the reason property: Gets the reason that a storage account name could not be used. The Reason element is + * only returned if NameAvailable is false. + * + * @return the reason value. + */ + public Reason reason() { + return this.reason; + } + + /** + * Get the message property: Gets an error message explaining the Reason value in more detail. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * 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 CheckNameAvailabilityResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckNameAvailabilityResultInner 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 CheckNameAvailabilityResultInner. + */ + public static CheckNameAvailabilityResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckNameAvailabilityResultInner deserializedCheckNameAvailabilityResultInner + = new CheckNameAvailabilityResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nameAvailable".equals(fieldName)) { + deserializedCheckNameAvailabilityResultInner.nameAvailable + = reader.getNullable(JsonReader::getBoolean); + } else if ("reason".equals(fieldName)) { + deserializedCheckNameAvailabilityResultInner.reason = Reason.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedCheckNameAvailabilityResultInner.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCheckNameAvailabilityResultInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ContainerProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ContainerProperties.java new file mode 100644 index 0000000000000..9cf9ca5585992 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ContainerProperties.java @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.storage.generated.models.ImmutabilityPolicyProperties; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageWithVersioning; +import com.azure.resourcemanager.storage.generated.models.LeaseDuration; +import com.azure.resourcemanager.storage.generated.models.LeaseState; +import com.azure.resourcemanager.storage.generated.models.LeaseStatus; +import com.azure.resourcemanager.storage.generated.models.LegalHoldProperties; +import com.azure.resourcemanager.storage.generated.models.PublicAccess; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Map; + +/** + * The properties of a container. + */ +@Fluent +public final class ContainerProperties implements JsonSerializable { + /* + * The version of the deleted blob container. + */ + private String version; + + /* + * Indicates whether the blob container was deleted. + */ + private Boolean deleted; + + /* + * Blob container deletion time. + */ + private OffsetDateTime deletedTime; + + /* + * Remaining retention days for soft deleted blob container. + */ + private Integer remainingRetentionDays; + + /* + * Default the container to use specified encryption scope for all writes. + */ + private String defaultEncryptionScope; + + /* + * Block override of encryption scope from the container default. + */ + private Boolean denyEncryptionScopeOverride; + + /* + * Specifies whether data in the container may be accessed publicly and the level of access. + */ + private PublicAccess publicAccess; + + /* + * Returns the date and time the container was last modified. + */ + private OffsetDateTime lastModifiedTime; + + /* + * The lease status of the container. + */ + private LeaseStatus leaseStatus; + + /* + * Lease state of the container. + */ + private LeaseState leaseState; + + /* + * Specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. + */ + private LeaseDuration leaseDuration; + + /* + * A name-value pair to associate with the container as metadata. + */ + private Map metadata; + + /* + * The ImmutabilityPolicy property of the container. + */ + private ImmutabilityPolicyProperties immutabilityPolicy; + + /* + * The LegalHold property of the container. + */ + private LegalHoldProperties legalHold; + + /* + * The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold + * public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of + * 1000 blob containers with hasLegalHold=true for a given account. + */ + private Boolean hasLegalHold; + + /* + * The hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this + * container. The hasImmutabilityPolicy public property is set to false by SRP if ImmutabilityPolicy has not been + * created for this container. + */ + private Boolean hasImmutabilityPolicy; + + /* + * The object level immutability property of the container. The property is immutable and can only be set to true at + * the container creation time. Existing containers must undergo a migration process. + */ + private ImmutableStorageWithVersioning immutableStorageWithVersioning; + + /* + * Enable NFSv3 root squash on blob container. + */ + private Boolean enableNfsV3RootSquash; + + /* + * Enable NFSv3 all squash on blob container. + */ + private Boolean enableNfsV3AllSquash; + + /** + * Creates an instance of ContainerProperties class. + */ + public ContainerProperties() { + } + + /** + * Get the version property: The version of the deleted blob container. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the deleted property: Indicates whether the blob container was deleted. + * + * @return the deleted value. + */ + public Boolean deleted() { + return this.deleted; + } + + /** + * Get the deletedTime property: Blob container deletion time. + * + * @return the deletedTime value. + */ + public OffsetDateTime deletedTime() { + return this.deletedTime; + } + + /** + * Get the remainingRetentionDays property: Remaining retention days for soft deleted blob container. + * + * @return the remainingRetentionDays value. + */ + public Integer remainingRetentionDays() { + return this.remainingRetentionDays; + } + + /** + * Get the defaultEncryptionScope property: Default the container to use specified encryption scope for all writes. + * + * @return the defaultEncryptionScope value. + */ + public String defaultEncryptionScope() { + return this.defaultEncryptionScope; + } + + /** + * Set the defaultEncryptionScope property: Default the container to use specified encryption scope for all writes. + * + * @param defaultEncryptionScope the defaultEncryptionScope value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withDefaultEncryptionScope(String defaultEncryptionScope) { + this.defaultEncryptionScope = defaultEncryptionScope; + return this; + } + + /** + * Get the denyEncryptionScopeOverride property: Block override of encryption scope from the container default. + * + * @return the denyEncryptionScopeOverride value. + */ + public Boolean denyEncryptionScopeOverride() { + return this.denyEncryptionScopeOverride; + } + + /** + * Set the denyEncryptionScopeOverride property: Block override of encryption scope from the container default. + * + * @param denyEncryptionScopeOverride the denyEncryptionScopeOverride value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withDenyEncryptionScopeOverride(Boolean denyEncryptionScopeOverride) { + this.denyEncryptionScopeOverride = denyEncryptionScopeOverride; + return this; + } + + /** + * Get the publicAccess property: Specifies whether data in the container may be accessed publicly and the level of + * access. + * + * @return the publicAccess value. + */ + public PublicAccess publicAccess() { + return this.publicAccess; + } + + /** + * Set the publicAccess property: Specifies whether data in the container may be accessed publicly and the level of + * access. + * + * @param publicAccess the publicAccess value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withPublicAccess(PublicAccess publicAccess) { + this.publicAccess = publicAccess; + return this; + } + + /** + * Get the lastModifiedTime property: Returns the date and time the container was last modified. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the leaseStatus property: The lease status of the container. + * + * @return the leaseStatus value. + */ + public LeaseStatus leaseStatus() { + return this.leaseStatus; + } + + /** + * Get the leaseState property: Lease state of the container. + * + * @return the leaseState value. + */ + public LeaseState leaseState() { + return this.leaseState; + } + + /** + * Get the leaseDuration property: Specifies whether the lease on a container is of infinite or fixed duration, only + * when the container is leased. + * + * @return the leaseDuration value. + */ + public LeaseDuration leaseDuration() { + return this.leaseDuration; + } + + /** + * Get the metadata property: A name-value pair to associate with the container as metadata. + * + * @return the metadata value. + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set the metadata property: A name-value pair to associate with the container as metadata. + * + * @param metadata the metadata value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the immutabilityPolicy property: The ImmutabilityPolicy property of the container. + * + * @return the immutabilityPolicy value. + */ + public ImmutabilityPolicyProperties immutabilityPolicy() { + return this.immutabilityPolicy; + } + + /** + * Get the legalHold property: The LegalHold property of the container. + * + * @return the legalHold value. + */ + public LegalHoldProperties legalHold() { + return this.legalHold; + } + + /** + * Get the hasLegalHold property: The hasLegalHold public property is set to true by SRP if there are at least one + * existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared + * out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. + * + * @return the hasLegalHold value. + */ + public Boolean hasLegalHold() { + return this.hasLegalHold; + } + + /** + * Get the hasImmutabilityPolicy property: The hasImmutabilityPolicy public property is set to true by SRP if + * ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false + * by SRP if ImmutabilityPolicy has not been created for this container. + * + * @return the hasImmutabilityPolicy value. + */ + public Boolean hasImmutabilityPolicy() { + return this.hasImmutabilityPolicy; + } + + /** + * Get the immutableStorageWithVersioning property: The object level immutability property of the container. The + * property is immutable and can only be set to true at the container creation time. Existing containers must + * undergo a migration process. + * + * @return the immutableStorageWithVersioning value. + */ + public ImmutableStorageWithVersioning immutableStorageWithVersioning() { + return this.immutableStorageWithVersioning; + } + + /** + * Set the immutableStorageWithVersioning property: The object level immutability property of the container. The + * property is immutable and can only be set to true at the container creation time. Existing containers must + * undergo a migration process. + * + * @param immutableStorageWithVersioning the immutableStorageWithVersioning value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties + withImmutableStorageWithVersioning(ImmutableStorageWithVersioning immutableStorageWithVersioning) { + this.immutableStorageWithVersioning = immutableStorageWithVersioning; + return this; + } + + /** + * Get the enableNfsV3RootSquash property: Enable NFSv3 root squash on blob container. + * + * @return the enableNfsV3RootSquash value. + */ + public Boolean enableNfsV3RootSquash() { + return this.enableNfsV3RootSquash; + } + + /** + * Set the enableNfsV3RootSquash property: Enable NFSv3 root squash on blob container. + * + * @param enableNfsV3RootSquash the enableNfsV3RootSquash value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withEnableNfsV3RootSquash(Boolean enableNfsV3RootSquash) { + this.enableNfsV3RootSquash = enableNfsV3RootSquash; + return this; + } + + /** + * Get the enableNfsV3AllSquash property: Enable NFSv3 all squash on blob container. + * + * @return the enableNfsV3AllSquash value. + */ + public Boolean enableNfsV3AllSquash() { + return this.enableNfsV3AllSquash; + } + + /** + * Set the enableNfsV3AllSquash property: Enable NFSv3 all squash on blob container. + * + * @param enableNfsV3AllSquash the enableNfsV3AllSquash value to set. + * @return the ContainerProperties object itself. + */ + public ContainerProperties withEnableNfsV3AllSquash(Boolean enableNfsV3AllSquash) { + this.enableNfsV3AllSquash = enableNfsV3AllSquash; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (immutabilityPolicy() != null) { + immutabilityPolicy().validate(); + } + if (legalHold() != null) { + legalHold().validate(); + } + if (immutableStorageWithVersioning() != null) { + immutableStorageWithVersioning().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("defaultEncryptionScope", this.defaultEncryptionScope); + jsonWriter.writeBooleanField("denyEncryptionScopeOverride", this.denyEncryptionScopeOverride); + jsonWriter.writeStringField("publicAccess", this.publicAccess == null ? null : this.publicAccess.toString()); + jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("immutableStorageWithVersioning", this.immutableStorageWithVersioning); + jsonWriter.writeBooleanField("enableNfsV3RootSquash", this.enableNfsV3RootSquash); + jsonWriter.writeBooleanField("enableNfsV3AllSquash", this.enableNfsV3AllSquash); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerProperties 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 ContainerProperties. + */ + public static ContainerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerProperties deserializedContainerProperties = new ContainerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("version".equals(fieldName)) { + deserializedContainerProperties.version = reader.getString(); + } else if ("deleted".equals(fieldName)) { + deserializedContainerProperties.deleted = reader.getNullable(JsonReader::getBoolean); + } else if ("deletedTime".equals(fieldName)) { + deserializedContainerProperties.deletedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("remainingRetentionDays".equals(fieldName)) { + deserializedContainerProperties.remainingRetentionDays = reader.getNullable(JsonReader::getInt); + } else if ("defaultEncryptionScope".equals(fieldName)) { + deserializedContainerProperties.defaultEncryptionScope = reader.getString(); + } else if ("denyEncryptionScopeOverride".equals(fieldName)) { + deserializedContainerProperties.denyEncryptionScopeOverride + = reader.getNullable(JsonReader::getBoolean); + } else if ("publicAccess".equals(fieldName)) { + deserializedContainerProperties.publicAccess = PublicAccess.fromString(reader.getString()); + } else if ("lastModifiedTime".equals(fieldName)) { + deserializedContainerProperties.lastModifiedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("leaseStatus".equals(fieldName)) { + deserializedContainerProperties.leaseStatus = LeaseStatus.fromString(reader.getString()); + } else if ("leaseState".equals(fieldName)) { + deserializedContainerProperties.leaseState = LeaseState.fromString(reader.getString()); + } else if ("leaseDuration".equals(fieldName)) { + deserializedContainerProperties.leaseDuration = LeaseDuration.fromString(reader.getString()); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedContainerProperties.metadata = metadata; + } else if ("immutabilityPolicy".equals(fieldName)) { + deserializedContainerProperties.immutabilityPolicy = ImmutabilityPolicyProperties.fromJson(reader); + } else if ("legalHold".equals(fieldName)) { + deserializedContainerProperties.legalHold = LegalHoldProperties.fromJson(reader); + } else if ("hasLegalHold".equals(fieldName)) { + deserializedContainerProperties.hasLegalHold = reader.getNullable(JsonReader::getBoolean); + } else if ("hasImmutabilityPolicy".equals(fieldName)) { + deserializedContainerProperties.hasImmutabilityPolicy = reader.getNullable(JsonReader::getBoolean); + } else if ("immutableStorageWithVersioning".equals(fieldName)) { + deserializedContainerProperties.immutableStorageWithVersioning + = ImmutableStorageWithVersioning.fromJson(reader); + } else if ("enableNfsV3RootSquash".equals(fieldName)) { + deserializedContainerProperties.enableNfsV3RootSquash = reader.getNullable(JsonReader::getBoolean); + } else if ("enableNfsV3AllSquash".equals(fieldName)) { + deserializedContainerProperties.enableNfsV3AllSquash = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/DeletedAccountInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/DeletedAccountInner.java new file mode 100644 index 0000000000000..ab00af8bb6a2f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/DeletedAccountInner.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Deleted storage account. + */ +@Immutable +public final class DeletedAccountInner extends ProxyResource { + /* + * Properties of the deleted account. + */ + private DeletedAccountProperties innerProperties; + + /* + * 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 DeletedAccountInner class. + */ + public DeletedAccountInner() { + } + + /** + * Get the innerProperties property: Properties of the deleted account. + * + * @return the innerProperties value. + */ + private DeletedAccountProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * Get the storageAccountResourceId property: Full resource id of the original storage account. + * + * @return the storageAccountResourceId value. + */ + public String storageAccountResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().storageAccountResourceId(); + } + + /** + * Get the location property: Location of the deleted account. + * + * @return the location value. + */ + public String location() { + return this.innerProperties() == null ? null : this.innerProperties().location(); + } + + /** + * Get the restoreReference property: Can be used to attempt recovering this deleted account via PutStorageAccount + * API. + * + * @return the restoreReference value. + */ + public String restoreReference() { + return this.innerProperties() == null ? null : this.innerProperties().restoreReference(); + } + + /** + * Get the creationTime property: Creation time of the deleted account. + * + * @return the creationTime value. + */ + public String creationTime() { + return this.innerProperties() == null ? null : this.innerProperties().creationTime(); + } + + /** + * Get the deletionTime property: Deletion time of the deleted account. + * + * @return the deletionTime value. + */ + public String deletionTime() { + return this.innerProperties() == null ? null : this.innerProperties().deletionTime(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeletedAccountInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeletedAccountInner 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 DeletedAccountInner. + */ + public static DeletedAccountInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeletedAccountInner deserializedDeletedAccountInner = new DeletedAccountInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDeletedAccountInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDeletedAccountInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDeletedAccountInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDeletedAccountInner.innerProperties = DeletedAccountProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDeletedAccountInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/DeletedAccountProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/DeletedAccountProperties.java new file mode 100644 index 0000000000000..6fb4dbe66bdb0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/DeletedAccountProperties.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 java.io.IOException; + +/** + * Attributes of a deleted storage account. + */ +@Immutable +public final class DeletedAccountProperties implements JsonSerializable { + /* + * Full resource id of the original storage account. + */ + private String storageAccountResourceId; + + /* + * Location of the deleted account. + */ + private String location; + + /* + * Can be used to attempt recovering this deleted account via PutStorageAccount API. + */ + private String restoreReference; + + /* + * Creation time of the deleted account. + */ + private String creationTime; + + /* + * Deletion time of the deleted account. + */ + private String deletionTime; + + /** + * Creates an instance of DeletedAccountProperties class. + */ + public DeletedAccountProperties() { + } + + /** + * Get the storageAccountResourceId property: Full resource id of the original storage account. + * + * @return the storageAccountResourceId value. + */ + public String storageAccountResourceId() { + return this.storageAccountResourceId; + } + + /** + * Get the location property: Location of the deleted account. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the restoreReference property: Can be used to attempt recovering this deleted account via PutStorageAccount + * API. + * + * @return the restoreReference value. + */ + public String restoreReference() { + return this.restoreReference; + } + + /** + * Get the creationTime property: Creation time of the deleted account. + * + * @return the creationTime value. + */ + public String creationTime() { + return this.creationTime; + } + + /** + * Get the deletionTime property: Deletion time of the deleted account. + * + * @return the deletionTime value. + */ + public String deletionTime() { + return this.deletionTime; + } + + /** + * 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 DeletedAccountProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeletedAccountProperties 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 DeletedAccountProperties. + */ + public static DeletedAccountProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeletedAccountProperties deserializedDeletedAccountProperties = new DeletedAccountProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storageAccountResourceId".equals(fieldName)) { + deserializedDeletedAccountProperties.storageAccountResourceId = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedDeletedAccountProperties.location = reader.getString(); + } else if ("restoreReference".equals(fieldName)) { + deserializedDeletedAccountProperties.restoreReference = reader.getString(); + } else if ("creationTime".equals(fieldName)) { + deserializedDeletedAccountProperties.creationTime = reader.getString(); + } else if ("deletionTime".equals(fieldName)) { + deserializedDeletedAccountProperties.deletionTime = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDeletedAccountProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/EncryptionScopeInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/EncryptionScopeInner.java new file mode 100644 index 0000000000000..74c21eb1ee43a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/EncryptionScopeInner.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeKeyVaultProperties; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeSource; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeState; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The Encryption Scope resource. + */ +@Fluent +public final class EncryptionScopeInner extends ProxyResource { + /* + * Properties of the encryption scope. + */ + private EncryptionScopeProperties innerEncryptionScopeProperties; + + /* + * 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 EncryptionScopeInner class. + */ + public EncryptionScopeInner() { + } + + /** + * Get the innerEncryptionScopeProperties property: Properties of the encryption scope. + * + * @return the innerEncryptionScopeProperties value. + */ + private EncryptionScopeProperties innerEncryptionScopeProperties() { + return this.innerEncryptionScopeProperties; + } + + /** + * 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; + } + + /** + * Get the source property: The provider for the encryption scope. Possible values (case-insensitive): + * Microsoft.Storage, Microsoft.KeyVault. + * + * @return the source value. + */ + public EncryptionScopeSource source() { + return this.innerEncryptionScopeProperties() == null ? null : this.innerEncryptionScopeProperties().source(); + } + + /** + * Set the source property: The provider for the encryption scope. Possible values (case-insensitive): + * Microsoft.Storage, Microsoft.KeyVault. + * + * @param source the source value to set. + * @return the EncryptionScopeInner object itself. + */ + public EncryptionScopeInner withSource(EncryptionScopeSource source) { + if (this.innerEncryptionScopeProperties() == null) { + this.innerEncryptionScopeProperties = new EncryptionScopeProperties(); + } + this.innerEncryptionScopeProperties().withSource(source); + return this; + } + + /** + * Get the state property: The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + * + * @return the state value. + */ + public EncryptionScopeState state() { + return this.innerEncryptionScopeProperties() == null ? null : this.innerEncryptionScopeProperties().state(); + } + + /** + * Set the state property: The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + * + * @param state the state value to set. + * @return the EncryptionScopeInner object itself. + */ + public EncryptionScopeInner withState(EncryptionScopeState state) { + if (this.innerEncryptionScopeProperties() == null) { + this.innerEncryptionScopeProperties = new EncryptionScopeProperties(); + } + this.innerEncryptionScopeProperties().withState(state); + return this; + } + + /** + * Get the creationTime property: Gets the creation date and time of the encryption scope in UTC. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.innerEncryptionScopeProperties() == null + ? null + : this.innerEncryptionScopeProperties().creationTime(); + } + + /** + * Get the lastModifiedTime property: Gets the last modification date and time of the encryption scope in UTC. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.innerEncryptionScopeProperties() == null + ? null + : this.innerEncryptionScopeProperties().lastModifiedTime(); + } + + /** + * Get the keyVaultProperties property: The key vault properties for the encryption scope. This is a required field + * if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + * + * @return the keyVaultProperties value. + */ + public EncryptionScopeKeyVaultProperties keyVaultProperties() { + return this.innerEncryptionScopeProperties() == null + ? null + : this.innerEncryptionScopeProperties().keyVaultProperties(); + } + + /** + * Set the keyVaultProperties property: The key vault properties for the encryption scope. This is a required field + * if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + * + * @param keyVaultProperties the keyVaultProperties value to set. + * @return the EncryptionScopeInner object itself. + */ + public EncryptionScopeInner withKeyVaultProperties(EncryptionScopeKeyVaultProperties keyVaultProperties) { + if (this.innerEncryptionScopeProperties() == null) { + this.innerEncryptionScopeProperties = new EncryptionScopeProperties(); + } + this.innerEncryptionScopeProperties().withKeyVaultProperties(keyVaultProperties); + return this; + } + + /** + * Get the requireInfrastructureEncryption property: A boolean indicating whether or not the service applies a + * secondary layer of encryption with platform managed keys for data at rest. + * + * @return the requireInfrastructureEncryption value. + */ + public Boolean requireInfrastructureEncryption() { + return this.innerEncryptionScopeProperties() == null + ? null + : this.innerEncryptionScopeProperties().requireInfrastructureEncryption(); + } + + /** + * Set the requireInfrastructureEncryption property: A boolean indicating whether or not the service applies a + * secondary layer of encryption with platform managed keys for data at rest. + * + * @param requireInfrastructureEncryption the requireInfrastructureEncryption value to set. + * @return the EncryptionScopeInner object itself. + */ + public EncryptionScopeInner withRequireInfrastructureEncryption(Boolean requireInfrastructureEncryption) { + if (this.innerEncryptionScopeProperties() == null) { + this.innerEncryptionScopeProperties = new EncryptionScopeProperties(); + } + this.innerEncryptionScopeProperties().withRequireInfrastructureEncryption(requireInfrastructureEncryption); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerEncryptionScopeProperties() != null) { + innerEncryptionScopeProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerEncryptionScopeProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionScopeInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionScopeInner 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 EncryptionScopeInner. + */ + public static EncryptionScopeInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionScopeInner deserializedEncryptionScopeInner = new EncryptionScopeInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEncryptionScopeInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEncryptionScopeInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEncryptionScopeInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedEncryptionScopeInner.innerEncryptionScopeProperties + = EncryptionScopeProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionScopeInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/EncryptionScopeProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/EncryptionScopeProperties.java new file mode 100644 index 0000000000000..7d96085654de7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/EncryptionScopeProperties.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeKeyVaultProperties; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeSource; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeState; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Properties of the encryption scope. + */ +@Fluent +public final class EncryptionScopeProperties implements JsonSerializable { + /* + * The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. + */ + private EncryptionScopeSource source; + + /* + * The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + */ + private EncryptionScopeState state; + + /* + * Gets the creation date and time of the encryption scope in UTC. + */ + private OffsetDateTime creationTime; + + /* + * Gets the last modification date and time of the encryption scope in UTC. + */ + private OffsetDateTime lastModifiedTime; + + /* + * The key vault properties for the encryption scope. This is a required field if encryption scope 'source' + * attribute is set to 'Microsoft.KeyVault'. + */ + private EncryptionScopeKeyVaultProperties keyVaultProperties; + + /* + * A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed + * keys for data at rest. + */ + private Boolean requireInfrastructureEncryption; + + /** + * Creates an instance of EncryptionScopeProperties class. + */ + public EncryptionScopeProperties() { + } + + /** + * Get the source property: The provider for the encryption scope. Possible values (case-insensitive): + * Microsoft.Storage, Microsoft.KeyVault. + * + * @return the source value. + */ + public EncryptionScopeSource source() { + return this.source; + } + + /** + * Set the source property: The provider for the encryption scope. Possible values (case-insensitive): + * Microsoft.Storage, Microsoft.KeyVault. + * + * @param source the source value to set. + * @return the EncryptionScopeProperties object itself. + */ + public EncryptionScopeProperties withSource(EncryptionScopeSource source) { + this.source = source; + return this; + } + + /** + * Get the state property: The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + * + * @return the state value. + */ + public EncryptionScopeState state() { + return this.state; + } + + /** + * Set the state property: The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + * + * @param state the state value to set. + * @return the EncryptionScopeProperties object itself. + */ + public EncryptionScopeProperties withState(EncryptionScopeState state) { + this.state = state; + return this; + } + + /** + * Get the creationTime property: Gets the creation date and time of the encryption scope in UTC. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Get the lastModifiedTime property: Gets the last modification date and time of the encryption scope in UTC. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the keyVaultProperties property: The key vault properties for the encryption scope. This is a required field + * if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + * + * @return the keyVaultProperties value. + */ + public EncryptionScopeKeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set the keyVaultProperties property: The key vault properties for the encryption scope. This is a required field + * if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + * + * @param keyVaultProperties the keyVaultProperties value to set. + * @return the EncryptionScopeProperties object itself. + */ + public EncryptionScopeProperties withKeyVaultProperties(EncryptionScopeKeyVaultProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + + /** + * Get the requireInfrastructureEncryption property: A boolean indicating whether or not the service applies a + * secondary layer of encryption with platform managed keys for data at rest. + * + * @return the requireInfrastructureEncryption value. + */ + public Boolean requireInfrastructureEncryption() { + return this.requireInfrastructureEncryption; + } + + /** + * Set the requireInfrastructureEncryption property: A boolean indicating whether or not the service applies a + * secondary layer of encryption with platform managed keys for data at rest. + * + * @param requireInfrastructureEncryption the requireInfrastructureEncryption value to set. + * @return the EncryptionScopeProperties object itself. + */ + public EncryptionScopeProperties withRequireInfrastructureEncryption(Boolean requireInfrastructureEncryption) { + this.requireInfrastructureEncryption = requireInfrastructureEncryption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVaultProperties() != null) { + keyVaultProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("source", this.source == null ? null : this.source.toString()); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeJsonField("keyVaultProperties", this.keyVaultProperties); + jsonWriter.writeBooleanField("requireInfrastructureEncryption", this.requireInfrastructureEncryption); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionScopeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionScopeProperties 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 EncryptionScopeProperties. + */ + public static EncryptionScopeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionScopeProperties deserializedEncryptionScopeProperties = new EncryptionScopeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("source".equals(fieldName)) { + deserializedEncryptionScopeProperties.source = EncryptionScopeSource.fromString(reader.getString()); + } else if ("state".equals(fieldName)) { + deserializedEncryptionScopeProperties.state = EncryptionScopeState.fromString(reader.getString()); + } else if ("creationTime".equals(fieldName)) { + deserializedEncryptionScopeProperties.creationTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedTime".equals(fieldName)) { + deserializedEncryptionScopeProperties.lastModifiedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("keyVaultProperties".equals(fieldName)) { + deserializedEncryptionScopeProperties.keyVaultProperties + = EncryptionScopeKeyVaultProperties.fromJson(reader); + } else if ("requireInfrastructureEncryption".equals(fieldName)) { + deserializedEncryptionScopeProperties.requireInfrastructureEncryption + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionScopeProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileServiceItemsInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileServiceItemsInner.java new file mode 100644 index 0000000000000..2c0869e72fe5e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileServiceItemsInner.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 java.io.IOException; +import java.util.List; + +/** + * The FileServiceItems model. + */ +@Immutable +public final class FileServiceItemsInner implements JsonSerializable { + /* + * List of file services returned. + */ + private List value; + + /** + * Creates an instance of FileServiceItemsInner class. + */ + public FileServiceItemsInner() { + } + + /** + * Get the value property: List of file services returned. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileServiceItemsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileServiceItemsInner 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 FileServiceItemsInner. + */ + public static FileServiceItemsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileServiceItemsInner deserializedFileServiceItemsInner = new FileServiceItemsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> FileServicePropertiesInner.fromJson(reader1)); + deserializedFileServiceItemsInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedFileServiceItemsInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileServicePropertiesInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileServicePropertiesInner.java new file mode 100644 index 0000000000000..6ca66f2eb444e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileServicePropertiesInner.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.azure.resourcemanager.storage.generated.models.DeleteRetentionPolicy; +import com.azure.resourcemanager.storage.generated.models.ProtocolSettings; +import com.azure.resourcemanager.storage.generated.models.Sku; +import java.io.IOException; + +/** + * The properties of File services in storage account. + */ +@Fluent +public final class FileServicePropertiesInner extends ProxyResource { + /* + * The properties of File services in storage account. + */ + private FileServicePropertiesProperties innerFileServiceProperties; + + /* + * Sku name and tier. + */ + private Sku sku; + + /* + * 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 FileServicePropertiesInner class. + */ + public FileServicePropertiesInner() { + } + + /** + * Get the innerFileServiceProperties property: The properties of File services in storage account. + * + * @return the innerFileServiceProperties value. + */ + private FileServicePropertiesProperties innerFileServiceProperties() { + return this.innerFileServiceProperties; + } + + /** + * Get the sku property: Sku name and tier. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * 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; + } + + /** + * Get the cors property: Specifies CORS rules for the File service. You can include up to five CorsRule elements in + * the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS + * will be disabled for the File service. + * + * @return the cors value. + */ + public CorsRules cors() { + return this.innerFileServiceProperties() == null ? null : this.innerFileServiceProperties().cors(); + } + + /** + * Set the cors property: Specifies CORS rules for the File service. You can include up to five CorsRule elements in + * the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS + * will be disabled for the File service. + * + * @param cors the cors value to set. + * @return the FileServicePropertiesInner object itself. + */ + public FileServicePropertiesInner withCors(CorsRules cors) { + if (this.innerFileServiceProperties() == null) { + this.innerFileServiceProperties = new FileServicePropertiesProperties(); + } + this.innerFileServiceProperties().withCors(cors); + return this; + } + + /** + * Get the shareDeleteRetentionPolicy property: The file service properties for share soft delete. + * + * @return the shareDeleteRetentionPolicy value. + */ + public DeleteRetentionPolicy shareDeleteRetentionPolicy() { + return this.innerFileServiceProperties() == null + ? null + : this.innerFileServiceProperties().shareDeleteRetentionPolicy(); + } + + /** + * Set the shareDeleteRetentionPolicy property: The file service properties for share soft delete. + * + * @param shareDeleteRetentionPolicy the shareDeleteRetentionPolicy value to set. + * @return the FileServicePropertiesInner object itself. + */ + public FileServicePropertiesInner withShareDeleteRetentionPolicy(DeleteRetentionPolicy shareDeleteRetentionPolicy) { + if (this.innerFileServiceProperties() == null) { + this.innerFileServiceProperties = new FileServicePropertiesProperties(); + } + this.innerFileServiceProperties().withShareDeleteRetentionPolicy(shareDeleteRetentionPolicy); + return this; + } + + /** + * Get the protocolSettings property: Protocol settings for file service. + * + * @return the protocolSettings value. + */ + public ProtocolSettings protocolSettings() { + return this.innerFileServiceProperties() == null ? null : this.innerFileServiceProperties().protocolSettings(); + } + + /** + * Set the protocolSettings property: Protocol settings for file service. + * + * @param protocolSettings the protocolSettings value to set. + * @return the FileServicePropertiesInner object itself. + */ + public FileServicePropertiesInner withProtocolSettings(ProtocolSettings protocolSettings) { + if (this.innerFileServiceProperties() == null) { + this.innerFileServiceProperties = new FileServicePropertiesProperties(); + } + this.innerFileServiceProperties().withProtocolSettings(protocolSettings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerFileServiceProperties() != null) { + innerFileServiceProperties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerFileServiceProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileServicePropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileServicePropertiesInner 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 FileServicePropertiesInner. + */ + public static FileServicePropertiesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileServicePropertiesInner deserializedFileServicePropertiesInner = new FileServicePropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFileServicePropertiesInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFileServicePropertiesInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFileServicePropertiesInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedFileServicePropertiesInner.innerFileServiceProperties + = FileServicePropertiesProperties.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedFileServicePropertiesInner.sku = Sku.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFileServicePropertiesInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileServicePropertiesProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileServicePropertiesProperties.java new file mode 100644 index 0000000000000..c6782242df601 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileServicePropertiesProperties.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.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 com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.azure.resourcemanager.storage.generated.models.DeleteRetentionPolicy; +import com.azure.resourcemanager.storage.generated.models.ProtocolSettings; +import java.io.IOException; + +/** + * The properties of File services in storage account. + */ +@Fluent +public final class FileServicePropertiesProperties implements JsonSerializable { + /* + * Specifies CORS rules for the File service. You can include up to five CorsRule elements in the request. If no + * CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for + * the File service. + */ + private CorsRules cors; + + /* + * The file service properties for share soft delete. + */ + private DeleteRetentionPolicy shareDeleteRetentionPolicy; + + /* + * Protocol settings for file service + */ + private ProtocolSettings protocolSettings; + + /** + * Creates an instance of FileServicePropertiesProperties class. + */ + public FileServicePropertiesProperties() { + } + + /** + * Get the cors property: Specifies CORS rules for the File service. You can include up to five CorsRule elements in + * the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS + * will be disabled for the File service. + * + * @return the cors value. + */ + public CorsRules cors() { + return this.cors; + } + + /** + * Set the cors property: Specifies CORS rules for the File service. You can include up to five CorsRule elements in + * the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS + * will be disabled for the File service. + * + * @param cors the cors value to set. + * @return the FileServicePropertiesProperties object itself. + */ + public FileServicePropertiesProperties withCors(CorsRules cors) { + this.cors = cors; + return this; + } + + /** + * Get the shareDeleteRetentionPolicy property: The file service properties for share soft delete. + * + * @return the shareDeleteRetentionPolicy value. + */ + public DeleteRetentionPolicy shareDeleteRetentionPolicy() { + return this.shareDeleteRetentionPolicy; + } + + /** + * Set the shareDeleteRetentionPolicy property: The file service properties for share soft delete. + * + * @param shareDeleteRetentionPolicy the shareDeleteRetentionPolicy value to set. + * @return the FileServicePropertiesProperties object itself. + */ + public FileServicePropertiesProperties + withShareDeleteRetentionPolicy(DeleteRetentionPolicy shareDeleteRetentionPolicy) { + this.shareDeleteRetentionPolicy = shareDeleteRetentionPolicy; + return this; + } + + /** + * Get the protocolSettings property: Protocol settings for file service. + * + * @return the protocolSettings value. + */ + public ProtocolSettings protocolSettings() { + return this.protocolSettings; + } + + /** + * Set the protocolSettings property: Protocol settings for file service. + * + * @param protocolSettings the protocolSettings value to set. + * @return the FileServicePropertiesProperties object itself. + */ + public FileServicePropertiesProperties withProtocolSettings(ProtocolSettings protocolSettings) { + this.protocolSettings = protocolSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (cors() != null) { + cors().validate(); + } + if (shareDeleteRetentionPolicy() != null) { + shareDeleteRetentionPolicy().validate(); + } + if (protocolSettings() != null) { + protocolSettings().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("cors", this.cors); + jsonWriter.writeJsonField("shareDeleteRetentionPolicy", this.shareDeleteRetentionPolicy); + jsonWriter.writeJsonField("protocolSettings", this.protocolSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileServicePropertiesProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileServicePropertiesProperties 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 FileServicePropertiesProperties. + */ + public static FileServicePropertiesProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileServicePropertiesProperties deserializedFileServicePropertiesProperties + = new FileServicePropertiesProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cors".equals(fieldName)) { + deserializedFileServicePropertiesProperties.cors = CorsRules.fromJson(reader); + } else if ("shareDeleteRetentionPolicy".equals(fieldName)) { + deserializedFileServicePropertiesProperties.shareDeleteRetentionPolicy + = DeleteRetentionPolicy.fromJson(reader); + } else if ("protocolSettings".equals(fieldName)) { + deserializedFileServicePropertiesProperties.protocolSettings = ProtocolSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFileServicePropertiesProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileServiceUsageInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileServiceUsageInner.java new file mode 100644 index 0000000000000..79fc403becd0d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileServiceUsageInner.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.storage.generated.models.FileServiceUsageProperties; +import java.io.IOException; + +/** + * The usage of file service in storage account. + */ +@Immutable +public final class FileServiceUsageInner extends ProxyResource { + /* + * File service usage in storage account including account limits, file share limits and constants used in + * recommendations and bursting formula. + */ + private FileServiceUsageProperties properties; + + /* + * 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 FileServiceUsageInner class. + */ + public FileServiceUsageInner() { + } + + /** + * Get the properties property: File service usage in storage account including account limits, file share limits + * and constants used in recommendations and bursting formula. + * + * @return the properties value. + */ + public FileServiceUsageProperties properties() { + return this.properties; + } + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileServiceUsageInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileServiceUsageInner 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 FileServiceUsageInner. + */ + public static FileServiceUsageInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileServiceUsageInner deserializedFileServiceUsageInner = new FileServiceUsageInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFileServiceUsageInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFileServiceUsageInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFileServiceUsageInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedFileServiceUsageInner.properties = FileServiceUsageProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFileServiceUsageInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileShareInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileShareInner.java new file mode 100644 index 0000000000000..40845b2259fcf --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileShareInner.java @@ -0,0 +1,566 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.storage.generated.models.AzureEntityResource; +import com.azure.resourcemanager.storage.generated.models.EnabledProtocols; +import com.azure.resourcemanager.storage.generated.models.FileSharePropertiesFileSharePaidBursting; +import com.azure.resourcemanager.storage.generated.models.LeaseDuration; +import com.azure.resourcemanager.storage.generated.models.LeaseState; +import com.azure.resourcemanager.storage.generated.models.LeaseStatus; +import com.azure.resourcemanager.storage.generated.models.RootSquashType; +import com.azure.resourcemanager.storage.generated.models.ShareAccessTier; +import com.azure.resourcemanager.storage.generated.models.SignedIdentifier; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Properties of the file share, including Id, resource name, resource type, Etag. + */ +@Fluent +public final class FileShareInner extends AzureEntityResource { + /* + * Properties of the file share. + */ + private FileShareProperties innerFileShareProperties; + + /* + * Resource Etag. + */ + private String etag; + + /* + * 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 FileShareInner class. + */ + public FileShareInner() { + } + + /** + * Get the innerFileShareProperties property: Properties of the file share. + * + * @return the innerFileShareProperties value. + */ + private FileShareProperties innerFileShareProperties() { + return this.innerFileShareProperties; + } + + /** + * Get the etag property: Resource Etag. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + + /** + * 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; + } + + /** + * Get the lastModifiedTime property: Returns the date and time the share was last modified. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().lastModifiedTime(); + } + + /** + * Get the metadata property: A name-value pair to associate with the share as metadata. + * + * @return the metadata value. + */ + public Map metadata() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().metadata(); + } + + /** + * Set the metadata property: A name-value pair to associate with the share as metadata. + * + * @param metadata the metadata value to set. + * @return the FileShareInner object itself. + */ + public FileShareInner withMetadata(Map metadata) { + if (this.innerFileShareProperties() == null) { + this.innerFileShareProperties = new FileShareProperties(); + } + this.innerFileShareProperties().withMetadata(metadata); + return this; + } + + /** + * Get the shareQuota property: The provisioned size of the share, in gibibytes. Must be greater than 0, and less + * than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. For file shares created under + * Files Provisioned v2 account type, please refer to the GetFileServiceUsage API response for the minimum and + * maximum allowed provisioned storage size. + * + * @return the shareQuota value. + */ + public Integer shareQuota() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().shareQuota(); + } + + /** + * Set the shareQuota property: The provisioned size of the share, in gibibytes. Must be greater than 0, and less + * than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. For file shares created under + * Files Provisioned v2 account type, please refer to the GetFileServiceUsage API response for the minimum and + * maximum allowed provisioned storage size. + * + * @param shareQuota the shareQuota value to set. + * @return the FileShareInner object itself. + */ + public FileShareInner withShareQuota(Integer shareQuota) { + if (this.innerFileShareProperties() == null) { + this.innerFileShareProperties = new FileShareProperties(); + } + this.innerFileShareProperties().withShareQuota(shareQuota); + return this; + } + + /** + * Get the provisionedIops property: The provisioned IOPS of the share. This property is only for file shares + * created under Files Provisioned v2 account type. Please refer to the GetFileServiceUsage API response for the + * minimum and maximum allowed value for provisioned IOPS. + * + * @return the provisionedIops value. + */ + public Integer provisionedIops() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().provisionedIops(); + } + + /** + * Set the provisionedIops property: The provisioned IOPS of the share. This property is only for file shares + * created under Files Provisioned v2 account type. Please refer to the GetFileServiceUsage API response for the + * minimum and maximum allowed value for provisioned IOPS. + * + * @param provisionedIops the provisionedIops value to set. + * @return the FileShareInner object itself. + */ + public FileShareInner withProvisionedIops(Integer provisionedIops) { + if (this.innerFileShareProperties() == null) { + this.innerFileShareProperties = new FileShareProperties(); + } + this.innerFileShareProperties().withProvisionedIops(provisionedIops); + return this; + } + + /** + * Get the provisionedBandwidthMibps property: The provisioned bandwidth of the share, in mebibytes per second. This + * property is only for file shares created under Files Provisioned v2 account type. Please refer to the + * GetFileServiceUsage API response for the minimum and maximum allowed value for provisioned bandwidth. + * + * @return the provisionedBandwidthMibps value. + */ + public Integer provisionedBandwidthMibps() { + return this.innerFileShareProperties() == null + ? null + : this.innerFileShareProperties().provisionedBandwidthMibps(); + } + + /** + * Set the provisionedBandwidthMibps property: The provisioned bandwidth of the share, in mebibytes per second. This + * property is only for file shares created under Files Provisioned v2 account type. Please refer to the + * GetFileServiceUsage API response for the minimum and maximum allowed value for provisioned bandwidth. + * + * @param provisionedBandwidthMibps the provisionedBandwidthMibps value to set. + * @return the FileShareInner object itself. + */ + public FileShareInner withProvisionedBandwidthMibps(Integer provisionedBandwidthMibps) { + if (this.innerFileShareProperties() == null) { + this.innerFileShareProperties = new FileShareProperties(); + } + this.innerFileShareProperties().withProvisionedBandwidthMibps(provisionedBandwidthMibps); + return this; + } + + /** + * Get the includedBurstIops property: The calculated burst IOPS of the share. This property is only for file shares + * created under Files Provisioned v2 account type. + * + * @return the includedBurstIops value. + */ + public Integer includedBurstIops() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().includedBurstIops(); + } + + /** + * Get the maxBurstCreditsForIops property: The calculated maximum burst credits for the share. This property is + * only for file shares created under Files Provisioned v2 account type. + * + * @return the maxBurstCreditsForIops value. + */ + public Long maxBurstCreditsForIops() { + return this.innerFileShareProperties() == null + ? null + : this.innerFileShareProperties().maxBurstCreditsForIops(); + } + + /** + * Get the nextAllowedQuotaDowngradeTime property: Returns the next allowed provisioned storage size downgrade time + * for the share. This property is only for file shares created under Files Provisioned v1 SSD and Files Provisioned + * v2 account type. + * + * @return the nextAllowedQuotaDowngradeTime value. + */ + public OffsetDateTime nextAllowedQuotaDowngradeTime() { + return this.innerFileShareProperties() == null + ? null + : this.innerFileShareProperties().nextAllowedQuotaDowngradeTime(); + } + + /** + * Get the nextAllowedProvisionedIopsDowngradeTime property: Returns the next allowed provisioned IOPS downgrade + * time for the share. This property is only for file shares created under Files Provisioned v2 account type. + * + * @return the nextAllowedProvisionedIopsDowngradeTime value. + */ + public OffsetDateTime nextAllowedProvisionedIopsDowngradeTime() { + return this.innerFileShareProperties() == null + ? null + : this.innerFileShareProperties().nextAllowedProvisionedIopsDowngradeTime(); + } + + /** + * Get the nextAllowedProvisionedBandwidthDowngradeTime property: Returns the next allowed provisioned bandwidth + * downgrade time for the share. This property is only for file shares created under Files Provisioned v2 account + * type. + * + * @return the nextAllowedProvisionedBandwidthDowngradeTime value. + */ + public OffsetDateTime nextAllowedProvisionedBandwidthDowngradeTime() { + return this.innerFileShareProperties() == null + ? null + : this.innerFileShareProperties().nextAllowedProvisionedBandwidthDowngradeTime(); + } + + /** + * Get the enabledProtocols property: The authentication protocol that is used for the file share. Can only be + * specified when creating a share. + * + * @return the enabledProtocols value. + */ + public EnabledProtocols enabledProtocols() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().enabledProtocols(); + } + + /** + * Set the enabledProtocols property: The authentication protocol that is used for the file share. Can only be + * specified when creating a share. + * + * @param enabledProtocols the enabledProtocols value to set. + * @return the FileShareInner object itself. + */ + public FileShareInner withEnabledProtocols(EnabledProtocols enabledProtocols) { + if (this.innerFileShareProperties() == null) { + this.innerFileShareProperties = new FileShareProperties(); + } + this.innerFileShareProperties().withEnabledProtocols(enabledProtocols); + return this; + } + + /** + * Get the rootSquash property: The property is for NFS share only. The default is NoRootSquash. + * + * @return the rootSquash value. + */ + public RootSquashType rootSquash() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().rootSquash(); + } + + /** + * Set the rootSquash property: The property is for NFS share only. The default is NoRootSquash. + * + * @param rootSquash the rootSquash value to set. + * @return the FileShareInner object itself. + */ + public FileShareInner withRootSquash(RootSquashType rootSquash) { + if (this.innerFileShareProperties() == null) { + this.innerFileShareProperties = new FileShareProperties(); + } + this.innerFileShareProperties().withRootSquash(rootSquash); + return this; + } + + /** + * Get the version property: The version of the share. + * + * @return the version value. + */ + public String version() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().version(); + } + + /** + * Get the deleted property: Indicates whether the share was deleted. + * + * @return the deleted value. + */ + public Boolean deleted() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().deleted(); + } + + /** + * Get the deletedTime property: The deleted time if the share was deleted. + * + * @return the deletedTime value. + */ + public OffsetDateTime deletedTime() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().deletedTime(); + } + + /** + * Get the remainingRetentionDays property: Remaining retention days for share that was soft deleted. + * + * @return the remainingRetentionDays value. + */ + public Integer remainingRetentionDays() { + return this.innerFileShareProperties() == null + ? null + : this.innerFileShareProperties().remainingRetentionDays(); + } + + /** + * Get the accessTier property: Access tier for specific share. GpV2 account can choose between TransactionOptimized + * (default), Hot, and Cool. FileStorage account can choose Premium. + * + * @return the accessTier value. + */ + public ShareAccessTier accessTier() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().accessTier(); + } + + /** + * Set the accessTier property: Access tier for specific share. GpV2 account can choose between TransactionOptimized + * (default), Hot, and Cool. FileStorage account can choose Premium. + * + * @param accessTier the accessTier value to set. + * @return the FileShareInner object itself. + */ + public FileShareInner withAccessTier(ShareAccessTier accessTier) { + if (this.innerFileShareProperties() == null) { + this.innerFileShareProperties = new FileShareProperties(); + } + this.innerFileShareProperties().withAccessTier(accessTier); + return this; + } + + /** + * Get the accessTierChangeTime property: Indicates the last modification time for share access tier. + * + * @return the accessTierChangeTime value. + */ + public OffsetDateTime accessTierChangeTime() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().accessTierChangeTime(); + } + + /** + * Get the accessTierStatus property: Indicates if there is a pending transition for access tier. + * + * @return the accessTierStatus value. + */ + public String accessTierStatus() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().accessTierStatus(); + } + + /** + * Get the shareUsageBytes property: The approximate size of the data stored on the share. Note that this value may + * not include all recently created or recently resized files. + * + * @return the shareUsageBytes value. + */ + public Long shareUsageBytes() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().shareUsageBytes(); + } + + /** + * Get the leaseStatus property: The lease status of the share. + * + * @return the leaseStatus value. + */ + public LeaseStatus leaseStatus() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().leaseStatus(); + } + + /** + * Get the leaseState property: Lease state of the share. + * + * @return the leaseState value. + */ + public LeaseState leaseState() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().leaseState(); + } + + /** + * Get the leaseDuration property: Specifies whether the lease on a share is of infinite or fixed duration, only + * when the share is leased. + * + * @return the leaseDuration value. + */ + public LeaseDuration leaseDuration() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().leaseDuration(); + } + + /** + * Get the signedIdentifiers property: List of stored access policies specified on the share. + * + * @return the signedIdentifiers value. + */ + public List signedIdentifiers() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().signedIdentifiers(); + } + + /** + * Set the signedIdentifiers property: List of stored access policies specified on the share. + * + * @param signedIdentifiers the signedIdentifiers value to set. + * @return the FileShareInner object itself. + */ + public FileShareInner withSignedIdentifiers(List signedIdentifiers) { + if (this.innerFileShareProperties() == null) { + this.innerFileShareProperties = new FileShareProperties(); + } + this.innerFileShareProperties().withSignedIdentifiers(signedIdentifiers); + return this; + } + + /** + * Get the snapshotTime property: Creation time of share snapshot returned in the response of list shares with + * expand param "snapshots". + * + * @return the snapshotTime value. + */ + public OffsetDateTime snapshotTime() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().snapshotTime(); + } + + /** + * Get the fileSharePaidBursting property: File Share Paid Bursting properties. + * + * @return the fileSharePaidBursting value. + */ + public FileSharePropertiesFileSharePaidBursting fileSharePaidBursting() { + return this.innerFileShareProperties() == null ? null : this.innerFileShareProperties().fileSharePaidBursting(); + } + + /** + * Set the fileSharePaidBursting property: File Share Paid Bursting properties. + * + * @param fileSharePaidBursting the fileSharePaidBursting value to set. + * @return the FileShareInner object itself. + */ + public FileShareInner withFileSharePaidBursting(FileSharePropertiesFileSharePaidBursting fileSharePaidBursting) { + if (this.innerFileShareProperties() == null) { + this.innerFileShareProperties = new FileShareProperties(); + } + this.innerFileShareProperties().withFileSharePaidBursting(fileSharePaidBursting); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerFileShareProperties() != null) { + innerFileShareProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerFileShareProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareInner 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 FileShareInner. + */ + public static FileShareInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareInner deserializedFileShareInner = new FileShareInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFileShareInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFileShareInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFileShareInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedFileShareInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedFileShareInner.innerFileShareProperties = FileShareProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileShareItemInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileShareItemInner.java new file mode 100644 index 0000000000000..343d3ccbf1859 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileShareItemInner.java @@ -0,0 +1,557 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.storage.generated.models.AzureEntityResource; +import com.azure.resourcemanager.storage.generated.models.EnabledProtocols; +import com.azure.resourcemanager.storage.generated.models.FileSharePropertiesFileSharePaidBursting; +import com.azure.resourcemanager.storage.generated.models.LeaseDuration; +import com.azure.resourcemanager.storage.generated.models.LeaseState; +import com.azure.resourcemanager.storage.generated.models.LeaseStatus; +import com.azure.resourcemanager.storage.generated.models.RootSquashType; +import com.azure.resourcemanager.storage.generated.models.ShareAccessTier; +import com.azure.resourcemanager.storage.generated.models.SignedIdentifier; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * The file share properties be listed out. + */ +@Fluent +public final class FileShareItemInner extends AzureEntityResource { + /* + * The file share properties be listed out. + */ + private FileShareProperties innerProperties; + + /* + * Resource Etag. + */ + private String etag; + + /* + * 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 FileShareItemInner class. + */ + public FileShareItemInner() { + } + + /** + * Get the innerProperties property: The file share properties be listed out. + * + * @return the innerProperties value. + */ + private FileShareProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: Resource Etag. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + + /** + * 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; + } + + /** + * Get the lastModifiedTime property: Returns the date and time the share was last modified. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTime(); + } + + /** + * Get the metadata property: A name-value pair to associate with the share as metadata. + * + * @return the metadata value. + */ + public Map metadata() { + return this.innerProperties() == null ? null : this.innerProperties().metadata(); + } + + /** + * Set the metadata property: A name-value pair to associate with the share as metadata. + * + * @param metadata the metadata value to set. + * @return the FileShareItemInner object itself. + */ + public FileShareItemInner withMetadata(Map metadata) { + if (this.innerProperties() == null) { + this.innerProperties = new FileShareProperties(); + } + this.innerProperties().withMetadata(metadata); + return this; + } + + /** + * Get the shareQuota property: The provisioned size of the share, in gibibytes. Must be greater than 0, and less + * than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. For file shares created under + * Files Provisioned v2 account type, please refer to the GetFileServiceUsage API response for the minimum and + * maximum allowed provisioned storage size. + * + * @return the shareQuota value. + */ + public Integer shareQuota() { + return this.innerProperties() == null ? null : this.innerProperties().shareQuota(); + } + + /** + * Set the shareQuota property: The provisioned size of the share, in gibibytes. Must be greater than 0, and less + * than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. For file shares created under + * Files Provisioned v2 account type, please refer to the GetFileServiceUsage API response for the minimum and + * maximum allowed provisioned storage size. + * + * @param shareQuota the shareQuota value to set. + * @return the FileShareItemInner object itself. + */ + public FileShareItemInner withShareQuota(Integer shareQuota) { + if (this.innerProperties() == null) { + this.innerProperties = new FileShareProperties(); + } + this.innerProperties().withShareQuota(shareQuota); + return this; + } + + /** + * Get the provisionedIops property: The provisioned IOPS of the share. This property is only for file shares + * created under Files Provisioned v2 account type. Please refer to the GetFileServiceUsage API response for the + * minimum and maximum allowed value for provisioned IOPS. + * + * @return the provisionedIops value. + */ + public Integer provisionedIops() { + return this.innerProperties() == null ? null : this.innerProperties().provisionedIops(); + } + + /** + * Set the provisionedIops property: The provisioned IOPS of the share. This property is only for file shares + * created under Files Provisioned v2 account type. Please refer to the GetFileServiceUsage API response for the + * minimum and maximum allowed value for provisioned IOPS. + * + * @param provisionedIops the provisionedIops value to set. + * @return the FileShareItemInner object itself. + */ + public FileShareItemInner withProvisionedIops(Integer provisionedIops) { + if (this.innerProperties() == null) { + this.innerProperties = new FileShareProperties(); + } + this.innerProperties().withProvisionedIops(provisionedIops); + return this; + } + + /** + * Get the provisionedBandwidthMibps property: The provisioned bandwidth of the share, in mebibytes per second. This + * property is only for file shares created under Files Provisioned v2 account type. Please refer to the + * GetFileServiceUsage API response for the minimum and maximum allowed value for provisioned bandwidth. + * + * @return the provisionedBandwidthMibps value. + */ + public Integer provisionedBandwidthMibps() { + return this.innerProperties() == null ? null : this.innerProperties().provisionedBandwidthMibps(); + } + + /** + * Set the provisionedBandwidthMibps property: The provisioned bandwidth of the share, in mebibytes per second. This + * property is only for file shares created under Files Provisioned v2 account type. Please refer to the + * GetFileServiceUsage API response for the minimum and maximum allowed value for provisioned bandwidth. + * + * @param provisionedBandwidthMibps the provisionedBandwidthMibps value to set. + * @return the FileShareItemInner object itself. + */ + public FileShareItemInner withProvisionedBandwidthMibps(Integer provisionedBandwidthMibps) { + if (this.innerProperties() == null) { + this.innerProperties = new FileShareProperties(); + } + this.innerProperties().withProvisionedBandwidthMibps(provisionedBandwidthMibps); + return this; + } + + /** + * Get the includedBurstIops property: The calculated burst IOPS of the share. This property is only for file shares + * created under Files Provisioned v2 account type. + * + * @return the includedBurstIops value. + */ + public Integer includedBurstIops() { + return this.innerProperties() == null ? null : this.innerProperties().includedBurstIops(); + } + + /** + * Get the maxBurstCreditsForIops property: The calculated maximum burst credits for the share. This property is + * only for file shares created under Files Provisioned v2 account type. + * + * @return the maxBurstCreditsForIops value. + */ + public Long maxBurstCreditsForIops() { + return this.innerProperties() == null ? null : this.innerProperties().maxBurstCreditsForIops(); + } + + /** + * Get the nextAllowedQuotaDowngradeTime property: Returns the next allowed provisioned storage size downgrade time + * for the share. This property is only for file shares created under Files Provisioned v1 SSD and Files Provisioned + * v2 account type. + * + * @return the nextAllowedQuotaDowngradeTime value. + */ + public OffsetDateTime nextAllowedQuotaDowngradeTime() { + return this.innerProperties() == null ? null : this.innerProperties().nextAllowedQuotaDowngradeTime(); + } + + /** + * Get the nextAllowedProvisionedIopsDowngradeTime property: Returns the next allowed provisioned IOPS downgrade + * time for the share. This property is only for file shares created under Files Provisioned v2 account type. + * + * @return the nextAllowedProvisionedIopsDowngradeTime value. + */ + public OffsetDateTime nextAllowedProvisionedIopsDowngradeTime() { + return this.innerProperties() == null ? null : this.innerProperties().nextAllowedProvisionedIopsDowngradeTime(); + } + + /** + * Get the nextAllowedProvisionedBandwidthDowngradeTime property: Returns the next allowed provisioned bandwidth + * downgrade time for the share. This property is only for file shares created under Files Provisioned v2 account + * type. + * + * @return the nextAllowedProvisionedBandwidthDowngradeTime value. + */ + public OffsetDateTime nextAllowedProvisionedBandwidthDowngradeTime() { + return this.innerProperties() == null + ? null + : this.innerProperties().nextAllowedProvisionedBandwidthDowngradeTime(); + } + + /** + * Get the enabledProtocols property: The authentication protocol that is used for the file share. Can only be + * specified when creating a share. + * + * @return the enabledProtocols value. + */ + public EnabledProtocols enabledProtocols() { + return this.innerProperties() == null ? null : this.innerProperties().enabledProtocols(); + } + + /** + * Set the enabledProtocols property: The authentication protocol that is used for the file share. Can only be + * specified when creating a share. + * + * @param enabledProtocols the enabledProtocols value to set. + * @return the FileShareItemInner object itself. + */ + public FileShareItemInner withEnabledProtocols(EnabledProtocols enabledProtocols) { + if (this.innerProperties() == null) { + this.innerProperties = new FileShareProperties(); + } + this.innerProperties().withEnabledProtocols(enabledProtocols); + return this; + } + + /** + * Get the rootSquash property: The property is for NFS share only. The default is NoRootSquash. + * + * @return the rootSquash value. + */ + public RootSquashType rootSquash() { + return this.innerProperties() == null ? null : this.innerProperties().rootSquash(); + } + + /** + * Set the rootSquash property: The property is for NFS share only. The default is NoRootSquash. + * + * @param rootSquash the rootSquash value to set. + * @return the FileShareItemInner object itself. + */ + public FileShareItemInner withRootSquash(RootSquashType rootSquash) { + if (this.innerProperties() == null) { + this.innerProperties = new FileShareProperties(); + } + this.innerProperties().withRootSquash(rootSquash); + return this; + } + + /** + * Get the version property: The version of the share. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Get the deleted property: Indicates whether the share was deleted. + * + * @return the deleted value. + */ + public Boolean deleted() { + return this.innerProperties() == null ? null : this.innerProperties().deleted(); + } + + /** + * Get the deletedTime property: The deleted time if the share was deleted. + * + * @return the deletedTime value. + */ + public OffsetDateTime deletedTime() { + return this.innerProperties() == null ? null : this.innerProperties().deletedTime(); + } + + /** + * Get the remainingRetentionDays property: Remaining retention days for share that was soft deleted. + * + * @return the remainingRetentionDays value. + */ + public Integer remainingRetentionDays() { + return this.innerProperties() == null ? null : this.innerProperties().remainingRetentionDays(); + } + + /** + * Get the accessTier property: Access tier for specific share. GpV2 account can choose between TransactionOptimized + * (default), Hot, and Cool. FileStorage account can choose Premium. + * + * @return the accessTier value. + */ + public ShareAccessTier accessTier() { + return this.innerProperties() == null ? null : this.innerProperties().accessTier(); + } + + /** + * Set the accessTier property: Access tier for specific share. GpV2 account can choose between TransactionOptimized + * (default), Hot, and Cool. FileStorage account can choose Premium. + * + * @param accessTier the accessTier value to set. + * @return the FileShareItemInner object itself. + */ + public FileShareItemInner withAccessTier(ShareAccessTier accessTier) { + if (this.innerProperties() == null) { + this.innerProperties = new FileShareProperties(); + } + this.innerProperties().withAccessTier(accessTier); + return this; + } + + /** + * Get the accessTierChangeTime property: Indicates the last modification time for share access tier. + * + * @return the accessTierChangeTime value. + */ + public OffsetDateTime accessTierChangeTime() { + return this.innerProperties() == null ? null : this.innerProperties().accessTierChangeTime(); + } + + /** + * Get the accessTierStatus property: Indicates if there is a pending transition for access tier. + * + * @return the accessTierStatus value. + */ + public String accessTierStatus() { + return this.innerProperties() == null ? null : this.innerProperties().accessTierStatus(); + } + + /** + * Get the shareUsageBytes property: The approximate size of the data stored on the share. Note that this value may + * not include all recently created or recently resized files. + * + * @return the shareUsageBytes value. + */ + public Long shareUsageBytes() { + return this.innerProperties() == null ? null : this.innerProperties().shareUsageBytes(); + } + + /** + * Get the leaseStatus property: The lease status of the share. + * + * @return the leaseStatus value. + */ + public LeaseStatus leaseStatus() { + return this.innerProperties() == null ? null : this.innerProperties().leaseStatus(); + } + + /** + * Get the leaseState property: Lease state of the share. + * + * @return the leaseState value. + */ + public LeaseState leaseState() { + return this.innerProperties() == null ? null : this.innerProperties().leaseState(); + } + + /** + * Get the leaseDuration property: Specifies whether the lease on a share is of infinite or fixed duration, only + * when the share is leased. + * + * @return the leaseDuration value. + */ + public LeaseDuration leaseDuration() { + return this.innerProperties() == null ? null : this.innerProperties().leaseDuration(); + } + + /** + * Get the signedIdentifiers property: List of stored access policies specified on the share. + * + * @return the signedIdentifiers value. + */ + public List signedIdentifiers() { + return this.innerProperties() == null ? null : this.innerProperties().signedIdentifiers(); + } + + /** + * Set the signedIdentifiers property: List of stored access policies specified on the share. + * + * @param signedIdentifiers the signedIdentifiers value to set. + * @return the FileShareItemInner object itself. + */ + public FileShareItemInner withSignedIdentifiers(List signedIdentifiers) { + if (this.innerProperties() == null) { + this.innerProperties = new FileShareProperties(); + } + this.innerProperties().withSignedIdentifiers(signedIdentifiers); + return this; + } + + /** + * Get the snapshotTime property: Creation time of share snapshot returned in the response of list shares with + * expand param "snapshots". + * + * @return the snapshotTime value. + */ + public OffsetDateTime snapshotTime() { + return this.innerProperties() == null ? null : this.innerProperties().snapshotTime(); + } + + /** + * Get the fileSharePaidBursting property: File Share Paid Bursting properties. + * + * @return the fileSharePaidBursting value. + */ + public FileSharePropertiesFileSharePaidBursting fileSharePaidBursting() { + return this.innerProperties() == null ? null : this.innerProperties().fileSharePaidBursting(); + } + + /** + * Set the fileSharePaidBursting property: File Share Paid Bursting properties. + * + * @param fileSharePaidBursting the fileSharePaidBursting value to set. + * @return the FileShareItemInner object itself. + */ + public FileShareItemInner + withFileSharePaidBursting(FileSharePropertiesFileSharePaidBursting fileSharePaidBursting) { + if (this.innerProperties() == null) { + this.innerProperties = new FileShareProperties(); + } + this.innerProperties().withFileSharePaidBursting(fileSharePaidBursting); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareItemInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareItemInner 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 FileShareItemInner. + */ + public static FileShareItemInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareItemInner deserializedFileShareItemInner = new FileShareItemInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFileShareItemInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFileShareItemInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFileShareItemInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedFileShareItemInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedFileShareItemInner.innerProperties = FileShareProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareItemInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileShareProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileShareProperties.java new file mode 100644 index 0000000000000..1e17dca940af6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileShareProperties.java @@ -0,0 +1,663 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.storage.generated.models.EnabledProtocols; +import com.azure.resourcemanager.storage.generated.models.FileSharePropertiesFileSharePaidBursting; +import com.azure.resourcemanager.storage.generated.models.LeaseDuration; +import com.azure.resourcemanager.storage.generated.models.LeaseState; +import com.azure.resourcemanager.storage.generated.models.LeaseStatus; +import com.azure.resourcemanager.storage.generated.models.RootSquashType; +import com.azure.resourcemanager.storage.generated.models.ShareAccessTier; +import com.azure.resourcemanager.storage.generated.models.SignedIdentifier; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * The properties of the file share. + */ +@Fluent +public final class FileShareProperties implements JsonSerializable { + /* + * Returns the date and time the share was last modified. + */ + private OffsetDateTime lastModifiedTime; + + /* + * A name-value pair to associate with the share as metadata. + */ + private Map metadata; + + /* + * The provisioned size of the share, in gibibytes. Must be greater than 0, and less than or equal to 5TB (5120). + * For Large File Shares, the maximum size is 102400. For file shares created under Files Provisioned v2 account + * type, please refer to the GetFileServiceUsage API response for the minimum and maximum allowed provisioned + * storage size. + */ + private Integer shareQuota; + + /* + * The provisioned IOPS of the share. This property is only for file shares created under Files Provisioned v2 + * account type. Please refer to the GetFileServiceUsage API response for the minimum and maximum allowed value for + * provisioned IOPS. + */ + private Integer provisionedIops; + + /* + * The provisioned bandwidth of the share, in mebibytes per second. This property is only for file shares created + * under Files Provisioned v2 account type. Please refer to the GetFileServiceUsage API response for the minimum and + * maximum allowed value for provisioned bandwidth. + */ + private Integer provisionedBandwidthMibps; + + /* + * The calculated burst IOPS of the share. This property is only for file shares created under Files Provisioned v2 + * account type. + */ + private Integer includedBurstIops; + + /* + * The calculated maximum burst credits for the share. This property is only for file shares created under Files + * Provisioned v2 account type. + */ + private Long maxBurstCreditsForIops; + + /* + * Returns the next allowed provisioned storage size downgrade time for the share. This property is only for file + * shares created under Files Provisioned v1 SSD and Files Provisioned v2 account type + */ + private OffsetDateTime nextAllowedQuotaDowngradeTime; + + /* + * Returns the next allowed provisioned IOPS downgrade time for the share. This property is only for file shares + * created under Files Provisioned v2 account type. + */ + private OffsetDateTime nextAllowedProvisionedIopsDowngradeTime; + + /* + * Returns the next allowed provisioned bandwidth downgrade time for the share. This property is only for file + * shares created under Files Provisioned v2 account type. + */ + private OffsetDateTime nextAllowedProvisionedBandwidthDowngradeTime; + + /* + * The authentication protocol that is used for the file share. Can only be specified when creating a share. + */ + private EnabledProtocols enabledProtocols; + + /* + * The property is for NFS share only. The default is NoRootSquash. + */ + private RootSquashType rootSquash; + + /* + * The version of the share. + */ + private String version; + + /* + * Indicates whether the share was deleted. + */ + private Boolean deleted; + + /* + * The deleted time if the share was deleted. + */ + private OffsetDateTime deletedTime; + + /* + * Remaining retention days for share that was soft deleted. + */ + private Integer remainingRetentionDays; + + /* + * Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. + * FileStorage account can choose Premium. + */ + private ShareAccessTier accessTier; + + /* + * Indicates the last modification time for share access tier. + */ + private OffsetDateTime accessTierChangeTime; + + /* + * Indicates if there is a pending transition for access tier. + */ + private String accessTierStatus; + + /* + * The approximate size of the data stored on the share. Note that this value may not include all recently created + * or recently resized files. + */ + private Long shareUsageBytes; + + /* + * The lease status of the share. + */ + private LeaseStatus leaseStatus; + + /* + * Lease state of the share. + */ + private LeaseState leaseState; + + /* + * Specifies whether the lease on a share is of infinite or fixed duration, only when the share is leased. + */ + private LeaseDuration leaseDuration; + + /* + * List of stored access policies specified on the share. + */ + private List signedIdentifiers; + + /* + * Creation time of share snapshot returned in the response of list shares with expand param "snapshots". + */ + private OffsetDateTime snapshotTime; + + /* + * File Share Paid Bursting properties. + */ + private FileSharePropertiesFileSharePaidBursting fileSharePaidBursting; + + /** + * Creates an instance of FileShareProperties class. + */ + public FileShareProperties() { + } + + /** + * Get the lastModifiedTime property: Returns the date and time the share was last modified. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the metadata property: A name-value pair to associate with the share as metadata. + * + * @return the metadata value. + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set the metadata property: A name-value pair to associate with the share as metadata. + * + * @param metadata the metadata value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the shareQuota property: The provisioned size of the share, in gibibytes. Must be greater than 0, and less + * than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. For file shares created under + * Files Provisioned v2 account type, please refer to the GetFileServiceUsage API response for the minimum and + * maximum allowed provisioned storage size. + * + * @return the shareQuota value. + */ + public Integer shareQuota() { + return this.shareQuota; + } + + /** + * Set the shareQuota property: The provisioned size of the share, in gibibytes. Must be greater than 0, and less + * than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. For file shares created under + * Files Provisioned v2 account type, please refer to the GetFileServiceUsage API response for the minimum and + * maximum allowed provisioned storage size. + * + * @param shareQuota the shareQuota value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties withShareQuota(Integer shareQuota) { + this.shareQuota = shareQuota; + return this; + } + + /** + * Get the provisionedIops property: The provisioned IOPS of the share. This property is only for file shares + * created under Files Provisioned v2 account type. Please refer to the GetFileServiceUsage API response for the + * minimum and maximum allowed value for provisioned IOPS. + * + * @return the provisionedIops value. + */ + public Integer provisionedIops() { + return this.provisionedIops; + } + + /** + * Set the provisionedIops property: The provisioned IOPS of the share. This property is only for file shares + * created under Files Provisioned v2 account type. Please refer to the GetFileServiceUsage API response for the + * minimum and maximum allowed value for provisioned IOPS. + * + * @param provisionedIops the provisionedIops value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties withProvisionedIops(Integer provisionedIops) { + this.provisionedIops = provisionedIops; + return this; + } + + /** + * Get the provisionedBandwidthMibps property: The provisioned bandwidth of the share, in mebibytes per second. This + * property is only for file shares created under Files Provisioned v2 account type. Please refer to the + * GetFileServiceUsage API response for the minimum and maximum allowed value for provisioned bandwidth. + * + * @return the provisionedBandwidthMibps value. + */ + public Integer provisionedBandwidthMibps() { + return this.provisionedBandwidthMibps; + } + + /** + * Set the provisionedBandwidthMibps property: The provisioned bandwidth of the share, in mebibytes per second. This + * property is only for file shares created under Files Provisioned v2 account type. Please refer to the + * GetFileServiceUsage API response for the minimum and maximum allowed value for provisioned bandwidth. + * + * @param provisionedBandwidthMibps the provisionedBandwidthMibps value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties withProvisionedBandwidthMibps(Integer provisionedBandwidthMibps) { + this.provisionedBandwidthMibps = provisionedBandwidthMibps; + return this; + } + + /** + * Get the includedBurstIops property: The calculated burst IOPS of the share. This property is only for file shares + * created under Files Provisioned v2 account type. + * + * @return the includedBurstIops value. + */ + public Integer includedBurstIops() { + return this.includedBurstIops; + } + + /** + * Get the maxBurstCreditsForIops property: The calculated maximum burst credits for the share. This property is + * only for file shares created under Files Provisioned v2 account type. + * + * @return the maxBurstCreditsForIops value. + */ + public Long maxBurstCreditsForIops() { + return this.maxBurstCreditsForIops; + } + + /** + * Get the nextAllowedQuotaDowngradeTime property: Returns the next allowed provisioned storage size downgrade time + * for the share. This property is only for file shares created under Files Provisioned v1 SSD and Files Provisioned + * v2 account type. + * + * @return the nextAllowedQuotaDowngradeTime value. + */ + public OffsetDateTime nextAllowedQuotaDowngradeTime() { + return this.nextAllowedQuotaDowngradeTime; + } + + /** + * Get the nextAllowedProvisionedIopsDowngradeTime property: Returns the next allowed provisioned IOPS downgrade + * time for the share. This property is only for file shares created under Files Provisioned v2 account type. + * + * @return the nextAllowedProvisionedIopsDowngradeTime value. + */ + public OffsetDateTime nextAllowedProvisionedIopsDowngradeTime() { + return this.nextAllowedProvisionedIopsDowngradeTime; + } + + /** + * Get the nextAllowedProvisionedBandwidthDowngradeTime property: Returns the next allowed provisioned bandwidth + * downgrade time for the share. This property is only for file shares created under Files Provisioned v2 account + * type. + * + * @return the nextAllowedProvisionedBandwidthDowngradeTime value. + */ + public OffsetDateTime nextAllowedProvisionedBandwidthDowngradeTime() { + return this.nextAllowedProvisionedBandwidthDowngradeTime; + } + + /** + * Get the enabledProtocols property: The authentication protocol that is used for the file share. Can only be + * specified when creating a share. + * + * @return the enabledProtocols value. + */ + public EnabledProtocols enabledProtocols() { + return this.enabledProtocols; + } + + /** + * Set the enabledProtocols property: The authentication protocol that is used for the file share. Can only be + * specified when creating a share. + * + * @param enabledProtocols the enabledProtocols value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties withEnabledProtocols(EnabledProtocols enabledProtocols) { + this.enabledProtocols = enabledProtocols; + return this; + } + + /** + * Get the rootSquash property: The property is for NFS share only. The default is NoRootSquash. + * + * @return the rootSquash value. + */ + public RootSquashType rootSquash() { + return this.rootSquash; + } + + /** + * Set the rootSquash property: The property is for NFS share only. The default is NoRootSquash. + * + * @param rootSquash the rootSquash value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties withRootSquash(RootSquashType rootSquash) { + this.rootSquash = rootSquash; + return this; + } + + /** + * Get the version property: The version of the share. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the deleted property: Indicates whether the share was deleted. + * + * @return the deleted value. + */ + public Boolean deleted() { + return this.deleted; + } + + /** + * Get the deletedTime property: The deleted time if the share was deleted. + * + * @return the deletedTime value. + */ + public OffsetDateTime deletedTime() { + return this.deletedTime; + } + + /** + * Get the remainingRetentionDays property: Remaining retention days for share that was soft deleted. + * + * @return the remainingRetentionDays value. + */ + public Integer remainingRetentionDays() { + return this.remainingRetentionDays; + } + + /** + * Get the accessTier property: Access tier for specific share. GpV2 account can choose between TransactionOptimized + * (default), Hot, and Cool. FileStorage account can choose Premium. + * + * @return the accessTier value. + */ + public ShareAccessTier accessTier() { + return this.accessTier; + } + + /** + * Set the accessTier property: Access tier for specific share. GpV2 account can choose between TransactionOptimized + * (default), Hot, and Cool. FileStorage account can choose Premium. + * + * @param accessTier the accessTier value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties withAccessTier(ShareAccessTier accessTier) { + this.accessTier = accessTier; + return this; + } + + /** + * Get the accessTierChangeTime property: Indicates the last modification time for share access tier. + * + * @return the accessTierChangeTime value. + */ + public OffsetDateTime accessTierChangeTime() { + return this.accessTierChangeTime; + } + + /** + * Get the accessTierStatus property: Indicates if there is a pending transition for access tier. + * + * @return the accessTierStatus value. + */ + public String accessTierStatus() { + return this.accessTierStatus; + } + + /** + * Get the shareUsageBytes property: The approximate size of the data stored on the share. Note that this value may + * not include all recently created or recently resized files. + * + * @return the shareUsageBytes value. + */ + public Long shareUsageBytes() { + return this.shareUsageBytes; + } + + /** + * Get the leaseStatus property: The lease status of the share. + * + * @return the leaseStatus value. + */ + public LeaseStatus leaseStatus() { + return this.leaseStatus; + } + + /** + * Get the leaseState property: Lease state of the share. + * + * @return the leaseState value. + */ + public LeaseState leaseState() { + return this.leaseState; + } + + /** + * Get the leaseDuration property: Specifies whether the lease on a share is of infinite or fixed duration, only + * when the share is leased. + * + * @return the leaseDuration value. + */ + public LeaseDuration leaseDuration() { + return this.leaseDuration; + } + + /** + * Get the signedIdentifiers property: List of stored access policies specified on the share. + * + * @return the signedIdentifiers value. + */ + public List signedIdentifiers() { + return this.signedIdentifiers; + } + + /** + * Set the signedIdentifiers property: List of stored access policies specified on the share. + * + * @param signedIdentifiers the signedIdentifiers value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties withSignedIdentifiers(List signedIdentifiers) { + this.signedIdentifiers = signedIdentifiers; + return this; + } + + /** + * Get the snapshotTime property: Creation time of share snapshot returned in the response of list shares with + * expand param "snapshots". + * + * @return the snapshotTime value. + */ + public OffsetDateTime snapshotTime() { + return this.snapshotTime; + } + + /** + * Get the fileSharePaidBursting property: File Share Paid Bursting properties. + * + * @return the fileSharePaidBursting value. + */ + public FileSharePropertiesFileSharePaidBursting fileSharePaidBursting() { + return this.fileSharePaidBursting; + } + + /** + * Set the fileSharePaidBursting property: File Share Paid Bursting properties. + * + * @param fileSharePaidBursting the fileSharePaidBursting value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties + withFileSharePaidBursting(FileSharePropertiesFileSharePaidBursting fileSharePaidBursting) { + this.fileSharePaidBursting = fileSharePaidBursting; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (signedIdentifiers() != null) { + signedIdentifiers().forEach(e -> e.validate()); + } + if (fileSharePaidBursting() != null) { + fileSharePaidBursting().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + jsonWriter.writeNumberField("shareQuota", this.shareQuota); + jsonWriter.writeNumberField("provisionedIops", this.provisionedIops); + jsonWriter.writeNumberField("provisionedBandwidthMibps", this.provisionedBandwidthMibps); + jsonWriter.writeStringField("enabledProtocols", + this.enabledProtocols == null ? null : this.enabledProtocols.toString()); + jsonWriter.writeStringField("rootSquash", this.rootSquash == null ? null : this.rootSquash.toString()); + jsonWriter.writeStringField("accessTier", this.accessTier == null ? null : this.accessTier.toString()); + jsonWriter.writeArrayField("signedIdentifiers", this.signedIdentifiers, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("fileSharePaidBursting", this.fileSharePaidBursting); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareProperties 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 FileShareProperties. + */ + public static FileShareProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareProperties deserializedFileShareProperties = new FileShareProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("lastModifiedTime".equals(fieldName)) { + deserializedFileShareProperties.lastModifiedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedFileShareProperties.metadata = metadata; + } else if ("shareQuota".equals(fieldName)) { + deserializedFileShareProperties.shareQuota = reader.getNullable(JsonReader::getInt); + } else if ("provisionedIops".equals(fieldName)) { + deserializedFileShareProperties.provisionedIops = reader.getNullable(JsonReader::getInt); + } else if ("provisionedBandwidthMibps".equals(fieldName)) { + deserializedFileShareProperties.provisionedBandwidthMibps = reader.getNullable(JsonReader::getInt); + } else if ("includedBurstIops".equals(fieldName)) { + deserializedFileShareProperties.includedBurstIops = reader.getNullable(JsonReader::getInt); + } else if ("maxBurstCreditsForIops".equals(fieldName)) { + deserializedFileShareProperties.maxBurstCreditsForIops = reader.getNullable(JsonReader::getLong); + } else if ("nextAllowedQuotaDowngradeTime".equals(fieldName)) { + deserializedFileShareProperties.nextAllowedQuotaDowngradeTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("nextAllowedProvisionedIopsDowngradeTime".equals(fieldName)) { + deserializedFileShareProperties.nextAllowedProvisionedIopsDowngradeTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("nextAllowedProvisionedBandwidthDowngradeTime".equals(fieldName)) { + deserializedFileShareProperties.nextAllowedProvisionedBandwidthDowngradeTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("enabledProtocols".equals(fieldName)) { + deserializedFileShareProperties.enabledProtocols = EnabledProtocols.fromString(reader.getString()); + } else if ("rootSquash".equals(fieldName)) { + deserializedFileShareProperties.rootSquash = RootSquashType.fromString(reader.getString()); + } else if ("version".equals(fieldName)) { + deserializedFileShareProperties.version = reader.getString(); + } else if ("deleted".equals(fieldName)) { + deserializedFileShareProperties.deleted = reader.getNullable(JsonReader::getBoolean); + } else if ("deletedTime".equals(fieldName)) { + deserializedFileShareProperties.deletedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("remainingRetentionDays".equals(fieldName)) { + deserializedFileShareProperties.remainingRetentionDays = reader.getNullable(JsonReader::getInt); + } else if ("accessTier".equals(fieldName)) { + deserializedFileShareProperties.accessTier = ShareAccessTier.fromString(reader.getString()); + } else if ("accessTierChangeTime".equals(fieldName)) { + deserializedFileShareProperties.accessTierChangeTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("accessTierStatus".equals(fieldName)) { + deserializedFileShareProperties.accessTierStatus = reader.getString(); + } else if ("shareUsageBytes".equals(fieldName)) { + deserializedFileShareProperties.shareUsageBytes = reader.getNullable(JsonReader::getLong); + } else if ("leaseStatus".equals(fieldName)) { + deserializedFileShareProperties.leaseStatus = LeaseStatus.fromString(reader.getString()); + } else if ("leaseState".equals(fieldName)) { + deserializedFileShareProperties.leaseState = LeaseState.fromString(reader.getString()); + } else if ("leaseDuration".equals(fieldName)) { + deserializedFileShareProperties.leaseDuration = LeaseDuration.fromString(reader.getString()); + } else if ("signedIdentifiers".equals(fieldName)) { + List signedIdentifiers + = reader.readArray(reader1 -> SignedIdentifier.fromJson(reader1)); + deserializedFileShareProperties.signedIdentifiers = signedIdentifiers; + } else if ("snapshotTime".equals(fieldName)) { + deserializedFileShareProperties.snapshotTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("fileSharePaidBursting".equals(fieldName)) { + deserializedFileShareProperties.fileSharePaidBursting + = FileSharePropertiesFileSharePaidBursting.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ImmutabilityPolicyInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ImmutabilityPolicyInner.java new file mode 100644 index 0000000000000..936697c49c017 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ImmutabilityPolicyInner.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.storage.generated.models.AzureEntityResource; +import com.azure.resourcemanager.storage.generated.models.ImmutabilityPolicyState; +import java.io.IOException; + +/** + * The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ +@Fluent +public final class ImmutabilityPolicyInner extends AzureEntityResource { + /* + * The properties of an ImmutabilityPolicy of a blob container. + */ + private ImmutabilityPolicyProperty innerProperties = new ImmutabilityPolicyProperty(); + + /* + * Resource Etag. + */ + private String etag; + + /* + * 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 ImmutabilityPolicyInner class. + */ + public ImmutabilityPolicyInner() { + } + + /** + * Get the innerProperties property: The properties of an ImmutabilityPolicy of a blob container. + * + * @return the innerProperties value. + */ + private ImmutabilityPolicyProperty innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: Resource Etag. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + + /** + * 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; + } + + /** + * Get the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container + * since the policy creation, in days. + * + * @return the immutabilityPeriodSinceCreationInDays value. + */ + public Integer immutabilityPeriodSinceCreationInDays() { + return this.innerProperties() == null ? null : this.innerProperties().immutabilityPeriodSinceCreationInDays(); + } + + /** + * Set the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container + * since the policy creation, in days. + * + * @param immutabilityPeriodSinceCreationInDays the immutabilityPeriodSinceCreationInDays value to set. + * @return the ImmutabilityPolicyInner object itself. + */ + public ImmutabilityPolicyInner + withImmutabilityPeriodSinceCreationInDays(Integer immutabilityPeriodSinceCreationInDays) { + if (this.innerProperties() == null) { + this.innerProperties = new ImmutabilityPolicyProperty(); + } + this.innerProperties().withImmutabilityPeriodSinceCreationInDays(immutabilityPeriodSinceCreationInDays); + return this; + } + + /** + * Get the state property: The ImmutabilityPolicy state of a blob container, possible values include: Locked and + * Unlocked. + * + * @return the state value. + */ + public ImmutabilityPolicyState state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Get the allowProtectedAppendWrites property: This property can only be changed for unlocked time-based retention + * policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and + * compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property + * cannot be changed with ExtendImmutabilityPolicy API. + * + * @return the allowProtectedAppendWrites value. + */ + public Boolean allowProtectedAppendWrites() { + return this.innerProperties() == null ? null : this.innerProperties().allowProtectedAppendWrites(); + } + + /** + * Set the allowProtectedAppendWrites property: This property can only be changed for unlocked time-based retention + * policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and + * compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property + * cannot be changed with ExtendImmutabilityPolicy API. + * + * @param allowProtectedAppendWrites the allowProtectedAppendWrites value to set. + * @return the ImmutabilityPolicyInner object itself. + */ + public ImmutabilityPolicyInner withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites) { + if (this.innerProperties() == null) { + this.innerProperties = new ImmutabilityPolicyProperty(); + } + this.innerProperties().withAllowProtectedAppendWrites(allowProtectedAppendWrites); + return this; + } + + /** + * Get the allowProtectedAppendWritesAll property: This property can only be changed for unlocked time-based + * retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining + * immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified + * or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' + * and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + * + * @return the allowProtectedAppendWritesAll value. + */ + public Boolean allowProtectedAppendWritesAll() { + return this.innerProperties() == null ? null : this.innerProperties().allowProtectedAppendWritesAll(); + } + + /** + * Set the allowProtectedAppendWritesAll property: This property can only be changed for unlocked time-based + * retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining + * immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified + * or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' + * and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + * + * @param allowProtectedAppendWritesAll the allowProtectedAppendWritesAll value to set. + * @return the ImmutabilityPolicyInner object itself. + */ + public ImmutabilityPolicyInner withAllowProtectedAppendWritesAll(Boolean allowProtectedAppendWritesAll) { + if (this.innerProperties() == null) { + this.innerProperties = new ImmutabilityPolicyProperty(); + } + this.innerProperties().withAllowProtectedAppendWritesAll(allowProtectedAppendWritesAll); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model ImmutabilityPolicyInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ImmutabilityPolicyInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImmutabilityPolicyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImmutabilityPolicyInner 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 ImmutabilityPolicyInner. + */ + public static ImmutabilityPolicyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImmutabilityPolicyInner deserializedImmutabilityPolicyInner = new ImmutabilityPolicyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedImmutabilityPolicyInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedImmutabilityPolicyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedImmutabilityPolicyInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedImmutabilityPolicyInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedImmutabilityPolicyInner.innerProperties = ImmutabilityPolicyProperty.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedImmutabilityPolicyInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ImmutabilityPolicyProperty.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ImmutabilityPolicyProperty.java new file mode 100644 index 0000000000000..3597f11b2c1f6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ImmutabilityPolicyProperty.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.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 com.azure.resourcemanager.storage.generated.models.ImmutabilityPolicyState; +import java.io.IOException; + +/** + * The properties of an ImmutabilityPolicy of a blob container. + */ +@Fluent +public final class ImmutabilityPolicyProperty implements JsonSerializable { + /* + * The immutability period for the blobs in the container since the policy creation, in days. + */ + private Integer immutabilityPeriodSinceCreationInDays; + + /* + * The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. + */ + private ImmutabilityPolicyState state; + + /* + * This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be + * written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added + * and any existing blocks cannot be modified or deleted. This property cannot be changed with + * ExtendImmutabilityPolicy API. + */ + private Boolean allowProtectedAppendWrites; + + /* + * This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be + * written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks + * can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with + * ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are + * mutually exclusive. + */ + private Boolean allowProtectedAppendWritesAll; + + /** + * Creates an instance of ImmutabilityPolicyProperty class. + */ + public ImmutabilityPolicyProperty() { + } + + /** + * Get the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container + * since the policy creation, in days. + * + * @return the immutabilityPeriodSinceCreationInDays value. + */ + public Integer immutabilityPeriodSinceCreationInDays() { + return this.immutabilityPeriodSinceCreationInDays; + } + + /** + * Set the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container + * since the policy creation, in days. + * + * @param immutabilityPeriodSinceCreationInDays the immutabilityPeriodSinceCreationInDays value to set. + * @return the ImmutabilityPolicyProperty object itself. + */ + public ImmutabilityPolicyProperty + withImmutabilityPeriodSinceCreationInDays(Integer immutabilityPeriodSinceCreationInDays) { + this.immutabilityPeriodSinceCreationInDays = immutabilityPeriodSinceCreationInDays; + return this; + } + + /** + * Get the state property: The ImmutabilityPolicy state of a blob container, possible values include: Locked and + * Unlocked. + * + * @return the state value. + */ + public ImmutabilityPolicyState state() { + return this.state; + } + + /** + * Get the allowProtectedAppendWrites property: This property can only be changed for unlocked time-based retention + * policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and + * compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property + * cannot be changed with ExtendImmutabilityPolicy API. + * + * @return the allowProtectedAppendWrites value. + */ + public Boolean allowProtectedAppendWrites() { + return this.allowProtectedAppendWrites; + } + + /** + * Set the allowProtectedAppendWrites property: This property can only be changed for unlocked time-based retention + * policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and + * compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property + * cannot be changed with ExtendImmutabilityPolicy API. + * + * @param allowProtectedAppendWrites the allowProtectedAppendWrites value to set. + * @return the ImmutabilityPolicyProperty object itself. + */ + public ImmutabilityPolicyProperty withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites) { + this.allowProtectedAppendWrites = allowProtectedAppendWrites; + return this; + } + + /** + * Get the allowProtectedAppendWritesAll property: This property can only be changed for unlocked time-based + * retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining + * immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified + * or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' + * and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + * + * @return the allowProtectedAppendWritesAll value. + */ + public Boolean allowProtectedAppendWritesAll() { + return this.allowProtectedAppendWritesAll; + } + + /** + * Set the allowProtectedAppendWritesAll property: This property can only be changed for unlocked time-based + * retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining + * immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified + * or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' + * and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + * + * @param allowProtectedAppendWritesAll the allowProtectedAppendWritesAll value to set. + * @return the ImmutabilityPolicyProperty object itself. + */ + public ImmutabilityPolicyProperty withAllowProtectedAppendWritesAll(Boolean allowProtectedAppendWritesAll) { + this.allowProtectedAppendWritesAll = allowProtectedAppendWritesAll; + 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.writeNumberField("immutabilityPeriodSinceCreationInDays", + this.immutabilityPeriodSinceCreationInDays); + jsonWriter.writeBooleanField("allowProtectedAppendWrites", this.allowProtectedAppendWrites); + jsonWriter.writeBooleanField("allowProtectedAppendWritesAll", this.allowProtectedAppendWritesAll); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImmutabilityPolicyProperty from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImmutabilityPolicyProperty 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 ImmutabilityPolicyProperty. + */ + public static ImmutabilityPolicyProperty fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImmutabilityPolicyProperty deserializedImmutabilityPolicyProperty = new ImmutabilityPolicyProperty(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("immutabilityPeriodSinceCreationInDays".equals(fieldName)) { + deserializedImmutabilityPolicyProperty.immutabilityPeriodSinceCreationInDays + = reader.getNullable(JsonReader::getInt); + } else if ("state".equals(fieldName)) { + deserializedImmutabilityPolicyProperty.state + = ImmutabilityPolicyState.fromString(reader.getString()); + } else if ("allowProtectedAppendWrites".equals(fieldName)) { + deserializedImmutabilityPolicyProperty.allowProtectedAppendWrites + = reader.getNullable(JsonReader::getBoolean); + } else if ("allowProtectedAppendWritesAll".equals(fieldName)) { + deserializedImmutabilityPolicyProperty.allowProtectedAppendWritesAll + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedImmutabilityPolicyProperty; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LeaseContainerResponseInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LeaseContainerResponseInner.java new file mode 100644 index 0000000000000..54779be061a44 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LeaseContainerResponseInner.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.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; + +/** + * Lease Container response schema. + */ +@Fluent +public final class LeaseContainerResponseInner implements JsonSerializable { + /* + * Returned unique lease ID that must be included with any request to delete the container, or to renew, change, or + * release the lease. + */ + private String leaseId; + + /* + * Approximate time remaining in the lease period, in seconds. + */ + private String leaseTimeSeconds; + + /** + * Creates an instance of LeaseContainerResponseInner class. + */ + public LeaseContainerResponseInner() { + } + + /** + * Get the leaseId property: Returned unique lease ID that must be included with any request to delete the + * container, or to renew, change, or release the lease. + * + * @return the leaseId value. + */ + public String leaseId() { + return this.leaseId; + } + + /** + * Set the leaseId property: Returned unique lease ID that must be included with any request to delete the + * container, or to renew, change, or release the lease. + * + * @param leaseId the leaseId value to set. + * @return the LeaseContainerResponseInner object itself. + */ + public LeaseContainerResponseInner withLeaseId(String leaseId) { + this.leaseId = leaseId; + return this; + } + + /** + * Get the leaseTimeSeconds property: Approximate time remaining in the lease period, in seconds. + * + * @return the leaseTimeSeconds value. + */ + public String leaseTimeSeconds() { + return this.leaseTimeSeconds; + } + + /** + * Set the leaseTimeSeconds property: Approximate time remaining in the lease period, in seconds. + * + * @param leaseTimeSeconds the leaseTimeSeconds value to set. + * @return the LeaseContainerResponseInner object itself. + */ + public LeaseContainerResponseInner withLeaseTimeSeconds(String leaseTimeSeconds) { + this.leaseTimeSeconds = leaseTimeSeconds; + 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("leaseId", this.leaseId); + jsonWriter.writeStringField("leaseTimeSeconds", this.leaseTimeSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LeaseContainerResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LeaseContainerResponseInner 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 LeaseContainerResponseInner. + */ + public static LeaseContainerResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LeaseContainerResponseInner deserializedLeaseContainerResponseInner = new LeaseContainerResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("leaseId".equals(fieldName)) { + deserializedLeaseContainerResponseInner.leaseId = reader.getString(); + } else if ("leaseTimeSeconds".equals(fieldName)) { + deserializedLeaseContainerResponseInner.leaseTimeSeconds = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLeaseContainerResponseInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LeaseShareResponseInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LeaseShareResponseInner.java new file mode 100644 index 0000000000000..5870bfc3d33c1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LeaseShareResponseInner.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.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; + +/** + * Lease Share response schema. + */ +@Fluent +public final class LeaseShareResponseInner implements JsonSerializable { + /* + * Returned unique lease ID that must be included with any request to delete the share, or to renew, change, or + * release the lease. + */ + private String leaseId; + + /* + * Approximate time remaining in the lease period, in seconds. + */ + private String leaseTimeSeconds; + + /** + * Creates an instance of LeaseShareResponseInner class. + */ + public LeaseShareResponseInner() { + } + + /** + * Get the leaseId property: Returned unique lease ID that must be included with any request to delete the share, or + * to renew, change, or release the lease. + * + * @return the leaseId value. + */ + public String leaseId() { + return this.leaseId; + } + + /** + * Set the leaseId property: Returned unique lease ID that must be included with any request to delete the share, or + * to renew, change, or release the lease. + * + * @param leaseId the leaseId value to set. + * @return the LeaseShareResponseInner object itself. + */ + public LeaseShareResponseInner withLeaseId(String leaseId) { + this.leaseId = leaseId; + return this; + } + + /** + * Get the leaseTimeSeconds property: Approximate time remaining in the lease period, in seconds. + * + * @return the leaseTimeSeconds value. + */ + public String leaseTimeSeconds() { + return this.leaseTimeSeconds; + } + + /** + * Set the leaseTimeSeconds property: Approximate time remaining in the lease period, in seconds. + * + * @param leaseTimeSeconds the leaseTimeSeconds value to set. + * @return the LeaseShareResponseInner object itself. + */ + public LeaseShareResponseInner withLeaseTimeSeconds(String leaseTimeSeconds) { + this.leaseTimeSeconds = leaseTimeSeconds; + 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("leaseId", this.leaseId); + jsonWriter.writeStringField("leaseTimeSeconds", this.leaseTimeSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LeaseShareResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LeaseShareResponseInner 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 LeaseShareResponseInner. + */ + public static LeaseShareResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LeaseShareResponseInner deserializedLeaseShareResponseInner = new LeaseShareResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("leaseId".equals(fieldName)) { + deserializedLeaseShareResponseInner.leaseId = reader.getString(); + } else if ("leaseTimeSeconds".equals(fieldName)) { + deserializedLeaseShareResponseInner.leaseTimeSeconds = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLeaseShareResponseInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LegalHoldInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LegalHoldInner.java new file mode 100644 index 0000000000000..6f939fde5c3b5 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LegalHoldInner.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.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.List; + +/** + * The LegalHold property of a blob container. + */ +@Fluent +public final class LegalHoldInner implements JsonSerializable { + /* + * The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold + * public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of + * 1000 blob containers with hasLegalHold=true for a given account. + */ + private Boolean hasLegalHold; + + /* + * Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + */ + private List tags; + + /* + * When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection + * and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. + */ + private Boolean allowProtectedAppendWritesAll; + + /** + * Creates an instance of LegalHoldInner class. + */ + public LegalHoldInner() { + } + + /** + * Get the hasLegalHold property: The hasLegalHold public property is set to true by SRP if there are at least one + * existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared + * out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. + * + * @return the hasLegalHold value. + */ + public Boolean hasLegalHold() { + return this.hasLegalHold; + } + + /** + * Get the tags property: Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + * + * @param tags the tags value to set. + * @return the LegalHoldInner object itself. + */ + public LegalHoldInner withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the allowProtectedAppendWritesAll property: When enabled, new blocks can be written to both 'Append and Bock + * Blobs' while maintaining legal hold protection and compliance. Only new blocks can be added and any existing + * blocks cannot be modified or deleted. + * + * @return the allowProtectedAppendWritesAll value. + */ + public Boolean allowProtectedAppendWritesAll() { + return this.allowProtectedAppendWritesAll; + } + + /** + * Set the allowProtectedAppendWritesAll property: When enabled, new blocks can be written to both 'Append and Bock + * Blobs' while maintaining legal hold protection and compliance. Only new blocks can be added and any existing + * blocks cannot be modified or deleted. + * + * @param allowProtectedAppendWritesAll the allowProtectedAppendWritesAll value to set. + * @return the LegalHoldInner object itself. + */ + public LegalHoldInner withAllowProtectedAppendWritesAll(Boolean allowProtectedAppendWritesAll) { + this.allowProtectedAppendWritesAll = allowProtectedAppendWritesAll; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tags() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property tags in model LegalHoldInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LegalHoldInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("allowProtectedAppendWritesAll", this.allowProtectedAppendWritesAll); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LegalHoldInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LegalHoldInner 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 LegalHoldInner. + */ + public static LegalHoldInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LegalHoldInner deserializedLegalHoldInner = new LegalHoldInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> reader1.getString()); + deserializedLegalHoldInner.tags = tags; + } else if ("hasLegalHold".equals(fieldName)) { + deserializedLegalHoldInner.hasLegalHold = reader.getNullable(JsonReader::getBoolean); + } else if ("allowProtectedAppendWritesAll".equals(fieldName)) { + deserializedLegalHoldInner.allowProtectedAppendWritesAll + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedLegalHoldInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListAccountSasResponseInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListAccountSasResponseInner.java new file mode 100644 index 0000000000000..0096e454c2785 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListAccountSasResponseInner.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 java.io.IOException; + +/** + * The List SAS credentials operation response. + */ +@Immutable +public final class ListAccountSasResponseInner implements JsonSerializable { + /* + * List SAS credentials of storage account. + */ + private String accountSasToken; + + /** + * Creates an instance of ListAccountSasResponseInner class. + */ + public ListAccountSasResponseInner() { + } + + /** + * Get the accountSasToken property: List SAS credentials of storage account. + * + * @return the accountSasToken value. + */ + public String accountSasToken() { + return this.accountSasToken; + } + + /** + * 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 ListAccountSasResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListAccountSasResponseInner 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 ListAccountSasResponseInner. + */ + public static ListAccountSasResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListAccountSasResponseInner deserializedListAccountSasResponseInner = new ListAccountSasResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accountSasToken".equals(fieldName)) { + deserializedListAccountSasResponseInner.accountSasToken = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListAccountSasResponseInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListContainerItemInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListContainerItemInner.java new file mode 100644 index 0000000000000..16ec54c977ddb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListContainerItemInner.java @@ -0,0 +1,445 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.storage.generated.models.AzureEntityResource; +import com.azure.resourcemanager.storage.generated.models.ImmutabilityPolicyProperties; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageWithVersioning; +import com.azure.resourcemanager.storage.generated.models.LeaseDuration; +import com.azure.resourcemanager.storage.generated.models.LeaseState; +import com.azure.resourcemanager.storage.generated.models.LeaseStatus; +import com.azure.resourcemanager.storage.generated.models.LegalHoldProperties; +import com.azure.resourcemanager.storage.generated.models.PublicAccess; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Map; + +/** + * The blob container properties be listed out. + */ +@Fluent +public final class ListContainerItemInner extends AzureEntityResource { + /* + * The blob container properties be listed out. + */ + private ContainerProperties innerProperties; + + /* + * Resource Etag. + */ + private String etag; + + /* + * 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 ListContainerItemInner class. + */ + public ListContainerItemInner() { + } + + /** + * Get the innerProperties property: The blob container properties be listed out. + * + * @return the innerProperties value. + */ + private ContainerProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: Resource Etag. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + + /** + * 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; + } + + /** + * Get the version property: The version of the deleted blob container. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Get the deleted property: Indicates whether the blob container was deleted. + * + * @return the deleted value. + */ + public Boolean deleted() { + return this.innerProperties() == null ? null : this.innerProperties().deleted(); + } + + /** + * Get the deletedTime property: Blob container deletion time. + * + * @return the deletedTime value. + */ + public OffsetDateTime deletedTime() { + return this.innerProperties() == null ? null : this.innerProperties().deletedTime(); + } + + /** + * Get the remainingRetentionDays property: Remaining retention days for soft deleted blob container. + * + * @return the remainingRetentionDays value. + */ + public Integer remainingRetentionDays() { + return this.innerProperties() == null ? null : this.innerProperties().remainingRetentionDays(); + } + + /** + * Get the defaultEncryptionScope property: Default the container to use specified encryption scope for all writes. + * + * @return the defaultEncryptionScope value. + */ + public String defaultEncryptionScope() { + return this.innerProperties() == null ? null : this.innerProperties().defaultEncryptionScope(); + } + + /** + * Set the defaultEncryptionScope property: Default the container to use specified encryption scope for all writes. + * + * @param defaultEncryptionScope the defaultEncryptionScope value to set. + * @return the ListContainerItemInner object itself. + */ + public ListContainerItemInner withDefaultEncryptionScope(String defaultEncryptionScope) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withDefaultEncryptionScope(defaultEncryptionScope); + return this; + } + + /** + * Get the denyEncryptionScopeOverride property: Block override of encryption scope from the container default. + * + * @return the denyEncryptionScopeOverride value. + */ + public Boolean denyEncryptionScopeOverride() { + return this.innerProperties() == null ? null : this.innerProperties().denyEncryptionScopeOverride(); + } + + /** + * Set the denyEncryptionScopeOverride property: Block override of encryption scope from the container default. + * + * @param denyEncryptionScopeOverride the denyEncryptionScopeOverride value to set. + * @return the ListContainerItemInner object itself. + */ + public ListContainerItemInner withDenyEncryptionScopeOverride(Boolean denyEncryptionScopeOverride) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withDenyEncryptionScopeOverride(denyEncryptionScopeOverride); + return this; + } + + /** + * Get the publicAccess property: Specifies whether data in the container may be accessed publicly and the level of + * access. + * + * @return the publicAccess value. + */ + public PublicAccess publicAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicAccess(); + } + + /** + * Set the publicAccess property: Specifies whether data in the container may be accessed publicly and the level of + * access. + * + * @param publicAccess the publicAccess value to set. + * @return the ListContainerItemInner object itself. + */ + public ListContainerItemInner withPublicAccess(PublicAccess publicAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withPublicAccess(publicAccess); + return this; + } + + /** + * Get the lastModifiedTime property: Returns the date and time the container was last modified. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTime(); + } + + /** + * Get the leaseStatus property: The lease status of the container. + * + * @return the leaseStatus value. + */ + public LeaseStatus leaseStatus() { + return this.innerProperties() == null ? null : this.innerProperties().leaseStatus(); + } + + /** + * Get the leaseState property: Lease state of the container. + * + * @return the leaseState value. + */ + public LeaseState leaseState() { + return this.innerProperties() == null ? null : this.innerProperties().leaseState(); + } + + /** + * Get the leaseDuration property: Specifies whether the lease on a container is of infinite or fixed duration, only + * when the container is leased. + * + * @return the leaseDuration value. + */ + public LeaseDuration leaseDuration() { + return this.innerProperties() == null ? null : this.innerProperties().leaseDuration(); + } + + /** + * Get the metadata property: A name-value pair to associate with the container as metadata. + * + * @return the metadata value. + */ + public Map metadata() { + return this.innerProperties() == null ? null : this.innerProperties().metadata(); + } + + /** + * Set the metadata property: A name-value pair to associate with the container as metadata. + * + * @param metadata the metadata value to set. + * @return the ListContainerItemInner object itself. + */ + public ListContainerItemInner withMetadata(Map metadata) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withMetadata(metadata); + return this; + } + + /** + * Get the immutabilityPolicy property: The ImmutabilityPolicy property of the container. + * + * @return the immutabilityPolicy value. + */ + public ImmutabilityPolicyProperties immutabilityPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().immutabilityPolicy(); + } + + /** + * Get the legalHold property: The LegalHold property of the container. + * + * @return the legalHold value. + */ + public LegalHoldProperties legalHold() { + return this.innerProperties() == null ? null : this.innerProperties().legalHold(); + } + + /** + * Get the hasLegalHold property: The hasLegalHold public property is set to true by SRP if there are at least one + * existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared + * out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. + * + * @return the hasLegalHold value. + */ + public Boolean hasLegalHold() { + return this.innerProperties() == null ? null : this.innerProperties().hasLegalHold(); + } + + /** + * Get the hasImmutabilityPolicy property: The hasImmutabilityPolicy public property is set to true by SRP if + * ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false + * by SRP if ImmutabilityPolicy has not been created for this container. + * + * @return the hasImmutabilityPolicy value. + */ + public Boolean hasImmutabilityPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().hasImmutabilityPolicy(); + } + + /** + * Get the immutableStorageWithVersioning property: The object level immutability property of the container. The + * property is immutable and can only be set to true at the container creation time. Existing containers must + * undergo a migration process. + * + * @return the immutableStorageWithVersioning value. + */ + public ImmutableStorageWithVersioning immutableStorageWithVersioning() { + return this.innerProperties() == null ? null : this.innerProperties().immutableStorageWithVersioning(); + } + + /** + * Set the immutableStorageWithVersioning property: The object level immutability property of the container. The + * property is immutable and can only be set to true at the container creation time. Existing containers must + * undergo a migration process. + * + * @param immutableStorageWithVersioning the immutableStorageWithVersioning value to set. + * @return the ListContainerItemInner object itself. + */ + public ListContainerItemInner + withImmutableStorageWithVersioning(ImmutableStorageWithVersioning immutableStorageWithVersioning) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withImmutableStorageWithVersioning(immutableStorageWithVersioning); + return this; + } + + /** + * Get the enableNfsV3RootSquash property: Enable NFSv3 root squash on blob container. + * + * @return the enableNfsV3RootSquash value. + */ + public Boolean enableNfsV3RootSquash() { + return this.innerProperties() == null ? null : this.innerProperties().enableNfsV3RootSquash(); + } + + /** + * Set the enableNfsV3RootSquash property: Enable NFSv3 root squash on blob container. + * + * @param enableNfsV3RootSquash the enableNfsV3RootSquash value to set. + * @return the ListContainerItemInner object itself. + */ + public ListContainerItemInner withEnableNfsV3RootSquash(Boolean enableNfsV3RootSquash) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withEnableNfsV3RootSquash(enableNfsV3RootSquash); + return this; + } + + /** + * Get the enableNfsV3AllSquash property: Enable NFSv3 all squash on blob container. + * + * @return the enableNfsV3AllSquash value. + */ + public Boolean enableNfsV3AllSquash() { + return this.innerProperties() == null ? null : this.innerProperties().enableNfsV3AllSquash(); + } + + /** + * Set the enableNfsV3AllSquash property: Enable NFSv3 all squash on blob container. + * + * @param enableNfsV3AllSquash the enableNfsV3AllSquash value to set. + * @return the ListContainerItemInner object itself. + */ + public ListContainerItemInner withEnableNfsV3AllSquash(Boolean enableNfsV3AllSquash) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerProperties(); + } + this.innerProperties().withEnableNfsV3AllSquash(enableNfsV3AllSquash); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListContainerItemInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListContainerItemInner 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 ListContainerItemInner. + */ + public static ListContainerItemInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListContainerItemInner deserializedListContainerItemInner = new ListContainerItemInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedListContainerItemInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedListContainerItemInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedListContainerItemInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedListContainerItemInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedListContainerItemInner.innerProperties = ContainerProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedListContainerItemInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListQueueInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListQueueInner.java new file mode 100644 index 0000000000000..1b9110e8e9d16 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListQueueInner.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The ListQueue model. + */ +@Fluent +public final class ListQueueInner extends ProxyResource { + /* + * List Queue resource properties. + */ + private ListQueueProperties innerQueueProperties; + + /* + * 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 ListQueueInner class. + */ + public ListQueueInner() { + } + + /** + * Get the innerQueueProperties property: List Queue resource properties. + * + * @return the innerQueueProperties value. + */ + private ListQueueProperties innerQueueProperties() { + return this.innerQueueProperties; + } + + /** + * 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; + } + + /** + * Get the metadata property: A name-value pair that represents queue metadata. + * + * @return the metadata value. + */ + public Map metadata() { + return this.innerQueueProperties() == null ? null : this.innerQueueProperties().metadata(); + } + + /** + * Set the metadata property: A name-value pair that represents queue metadata. + * + * @param metadata the metadata value to set. + * @return the ListQueueInner object itself. + */ + public ListQueueInner withMetadata(Map metadata) { + if (this.innerQueueProperties() == null) { + this.innerQueueProperties = new ListQueueProperties(); + } + this.innerQueueProperties().withMetadata(metadata); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerQueueProperties() != null) { + innerQueueProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerQueueProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListQueueInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListQueueInner 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 ListQueueInner. + */ + public static ListQueueInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListQueueInner deserializedListQueueInner = new ListQueueInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedListQueueInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedListQueueInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedListQueueInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedListQueueInner.innerQueueProperties = ListQueueProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedListQueueInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListQueueProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListQueueProperties.java new file mode 100644 index 0000000000000..dcf3f10351e4b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListQueueProperties.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.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 ListQueueProperties model. + */ +@Fluent +public final class ListQueueProperties implements JsonSerializable { + /* + * A name-value pair that represents queue metadata. + */ + private Map metadata; + + /** + * Creates an instance of ListQueueProperties class. + */ + public ListQueueProperties() { + } + + /** + * Get the metadata property: A name-value pair that represents queue metadata. + * + * @return the metadata value. + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set the metadata property: A name-value pair that represents queue metadata. + * + * @param metadata the metadata value to set. + * @return the ListQueueProperties object itself. + */ + public ListQueueProperties withMetadata(Map metadata) { + this.metadata = metadata; + 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.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListQueueProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListQueueProperties 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 ListQueueProperties. + */ + public static ListQueueProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListQueueProperties deserializedListQueueProperties = new ListQueueProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedListQueueProperties.metadata = metadata; + } else { + reader.skipChildren(); + } + } + + return deserializedListQueueProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListQueueServicesInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListQueueServicesInner.java new file mode 100644 index 0000000000000..e817a5769792b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListQueueServicesInner.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 java.io.IOException; +import java.util.List; + +/** + * The ListQueueServices model. + */ +@Immutable +public final class ListQueueServicesInner implements JsonSerializable { + /* + * List of queue services returned. + */ + private List value; + + /** + * Creates an instance of ListQueueServicesInner class. + */ + public ListQueueServicesInner() { + } + + /** + * Get the value property: List of queue services returned. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListQueueServicesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListQueueServicesInner 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 ListQueueServicesInner. + */ + public static ListQueueServicesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListQueueServicesInner deserializedListQueueServicesInner = new ListQueueServicesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> QueueServicePropertiesInner.fromJson(reader1)); + deserializedListQueueServicesInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedListQueueServicesInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListServiceSasResponseInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListServiceSasResponseInner.java new file mode 100644 index 0000000000000..b0fae4f0cd511 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListServiceSasResponseInner.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 java.io.IOException; + +/** + * The List service SAS credentials operation response. + */ +@Immutable +public final class ListServiceSasResponseInner implements JsonSerializable { + /* + * List service SAS credentials of specific resource. + */ + private String serviceSasToken; + + /** + * Creates an instance of ListServiceSasResponseInner class. + */ + public ListServiceSasResponseInner() { + } + + /** + * Get the serviceSasToken property: List service SAS credentials of specific resource. + * + * @return the serviceSasToken value. + */ + public String serviceSasToken() { + return this.serviceSasToken; + } + + /** + * 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 ListServiceSasResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListServiceSasResponseInner 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 ListServiceSasResponseInner. + */ + public static ListServiceSasResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListServiceSasResponseInner deserializedListServiceSasResponseInner = new ListServiceSasResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceSasToken".equals(fieldName)) { + deserializedListServiceSasResponseInner.serviceSasToken = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListServiceSasResponseInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListTableServicesInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListTableServicesInner.java new file mode 100644 index 0000000000000..1ce46559be267 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListTableServicesInner.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 java.io.IOException; +import java.util.List; + +/** + * The ListTableServices model. + */ +@Immutable +public final class ListTableServicesInner implements JsonSerializable { + /* + * List of table services returned. + */ + private List value; + + /** + * Creates an instance of ListTableServicesInner class. + */ + public ListTableServicesInner() { + } + + /** + * Get the value property: List of table services returned. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListTableServicesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListTableServicesInner 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 ListTableServicesInner. + */ + public static ListTableServicesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListTableServicesInner deserializedListTableServicesInner = new ListTableServicesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> TableServicePropertiesInner.fromJson(reader1)); + deserializedListTableServicesInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedListTableServicesInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserInner.java new file mode 100644 index 0000000000000..92a971c1b366d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserInner.java @@ -0,0 +1,413 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +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.storage.generated.models.PermissionScope; +import com.azure.resourcemanager.storage.generated.models.SshPublicKey; +import java.io.IOException; +import java.util.List; + +/** + * The local user associated with the storage accounts. + */ +@Fluent +public final class LocalUserInner extends ProxyResource { + /* + * Storage account local user properties. + */ + private LocalUserProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + 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 LocalUserInner class. + */ + public LocalUserInner() { + } + + /** + * Get the innerProperties property: Storage account local user properties. + * + * @return the innerProperties value. + */ + private LocalUserProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @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; + } + + /** + * Get the permissionScopes property: The permission scopes of the local user. + * + * @return the permissionScopes value. + */ + public List permissionScopes() { + return this.innerProperties() == null ? null : this.innerProperties().permissionScopes(); + } + + /** + * Set the permissionScopes property: The permission scopes of the local user. + * + * @param permissionScopes the permissionScopes value to set. + * @return the LocalUserInner object itself. + */ + public LocalUserInner withPermissionScopes(List permissionScopes) { + if (this.innerProperties() == null) { + this.innerProperties = new LocalUserProperties(); + } + this.innerProperties().withPermissionScopes(permissionScopes); + return this; + } + + /** + * Get the homeDirectory property: Optional, local user home directory. + * + * @return the homeDirectory value. + */ + public String homeDirectory() { + return this.innerProperties() == null ? null : this.innerProperties().homeDirectory(); + } + + /** + * Set the homeDirectory property: Optional, local user home directory. + * + * @param homeDirectory the homeDirectory value to set. + * @return the LocalUserInner object itself. + */ + public LocalUserInner withHomeDirectory(String homeDirectory) { + if (this.innerProperties() == null) { + this.innerProperties = new LocalUserProperties(); + } + this.innerProperties().withHomeDirectory(homeDirectory); + return this; + } + + /** + * Get the sshAuthorizedKeys property: Optional, local user ssh authorized keys for SFTP. + * + * @return the sshAuthorizedKeys value. + */ + public List sshAuthorizedKeys() { + return this.innerProperties() == null ? null : this.innerProperties().sshAuthorizedKeys(); + } + + /** + * Set the sshAuthorizedKeys property: Optional, local user ssh authorized keys for SFTP. + * + * @param sshAuthorizedKeys the sshAuthorizedKeys value to set. + * @return the LocalUserInner object itself. + */ + public LocalUserInner withSshAuthorizedKeys(List sshAuthorizedKeys) { + if (this.innerProperties() == null) { + this.innerProperties = new LocalUserProperties(); + } + this.innerProperties().withSshAuthorizedKeys(sshAuthorizedKeys); + return this; + } + + /** + * Get the sid property: A unique Security Identifier that is generated by the server. + * + * @return the sid value. + */ + public String sid() { + return this.innerProperties() == null ? null : this.innerProperties().sid(); + } + + /** + * Get the hasSharedKey property: Indicates whether shared key exists. Set it to false to remove existing shared + * key. + * + * @return the hasSharedKey value. + */ + public Boolean hasSharedKey() { + return this.innerProperties() == null ? null : this.innerProperties().hasSharedKey(); + } + + /** + * Set the hasSharedKey property: Indicates whether shared key exists. Set it to false to remove existing shared + * key. + * + * @param hasSharedKey the hasSharedKey value to set. + * @return the LocalUserInner object itself. + */ + public LocalUserInner withHasSharedKey(Boolean hasSharedKey) { + if (this.innerProperties() == null) { + this.innerProperties = new LocalUserProperties(); + } + this.innerProperties().withHasSharedKey(hasSharedKey); + return this; + } + + /** + * Get the hasSshKey property: Indicates whether ssh key exists. Set it to false to remove existing SSH key. + * + * @return the hasSshKey value. + */ + public Boolean hasSshKey() { + return this.innerProperties() == null ? null : this.innerProperties().hasSshKey(); + } + + /** + * Set the hasSshKey property: Indicates whether ssh key exists. Set it to false to remove existing SSH key. + * + * @param hasSshKey the hasSshKey value to set. + * @return the LocalUserInner object itself. + */ + public LocalUserInner withHasSshKey(Boolean hasSshKey) { + if (this.innerProperties() == null) { + this.innerProperties = new LocalUserProperties(); + } + this.innerProperties().withHasSshKey(hasSshKey); + return this; + } + + /** + * Get the hasSshPassword property: Indicates whether ssh password exists. Set it to false to remove existing SSH + * password. + * + * @return the hasSshPassword value. + */ + public Boolean hasSshPassword() { + return this.innerProperties() == null ? null : this.innerProperties().hasSshPassword(); + } + + /** + * Set the hasSshPassword property: Indicates whether ssh password exists. Set it to false to remove existing SSH + * password. + * + * @param hasSshPassword the hasSshPassword value to set. + * @return the LocalUserInner object itself. + */ + public LocalUserInner withHasSshPassword(Boolean hasSshPassword) { + if (this.innerProperties() == null) { + this.innerProperties = new LocalUserProperties(); + } + this.innerProperties().withHasSshPassword(hasSshPassword); + return this; + } + + /** + * Get the userId property: A unique Identifier that is generated by the server. + * + * @return the userId value. + */ + public Integer userId() { + return this.innerProperties() == null ? null : this.innerProperties().userId(); + } + + /** + * Get the groupId property: An identifier for associating a group of users. + * + * @return the groupId value. + */ + public Integer groupId() { + return this.innerProperties() == null ? null : this.innerProperties().groupId(); + } + + /** + * Set the groupId property: An identifier for associating a group of users. + * + * @param groupId the groupId value to set. + * @return the LocalUserInner object itself. + */ + public LocalUserInner withGroupId(Integer groupId) { + if (this.innerProperties() == null) { + this.innerProperties = new LocalUserProperties(); + } + this.innerProperties().withGroupId(groupId); + return this; + } + + /** + * Get the allowAclAuthorization property: Indicates whether ACL authorization is allowed for this user. Set it to + * false to disallow using ACL authorization. + * + * @return the allowAclAuthorization value. + */ + public Boolean allowAclAuthorization() { + return this.innerProperties() == null ? null : this.innerProperties().allowAclAuthorization(); + } + + /** + * Set the allowAclAuthorization property: Indicates whether ACL authorization is allowed for this user. Set it to + * false to disallow using ACL authorization. + * + * @param allowAclAuthorization the allowAclAuthorization value to set. + * @return the LocalUserInner object itself. + */ + public LocalUserInner withAllowAclAuthorization(Boolean allowAclAuthorization) { + if (this.innerProperties() == null) { + this.innerProperties = new LocalUserProperties(); + } + this.innerProperties().withAllowAclAuthorization(allowAclAuthorization); + return this; + } + + /** + * Get the extendedGroups property: Supplementary group membership. Only applicable for local users enabled for + * NFSv3 access. + * + * @return the extendedGroups value. + */ + public List extendedGroups() { + return this.innerProperties() == null ? null : this.innerProperties().extendedGroups(); + } + + /** + * Set the extendedGroups property: Supplementary group membership. Only applicable for local users enabled for + * NFSv3 access. + * + * @param extendedGroups the extendedGroups value to set. + * @return the LocalUserInner object itself. + */ + public LocalUserInner withExtendedGroups(List extendedGroups) { + if (this.innerProperties() == null) { + this.innerProperties = new LocalUserProperties(); + } + this.innerProperties().withExtendedGroups(extendedGroups); + return this; + } + + /** + * Get the isNFSv3Enabled property: Indicates if the local user is enabled for access with NFSv3 protocol. + * + * @return the isNFSv3Enabled value. + */ + public Boolean isNFSv3Enabled() { + return this.innerProperties() == null ? null : this.innerProperties().isNFSv3Enabled(); + } + + /** + * Set the isNFSv3Enabled property: Indicates if the local user is enabled for access with NFSv3 protocol. + * + * @param isNFSv3Enabled the isNFSv3Enabled value to set. + * @return the LocalUserInner object itself. + */ + public LocalUserInner withIsNFSv3Enabled(Boolean isNFSv3Enabled) { + if (this.innerProperties() == null) { + this.innerProperties = new LocalUserProperties(); + } + this.innerProperties().withIsNFSv3Enabled(isNFSv3Enabled); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LocalUserInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LocalUserInner 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 LocalUserInner. + */ + public static LocalUserInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LocalUserInner deserializedLocalUserInner = new LocalUserInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLocalUserInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLocalUserInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLocalUserInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedLocalUserInner.innerProperties = LocalUserProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLocalUserInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLocalUserInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserKeysInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserKeysInner.java new file mode 100644 index 0000000000000..2bc0832f4ce0e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserKeysInner.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.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 com.azure.resourcemanager.storage.generated.models.SshPublicKey; +import java.io.IOException; +import java.util.List; + +/** + * The Storage Account Local User keys. + */ +@Fluent +public final class LocalUserKeysInner implements JsonSerializable { + /* + * Optional, local user ssh authorized keys for SFTP. + */ + private List sshAuthorizedKeys; + + /* + * Auto generated by the server for SMB authentication. + */ + private String sharedKey; + + /** + * Creates an instance of LocalUserKeysInner class. + */ + public LocalUserKeysInner() { + } + + /** + * Get the sshAuthorizedKeys property: Optional, local user ssh authorized keys for SFTP. + * + * @return the sshAuthorizedKeys value. + */ + public List sshAuthorizedKeys() { + return this.sshAuthorizedKeys; + } + + /** + * Set the sshAuthorizedKeys property: Optional, local user ssh authorized keys for SFTP. + * + * @param sshAuthorizedKeys the sshAuthorizedKeys value to set. + * @return the LocalUserKeysInner object itself. + */ + public LocalUserKeysInner withSshAuthorizedKeys(List sshAuthorizedKeys) { + this.sshAuthorizedKeys = sshAuthorizedKeys; + return this; + } + + /** + * Get the sharedKey property: Auto generated by the server for SMB authentication. + * + * @return the sharedKey value. + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sshAuthorizedKeys() != null) { + sshAuthorizedKeys().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("sshAuthorizedKeys", this.sshAuthorizedKeys, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LocalUserKeysInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LocalUserKeysInner 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 LocalUserKeysInner. + */ + public static LocalUserKeysInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LocalUserKeysInner deserializedLocalUserKeysInner = new LocalUserKeysInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sshAuthorizedKeys".equals(fieldName)) { + List sshAuthorizedKeys = reader.readArray(reader1 -> SshPublicKey.fromJson(reader1)); + deserializedLocalUserKeysInner.sshAuthorizedKeys = sshAuthorizedKeys; + } else if ("sharedKey".equals(fieldName)) { + deserializedLocalUserKeysInner.sharedKey = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLocalUserKeysInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserProperties.java new file mode 100644 index 0000000000000..3377b5efbe4bc --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserProperties.java @@ -0,0 +1,402 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.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 com.azure.resourcemanager.storage.generated.models.PermissionScope; +import com.azure.resourcemanager.storage.generated.models.SshPublicKey; +import java.io.IOException; +import java.util.List; + +/** + * The Storage Account Local User properties. + */ +@Fluent +public final class LocalUserProperties implements JsonSerializable { + /* + * The permission scopes of the local user. + */ + private List permissionScopes; + + /* + * Optional, local user home directory. + */ + private String homeDirectory; + + /* + * Optional, local user ssh authorized keys for SFTP. + */ + private List sshAuthorizedKeys; + + /* + * A unique Security Identifier that is generated by the server. + */ + private String sid; + + /* + * Indicates whether shared key exists. Set it to false to remove existing shared key. + */ + private Boolean hasSharedKey; + + /* + * Indicates whether ssh key exists. Set it to false to remove existing SSH key. + */ + private Boolean hasSshKey; + + /* + * Indicates whether ssh password exists. Set it to false to remove existing SSH password. + */ + private Boolean hasSshPassword; + + /* + * A unique Identifier that is generated by the server. + */ + private Integer userId; + + /* + * An identifier for associating a group of users. + */ + private Integer groupId; + + /* + * Indicates whether ACL authorization is allowed for this user. Set it to false to disallow using ACL + * authorization. + */ + private Boolean allowAclAuthorization; + + /* + * Supplementary group membership. Only applicable for local users enabled for NFSv3 access. + */ + private List extendedGroups; + + /* + * Indicates if the local user is enabled for access with NFSv3 protocol. + */ + private Boolean isNFSv3Enabled; + + /** + * Creates an instance of LocalUserProperties class. + */ + public LocalUserProperties() { + } + + /** + * Get the permissionScopes property: The permission scopes of the local user. + * + * @return the permissionScopes value. + */ + public List permissionScopes() { + return this.permissionScopes; + } + + /** + * Set the permissionScopes property: The permission scopes of the local user. + * + * @param permissionScopes the permissionScopes value to set. + * @return the LocalUserProperties object itself. + */ + public LocalUserProperties withPermissionScopes(List permissionScopes) { + this.permissionScopes = permissionScopes; + return this; + } + + /** + * Get the homeDirectory property: Optional, local user home directory. + * + * @return the homeDirectory value. + */ + public String homeDirectory() { + return this.homeDirectory; + } + + /** + * Set the homeDirectory property: Optional, local user home directory. + * + * @param homeDirectory the homeDirectory value to set. + * @return the LocalUserProperties object itself. + */ + public LocalUserProperties withHomeDirectory(String homeDirectory) { + this.homeDirectory = homeDirectory; + return this; + } + + /** + * Get the sshAuthorizedKeys property: Optional, local user ssh authorized keys for SFTP. + * + * @return the sshAuthorizedKeys value. + */ + public List sshAuthorizedKeys() { + return this.sshAuthorizedKeys; + } + + /** + * Set the sshAuthorizedKeys property: Optional, local user ssh authorized keys for SFTP. + * + * @param sshAuthorizedKeys the sshAuthorizedKeys value to set. + * @return the LocalUserProperties object itself. + */ + public LocalUserProperties withSshAuthorizedKeys(List sshAuthorizedKeys) { + this.sshAuthorizedKeys = sshAuthorizedKeys; + return this; + } + + /** + * Get the sid property: A unique Security Identifier that is generated by the server. + * + * @return the sid value. + */ + public String sid() { + return this.sid; + } + + /** + * Get the hasSharedKey property: Indicates whether shared key exists. Set it to false to remove existing shared + * key. + * + * @return the hasSharedKey value. + */ + public Boolean hasSharedKey() { + return this.hasSharedKey; + } + + /** + * Set the hasSharedKey property: Indicates whether shared key exists. Set it to false to remove existing shared + * key. + * + * @param hasSharedKey the hasSharedKey value to set. + * @return the LocalUserProperties object itself. + */ + public LocalUserProperties withHasSharedKey(Boolean hasSharedKey) { + this.hasSharedKey = hasSharedKey; + return this; + } + + /** + * Get the hasSshKey property: Indicates whether ssh key exists. Set it to false to remove existing SSH key. + * + * @return the hasSshKey value. + */ + public Boolean hasSshKey() { + return this.hasSshKey; + } + + /** + * Set the hasSshKey property: Indicates whether ssh key exists. Set it to false to remove existing SSH key. + * + * @param hasSshKey the hasSshKey value to set. + * @return the LocalUserProperties object itself. + */ + public LocalUserProperties withHasSshKey(Boolean hasSshKey) { + this.hasSshKey = hasSshKey; + return this; + } + + /** + * Get the hasSshPassword property: Indicates whether ssh password exists. Set it to false to remove existing SSH + * password. + * + * @return the hasSshPassword value. + */ + public Boolean hasSshPassword() { + return this.hasSshPassword; + } + + /** + * Set the hasSshPassword property: Indicates whether ssh password exists. Set it to false to remove existing SSH + * password. + * + * @param hasSshPassword the hasSshPassword value to set. + * @return the LocalUserProperties object itself. + */ + public LocalUserProperties withHasSshPassword(Boolean hasSshPassword) { + this.hasSshPassword = hasSshPassword; + return this; + } + + /** + * Get the userId property: A unique Identifier that is generated by the server. + * + * @return the userId value. + */ + public Integer userId() { + return this.userId; + } + + /** + * Get the groupId property: An identifier for associating a group of users. + * + * @return the groupId value. + */ + public Integer groupId() { + return this.groupId; + } + + /** + * Set the groupId property: An identifier for associating a group of users. + * + * @param groupId the groupId value to set. + * @return the LocalUserProperties object itself. + */ + public LocalUserProperties withGroupId(Integer groupId) { + this.groupId = groupId; + return this; + } + + /** + * Get the allowAclAuthorization property: Indicates whether ACL authorization is allowed for this user. Set it to + * false to disallow using ACL authorization. + * + * @return the allowAclAuthorization value. + */ + public Boolean allowAclAuthorization() { + return this.allowAclAuthorization; + } + + /** + * Set the allowAclAuthorization property: Indicates whether ACL authorization is allowed for this user. Set it to + * false to disallow using ACL authorization. + * + * @param allowAclAuthorization the allowAclAuthorization value to set. + * @return the LocalUserProperties object itself. + */ + public LocalUserProperties withAllowAclAuthorization(Boolean allowAclAuthorization) { + this.allowAclAuthorization = allowAclAuthorization; + return this; + } + + /** + * Get the extendedGroups property: Supplementary group membership. Only applicable for local users enabled for + * NFSv3 access. + * + * @return the extendedGroups value. + */ + public List extendedGroups() { + return this.extendedGroups; + } + + /** + * Set the extendedGroups property: Supplementary group membership. Only applicable for local users enabled for + * NFSv3 access. + * + * @param extendedGroups the extendedGroups value to set. + * @return the LocalUserProperties object itself. + */ + public LocalUserProperties withExtendedGroups(List extendedGroups) { + this.extendedGroups = extendedGroups; + return this; + } + + /** + * Get the isNFSv3Enabled property: Indicates if the local user is enabled for access with NFSv3 protocol. + * + * @return the isNFSv3Enabled value. + */ + public Boolean isNFSv3Enabled() { + return this.isNFSv3Enabled; + } + + /** + * Set the isNFSv3Enabled property: Indicates if the local user is enabled for access with NFSv3 protocol. + * + * @param isNFSv3Enabled the isNFSv3Enabled value to set. + * @return the LocalUserProperties object itself. + */ + public LocalUserProperties withIsNFSv3Enabled(Boolean isNFSv3Enabled) { + this.isNFSv3Enabled = isNFSv3Enabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (permissionScopes() != null) { + permissionScopes().forEach(e -> e.validate()); + } + if (sshAuthorizedKeys() != null) { + sshAuthorizedKeys().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("permissionScopes", this.permissionScopes, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("homeDirectory", this.homeDirectory); + jsonWriter.writeArrayField("sshAuthorizedKeys", this.sshAuthorizedKeys, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("hasSharedKey", this.hasSharedKey); + jsonWriter.writeBooleanField("hasSshKey", this.hasSshKey); + jsonWriter.writeBooleanField("hasSshPassword", this.hasSshPassword); + jsonWriter.writeNumberField("groupId", this.groupId); + jsonWriter.writeBooleanField("allowAclAuthorization", this.allowAclAuthorization); + jsonWriter.writeArrayField("extendedGroups", this.extendedGroups, + (writer, element) -> writer.writeInt(element)); + jsonWriter.writeBooleanField("isNFSv3Enabled", this.isNFSv3Enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LocalUserProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LocalUserProperties 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 LocalUserProperties. + */ + public static LocalUserProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LocalUserProperties deserializedLocalUserProperties = new LocalUserProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("permissionScopes".equals(fieldName)) { + List permissionScopes + = reader.readArray(reader1 -> PermissionScope.fromJson(reader1)); + deserializedLocalUserProperties.permissionScopes = permissionScopes; + } else if ("homeDirectory".equals(fieldName)) { + deserializedLocalUserProperties.homeDirectory = reader.getString(); + } else if ("sshAuthorizedKeys".equals(fieldName)) { + List sshAuthorizedKeys = reader.readArray(reader1 -> SshPublicKey.fromJson(reader1)); + deserializedLocalUserProperties.sshAuthorizedKeys = sshAuthorizedKeys; + } else if ("sid".equals(fieldName)) { + deserializedLocalUserProperties.sid = reader.getString(); + } else if ("hasSharedKey".equals(fieldName)) { + deserializedLocalUserProperties.hasSharedKey = reader.getNullable(JsonReader::getBoolean); + } else if ("hasSshKey".equals(fieldName)) { + deserializedLocalUserProperties.hasSshKey = reader.getNullable(JsonReader::getBoolean); + } else if ("hasSshPassword".equals(fieldName)) { + deserializedLocalUserProperties.hasSshPassword = reader.getNullable(JsonReader::getBoolean); + } else if ("userId".equals(fieldName)) { + deserializedLocalUserProperties.userId = reader.getNullable(JsonReader::getInt); + } else if ("groupId".equals(fieldName)) { + deserializedLocalUserProperties.groupId = reader.getNullable(JsonReader::getInt); + } else if ("allowAclAuthorization".equals(fieldName)) { + deserializedLocalUserProperties.allowAclAuthorization = reader.getNullable(JsonReader::getBoolean); + } else if ("extendedGroups".equals(fieldName)) { + List extendedGroups = reader.readArray(reader1 -> reader1.getInt()); + deserializedLocalUserProperties.extendedGroups = extendedGroups; + } else if ("isNFSv3Enabled".equals(fieldName)) { + deserializedLocalUserProperties.isNFSv3Enabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedLocalUserProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserRegeneratePasswordResultInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserRegeneratePasswordResultInner.java new file mode 100644 index 0000000000000..3ae94fd28b56f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LocalUserRegeneratePasswordResultInner.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 java.io.IOException; + +/** + * The secrets of Storage Account Local User. + */ +@Immutable +public final class LocalUserRegeneratePasswordResultInner + implements JsonSerializable { + /* + * Auto generated password by the server for SSH authentication if hasSshPassword is set to true on the creation of + * local user. + */ + private String sshPassword; + + /** + * Creates an instance of LocalUserRegeneratePasswordResultInner class. + */ + public LocalUserRegeneratePasswordResultInner() { + } + + /** + * Get the sshPassword property: Auto generated password by the server for SSH authentication if hasSshPassword is + * set to true on the creation of local user. + * + * @return the sshPassword value. + */ + public String sshPassword() { + return this.sshPassword; + } + + /** + * 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 LocalUserRegeneratePasswordResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LocalUserRegeneratePasswordResultInner 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 LocalUserRegeneratePasswordResultInner. + */ + public static LocalUserRegeneratePasswordResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LocalUserRegeneratePasswordResultInner deserializedLocalUserRegeneratePasswordResultInner + = new LocalUserRegeneratePasswordResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sshPassword".equals(fieldName)) { + deserializedLocalUserRegeneratePasswordResultInner.sshPassword = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLocalUserRegeneratePasswordResultInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ManagementPolicyInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ManagementPolicyInner.java new file mode 100644 index 0000000000000..cf068727066cd --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ManagementPolicyInner.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicySchema; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The Get Storage Account ManagementPolicies operation response. + */ +@Fluent +public final class ManagementPolicyInner extends ProxyResource { + /* + * Returns the Storage Account Data Policies Rules. + */ + private ManagementPolicyProperties innerProperties; + + /* + * 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 ManagementPolicyInner class. + */ + public ManagementPolicyInner() { + } + + /** + * Get the innerProperties property: Returns the Storage Account Data Policies Rules. + * + * @return the innerProperties value. + */ + private ManagementPolicyProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * Get the lastModifiedTime property: Returns the date and time the ManagementPolicies was last modified. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTime(); + } + + /** + * Get the policy property: The Storage Account ManagementPolicy, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @return the policy value. + */ + public ManagementPolicySchema policy() { + return this.innerProperties() == null ? null : this.innerProperties().policy(); + } + + /** + * Set the policy property: The Storage Account ManagementPolicy, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @param policy the policy value to set. + * @return the ManagementPolicyInner object itself. + */ + public ManagementPolicyInner withPolicy(ManagementPolicySchema policy) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagementPolicyProperties(); + } + this.innerProperties().withPolicy(policy); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagementPolicyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementPolicyInner 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 ManagementPolicyInner. + */ + public static ManagementPolicyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementPolicyInner deserializedManagementPolicyInner = new ManagementPolicyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedManagementPolicyInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedManagementPolicyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedManagementPolicyInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedManagementPolicyInner.innerProperties = ManagementPolicyProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagementPolicyInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ManagementPolicyProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ManagementPolicyProperties.java new file mode 100644 index 0000000000000..86600b3388a0b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ManagementPolicyProperties.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +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.storage.generated.models.ManagementPolicySchema; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The Storage Account ManagementPolicy properties. + */ +@Fluent +public final class ManagementPolicyProperties implements JsonSerializable { + /* + * Returns the date and time the ManagementPolicies was last modified. + */ + private OffsetDateTime lastModifiedTime; + + /* + * The Storage Account ManagementPolicy, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + */ + private ManagementPolicySchema policy; + + /** + * Creates an instance of ManagementPolicyProperties class. + */ + public ManagementPolicyProperties() { + } + + /** + * Get the lastModifiedTime property: Returns the date and time the ManagementPolicies was last modified. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the policy property: The Storage Account ManagementPolicy, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @return the policy value. + */ + public ManagementPolicySchema policy() { + return this.policy; + } + + /** + * Set the policy property: The Storage Account ManagementPolicy, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @param policy the policy value to set. + * @return the ManagementPolicyProperties object itself. + */ + public ManagementPolicyProperties withPolicy(ManagementPolicySchema policy) { + this.policy = policy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (policy() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property policy in model ManagementPolicyProperties")); + } else { + policy().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagementPolicyProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("policy", this.policy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagementPolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementPolicyProperties 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 ManagementPolicyProperties. + */ + public static ManagementPolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementPolicyProperties deserializedManagementPolicyProperties = new ManagementPolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("policy".equals(fieldName)) { + deserializedManagementPolicyProperties.policy = ManagementPolicySchema.fromJson(reader); + } else if ("lastModifiedTime".equals(fieldName)) { + deserializedManagementPolicyProperties.lastModifiedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedManagementPolicyProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/NetworkSecurityPerimeterConfigurationInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/NetworkSecurityPerimeterConfigurationInner.java new file mode 100644 index 0000000000000..4bec7077ee5d6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/NetworkSecurityPerimeterConfigurationInner.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +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.storage.generated.models.NetworkSecurityPerimeter; +import com.azure.resourcemanager.storage.generated.models.NetworkSecurityPerimeterConfigurationPropertiesProfile; +import com.azure.resourcemanager.storage.generated.models.NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation; +import com.azure.resourcemanager.storage.generated.models.NetworkSecurityPerimeterConfigurationProvisioningState; +import com.azure.resourcemanager.storage.generated.models.ProvisioningIssue; +import java.io.IOException; +import java.util.List; + +/** + * The Network Security Perimeter configuration resource. + */ +@Immutable +public final class NetworkSecurityPerimeterConfigurationInner extends ProxyResource { + /* + * Properties of the Network Security Perimeter Configuration + */ + private NetworkSecurityPerimeterConfigurationProperties innerProperties; + + /* + * 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 NetworkSecurityPerimeterConfigurationInner class. + */ + public NetworkSecurityPerimeterConfigurationInner() { + } + + /** + * Get the innerProperties property: Properties of the Network Security Perimeter Configuration. + * + * @return the innerProperties value. + */ + private NetworkSecurityPerimeterConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * Get the provisioningState property: Provisioning state of Network Security Perimeter configuration propagation. + * + * @return the provisioningState value. + */ + public NetworkSecurityPerimeterConfigurationProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the provisioningIssues property: List of Provisioning Issues if any. + * + * @return the provisioningIssues value. + */ + public List provisioningIssues() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningIssues(); + } + + /** + * Get the networkSecurityPerimeter property: NetworkSecurityPerimeter related information. + * + * @return the networkSecurityPerimeter value. + */ + public NetworkSecurityPerimeter networkSecurityPerimeter() { + return this.innerProperties() == null ? null : this.innerProperties().networkSecurityPerimeter(); + } + + /** + * Get the resourceAssociation property: Information about resource association. + * + * @return the resourceAssociation value. + */ + public NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation resourceAssociation() { + return this.innerProperties() == null ? null : this.innerProperties().resourceAssociation(); + } + + /** + * Get the profile property: Network Security Perimeter profile. + * + * @return the profile value. + */ + public NetworkSecurityPerimeterConfigurationPropertiesProfile profile() { + return this.innerProperties() == null ? null : this.innerProperties().profile(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityPerimeterConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityPerimeterConfigurationInner 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 NetworkSecurityPerimeterConfigurationInner. + */ + public static NetworkSecurityPerimeterConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityPerimeterConfigurationInner deserializedNetworkSecurityPerimeterConfigurationInner + = new NetworkSecurityPerimeterConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationInner.innerProperties + = NetworkSecurityPerimeterConfigurationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeterConfigurationInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/NetworkSecurityPerimeterConfigurationProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/NetworkSecurityPerimeterConfigurationProperties.java new file mode 100644 index 0000000000000..e4ee9ff1f0721 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/NetworkSecurityPerimeterConfigurationProperties.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.models.NetworkSecurityPerimeter; +import com.azure.resourcemanager.storage.generated.models.NetworkSecurityPerimeterConfigurationPropertiesProfile; +import com.azure.resourcemanager.storage.generated.models.NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation; +import com.azure.resourcemanager.storage.generated.models.NetworkSecurityPerimeterConfigurationProvisioningState; +import com.azure.resourcemanager.storage.generated.models.ProvisioningIssue; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the Network Security Perimeter Configuration. + */ +@Immutable +public final class NetworkSecurityPerimeterConfigurationProperties + implements JsonSerializable { + /* + * Provisioning state of Network Security Perimeter configuration propagation + */ + private NetworkSecurityPerimeterConfigurationProvisioningState provisioningState; + + /* + * List of Provisioning Issues if any + */ + private List provisioningIssues; + + /* + * NetworkSecurityPerimeter related information + */ + private NetworkSecurityPerimeter networkSecurityPerimeter; + + /* + * Information about resource association + */ + private NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation resourceAssociation; + + /* + * Network Security Perimeter profile + */ + private NetworkSecurityPerimeterConfigurationPropertiesProfile profile; + + /** + * Creates an instance of NetworkSecurityPerimeterConfigurationProperties class. + */ + public NetworkSecurityPerimeterConfigurationProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of Network Security Perimeter configuration propagation. + * + * @return the provisioningState value. + */ + public NetworkSecurityPerimeterConfigurationProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the provisioningIssues property: List of Provisioning Issues if any. + * + * @return the provisioningIssues value. + */ + public List provisioningIssues() { + return this.provisioningIssues; + } + + /** + * Get the networkSecurityPerimeter property: NetworkSecurityPerimeter related information. + * + * @return the networkSecurityPerimeter value. + */ + public NetworkSecurityPerimeter networkSecurityPerimeter() { + return this.networkSecurityPerimeter; + } + + /** + * Get the resourceAssociation property: Information about resource association. + * + * @return the resourceAssociation value. + */ + public NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation resourceAssociation() { + return this.resourceAssociation; + } + + /** + * Get the profile property: Network Security Perimeter profile. + * + * @return the profile value. + */ + public NetworkSecurityPerimeterConfigurationPropertiesProfile profile() { + return this.profile; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (provisioningIssues() != null) { + provisioningIssues().forEach(e -> e.validate()); + } + if (networkSecurityPerimeter() != null) { + networkSecurityPerimeter().validate(); + } + if (resourceAssociation() != null) { + resourceAssociation().validate(); + } + if (profile() != null) { + profile().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityPerimeterConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityPerimeterConfigurationProperties 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 NetworkSecurityPerimeterConfigurationProperties. + */ + public static NetworkSecurityPerimeterConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityPerimeterConfigurationProperties deserializedNetworkSecurityPerimeterConfigurationProperties + = new NetworkSecurityPerimeterConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationProperties.provisioningState + = NetworkSecurityPerimeterConfigurationProvisioningState.fromString(reader.getString()); + } else if ("provisioningIssues".equals(fieldName)) { + List provisioningIssues + = reader.readArray(reader1 -> ProvisioningIssue.fromJson(reader1)); + deserializedNetworkSecurityPerimeterConfigurationProperties.provisioningIssues = provisioningIssues; + } else if ("networkSecurityPerimeter".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationProperties.networkSecurityPerimeter + = NetworkSecurityPerimeter.fromJson(reader); + } else if ("resourceAssociation".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationProperties.resourceAssociation + = NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.fromJson(reader); + } else if ("profile".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationProperties.profile + = NetworkSecurityPerimeterConfigurationPropertiesProfile.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeterConfigurationProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ObjectReplicationPolicyInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ObjectReplicationPolicyInner.java new file mode 100644 index 0000000000000..fe59be6265c77 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ObjectReplicationPolicyInner.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicyPropertiesMetrics; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicyRule; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * The replication policy between two storage accounts. Multiple rules can be defined in one policy. + */ +@Fluent +public final class ObjectReplicationPolicyInner extends ProxyResource { + /* + * Returns the Storage Account Object Replication Policy. + */ + private ObjectReplicationPolicyProperties innerProperties; + + /* + * 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 ObjectReplicationPolicyInner class. + */ + public ObjectReplicationPolicyInner() { + } + + /** + * Get the innerProperties property: Returns the Storage Account Object Replication Policy. + * + * @return the innerProperties value. + */ + private ObjectReplicationPolicyProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * Get the policyId property: A unique id for object replication policy. + * + * @return the policyId value. + */ + public String policyId() { + return this.innerProperties() == null ? null : this.innerProperties().policyId(); + } + + /** + * Get the enabledTime property: Indicates when the policy is enabled on the source account. + * + * @return the enabledTime value. + */ + public OffsetDateTime enabledTime() { + return this.innerProperties() == null ? null : this.innerProperties().enabledTime(); + } + + /** + * Get the sourceAccount property: Required. Source account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * + * @return the sourceAccount value. + */ + public String sourceAccount() { + return this.innerProperties() == null ? null : this.innerProperties().sourceAccount(); + } + + /** + * Set the sourceAccount property: Required. Source account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * + * @param sourceAccount the sourceAccount value to set. + * @return the ObjectReplicationPolicyInner object itself. + */ + public ObjectReplicationPolicyInner withSourceAccount(String sourceAccount) { + if (this.innerProperties() == null) { + this.innerProperties = new ObjectReplicationPolicyProperties(); + } + this.innerProperties().withSourceAccount(sourceAccount); + return this; + } + + /** + * Get the destinationAccount property: Required. Destination account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * + * @return the destinationAccount value. + */ + public String destinationAccount() { + return this.innerProperties() == null ? null : this.innerProperties().destinationAccount(); + } + + /** + * Set the destinationAccount property: Required. Destination account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * + * @param destinationAccount the destinationAccount value to set. + * @return the ObjectReplicationPolicyInner object itself. + */ + public ObjectReplicationPolicyInner withDestinationAccount(String destinationAccount) { + if (this.innerProperties() == null) { + this.innerProperties = new ObjectReplicationPolicyProperties(); + } + this.innerProperties().withDestinationAccount(destinationAccount); + return this; + } + + /** + * Get the rules property: The storage account object replication rules. + * + * @return the rules value. + */ + public List rules() { + return this.innerProperties() == null ? null : this.innerProperties().rules(); + } + + /** + * Set the rules property: The storage account object replication rules. + * + * @param rules the rules value to set. + * @return the ObjectReplicationPolicyInner object itself. + */ + public ObjectReplicationPolicyInner withRules(List rules) { + if (this.innerProperties() == null) { + this.innerProperties = new ObjectReplicationPolicyProperties(); + } + this.innerProperties().withRules(rules); + return this; + } + + /** + * Get the metrics property: Optional. The object replication policy metrics feature options. + * + * @return the metrics value. + */ + public ObjectReplicationPolicyPropertiesMetrics metrics() { + return this.innerProperties() == null ? null : this.innerProperties().metrics(); + } + + /** + * Set the metrics property: Optional. The object replication policy metrics feature options. + * + * @param metrics the metrics value to set. + * @return the ObjectReplicationPolicyInner object itself. + */ + public ObjectReplicationPolicyInner withMetrics(ObjectReplicationPolicyPropertiesMetrics metrics) { + if (this.innerProperties() == null) { + this.innerProperties = new ObjectReplicationPolicyProperties(); + } + this.innerProperties().withMetrics(metrics); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObjectReplicationPolicyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObjectReplicationPolicyInner 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 ObjectReplicationPolicyInner. + */ + public static ObjectReplicationPolicyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObjectReplicationPolicyInner deserializedObjectReplicationPolicyInner = new ObjectReplicationPolicyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedObjectReplicationPolicyInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedObjectReplicationPolicyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedObjectReplicationPolicyInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedObjectReplicationPolicyInner.innerProperties + = ObjectReplicationPolicyProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedObjectReplicationPolicyInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ObjectReplicationPolicyProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ObjectReplicationPolicyProperties.java new file mode 100644 index 0000000000000..19e2e22583a53 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ObjectReplicationPolicyProperties.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +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.storage.generated.models.ObjectReplicationPolicyPropertiesMetrics; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicyRule; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * The Storage Account ObjectReplicationPolicy properties. + */ +@Fluent +public final class ObjectReplicationPolicyProperties implements JsonSerializable { + /* + * A unique id for object replication policy. + */ + private String policyId; + + /* + * Indicates when the policy is enabled on the source account. + */ + private OffsetDateTime enabledTime; + + /* + * Required. Source account name. It should be full resource id if allowCrossTenantReplication set to false. + */ + private String sourceAccount; + + /* + * Required. Destination account name. It should be full resource id if allowCrossTenantReplication set to false. + */ + private String destinationAccount; + + /* + * The storage account object replication rules. + */ + private List rules; + + /* + * Optional. The object replication policy metrics feature options. + */ + private ObjectReplicationPolicyPropertiesMetrics metrics; + + /** + * Creates an instance of ObjectReplicationPolicyProperties class. + */ + public ObjectReplicationPolicyProperties() { + } + + /** + * Get the policyId property: A unique id for object replication policy. + * + * @return the policyId value. + */ + public String policyId() { + return this.policyId; + } + + /** + * Get the enabledTime property: Indicates when the policy is enabled on the source account. + * + * @return the enabledTime value. + */ + public OffsetDateTime enabledTime() { + return this.enabledTime; + } + + /** + * Get the sourceAccount property: Required. Source account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * + * @return the sourceAccount value. + */ + public String sourceAccount() { + return this.sourceAccount; + } + + /** + * Set the sourceAccount property: Required. Source account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * + * @param sourceAccount the sourceAccount value to set. + * @return the ObjectReplicationPolicyProperties object itself. + */ + public ObjectReplicationPolicyProperties withSourceAccount(String sourceAccount) { + this.sourceAccount = sourceAccount; + return this; + } + + /** + * Get the destinationAccount property: Required. Destination account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * + * @return the destinationAccount value. + */ + public String destinationAccount() { + return this.destinationAccount; + } + + /** + * Set the destinationAccount property: Required. Destination account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * + * @param destinationAccount the destinationAccount value to set. + * @return the ObjectReplicationPolicyProperties object itself. + */ + public ObjectReplicationPolicyProperties withDestinationAccount(String destinationAccount) { + this.destinationAccount = destinationAccount; + return this; + } + + /** + * Get the rules property: The storage account object replication rules. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: The storage account object replication rules. + * + * @param rules the rules value to set. + * @return the ObjectReplicationPolicyProperties object itself. + */ + public ObjectReplicationPolicyProperties withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get the metrics property: Optional. The object replication policy metrics feature options. + * + * @return the metrics value. + */ + public ObjectReplicationPolicyPropertiesMetrics metrics() { + return this.metrics; + } + + /** + * Set the metrics property: Optional. The object replication policy metrics feature options. + * + * @param metrics the metrics value to set. + * @return the ObjectReplicationPolicyProperties object itself. + */ + public ObjectReplicationPolicyProperties withMetrics(ObjectReplicationPolicyPropertiesMetrics metrics) { + this.metrics = metrics; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceAccount() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sourceAccount in model ObjectReplicationPolicyProperties")); + } + if (destinationAccount() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destinationAccount in model ObjectReplicationPolicyProperties")); + } + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + if (metrics() != null) { + metrics().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ObjectReplicationPolicyProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sourceAccount", this.sourceAccount); + jsonWriter.writeStringField("destinationAccount", this.destinationAccount); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("metrics", this.metrics); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObjectReplicationPolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObjectReplicationPolicyProperties 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 ObjectReplicationPolicyProperties. + */ + public static ObjectReplicationPolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObjectReplicationPolicyProperties deserializedObjectReplicationPolicyProperties + = new ObjectReplicationPolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceAccount".equals(fieldName)) { + deserializedObjectReplicationPolicyProperties.sourceAccount = reader.getString(); + } else if ("destinationAccount".equals(fieldName)) { + deserializedObjectReplicationPolicyProperties.destinationAccount = reader.getString(); + } else if ("policyId".equals(fieldName)) { + deserializedObjectReplicationPolicyProperties.policyId = reader.getString(); + } else if ("enabledTime".equals(fieldName)) { + deserializedObjectReplicationPolicyProperties.enabledTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("rules".equals(fieldName)) { + List rules + = reader.readArray(reader1 -> ObjectReplicationPolicyRule.fromJson(reader1)); + deserializedObjectReplicationPolicyProperties.rules = rules; + } else if ("metrics".equals(fieldName)) { + deserializedObjectReplicationPolicyProperties.metrics + = ObjectReplicationPolicyPropertiesMetrics.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedObjectReplicationPolicyProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/OperationInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..e8a95a51a029e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/OperationInner.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.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 com.azure.resourcemanager.storage.generated.models.OperationDisplay; +import com.azure.resourcemanager.storage.generated.models.ServiceSpecification; +import java.io.IOException; + +/** + * Storage REST API operation definition. + */ +@Fluent +public final class OperationInner implements JsonSerializable { + /* + * Operation name: {provider}/{resource}/{operation} + */ + private String name; + + /* + * Display metadata associated with the operation. + */ + private OperationDisplay display; + + /* + * The origin of operations. + */ + private String origin; + + /* + * Properties of operation, include metric specifications. + */ + private OperationProperties innerOperationProperties; + + /** + * Creates an instance of OperationInner class. + */ + public OperationInner() { + } + + /** + * Get the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set. + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display property: Display metadata associated with the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Display metadata associated with the operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The origin of operations. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: The origin of operations. + * + * @param origin the origin value to set. + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the innerOperationProperties property: Properties of operation, include metric specifications. + * + * @return the innerOperationProperties value. + */ + private OperationProperties innerOperationProperties() { + return this.innerOperationProperties; + } + + /** + * Get the serviceSpecification property: One property of operation, include metric specifications. + * + * @return the serviceSpecification value. + */ + public ServiceSpecification serviceSpecification() { + return this.innerOperationProperties() == null ? null : this.innerOperationProperties().serviceSpecification(); + } + + /** + * Set the serviceSpecification property: One property of operation, include metric specifications. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the OperationInner object itself. + */ + public OperationInner withServiceSpecification(ServiceSpecification serviceSpecification) { + if (this.innerOperationProperties() == null) { + this.innerOperationProperties = new OperationProperties(); + } + this.innerOperationProperties().withServiceSpecification(serviceSpecification); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + if (innerOperationProperties() != null) { + innerOperationProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("display", this.display); + jsonWriter.writeStringField("origin", this.origin); + jsonWriter.writeJsonField("properties", this.innerOperationProperties); + 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 ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedOperationInner.innerOperationProperties = OperationProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/OperationProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/OperationProperties.java new file mode 100644 index 0000000000000..61d27f128c7c3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/OperationProperties.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.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 com.azure.resourcemanager.storage.generated.models.ServiceSpecification; +import java.io.IOException; + +/** + * Properties of operation, include metric specifications. + */ +@Fluent +public final class OperationProperties implements JsonSerializable { + /* + * One property of operation, include metric specifications. + */ + private ServiceSpecification serviceSpecification; + + /** + * Creates an instance of OperationProperties class. + */ + public OperationProperties() { + } + + /** + * Get the serviceSpecification property: One property of operation, include metric specifications. + * + * @return the serviceSpecification value. + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the serviceSpecification property: One property of operation, include metric specifications. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the OperationProperties object itself. + */ + public OperationProperties withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("serviceSpecification", this.serviceSpecification); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationProperties 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 OperationProperties. + */ + public static OperationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationProperties deserializedOperationProperties = new OperationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceSpecification".equals(fieldName)) { + deserializedOperationProperties.serviceSpecification = ServiceSpecification.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateEndpointConnectionInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..4f96c1a477406 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.storage.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.storage.generated.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.storage.generated.models.PrivateLinkServiceConnectionState; +import java.io.IOException; + +/** + * The Private Endpoint Connection resource. + */ +@Fluent +public final class PrivateEndpointConnectionInner extends ProxyResource { + /* + * Resource properties. + */ + private PrivateEndpointConnectionProperties innerProperties; + + /* + * 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 PrivateEndpointConnectionInner class. + */ + public PrivateEndpointConnectionInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); + } + + /** + * Set the privateEndpoint property: The resource of private end point. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionInner 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 PrivateEndpointConnectionInner. + */ + public static PrivateEndpointConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionInner deserializedPrivateEndpointConnectionInner + = new PrivateEndpointConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.innerProperties + = PrivateEndpointConnectionProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 0000000000000..75e958254335e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.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 com.azure.resourcemanager.storage.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.storage.generated.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.storage.generated.models.PrivateLinkServiceConnectionState; +import java.io.IOException; + +/** + * Properties of the PrivateEndpointConnectProperties. + */ +@Fluent +public final class PrivateEndpointConnectionProperties + implements JsonSerializable { + /* + * The resource of private end point. + */ + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between service consumer and provider. + */ + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** + * Creates an instance of PrivateEndpointConnectionProperties class. + */ + public PrivateEndpointConnectionProperties() { + } + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The resource of private end point. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property privateLinkServiceConnectionState in model PrivateEndpointConnectionProperties")); + } else { + privateLinkServiceConnectionState().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); + jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionProperties 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 PrivateEndpointConnectionProperties. + */ + public static PrivateEndpointConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionProperties deserializedPrivateEndpointConnectionProperties + = new PrivateEndpointConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateLinkServiceConnectionState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateLinkServiceConnectionState + = PrivateLinkServiceConnectionState.fromJson(reader); + } else if ("privateEndpoint".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateEndpoint = PrivateEndpoint.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.provisioningState + = PrivateEndpointConnectionProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateLinkResourceListResultInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateLinkResourceListResultInner.java new file mode 100644 index 0000000000000..d91ff05682249 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateLinkResourceListResultInner.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.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 com.azure.resourcemanager.storage.generated.models.PrivateLinkResource; +import java.io.IOException; +import java.util.List; + +/** + * A list of private link resources. + */ +@Fluent +public final class PrivateLinkResourceListResultInner implements JsonSerializable { + /* + * Array of private link resources + */ + private List value; + + /** + * Creates an instance of PrivateLinkResourceListResultInner class. + */ + public PrivateLinkResourceListResultInner() { + } + + /** + * Get the value property: Array of private link resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private link resources. + * + * @param value the value value to set. + * @return the PrivateLinkResourceListResultInner object itself. + */ + public PrivateLinkResourceListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceListResultInner 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 PrivateLinkResourceListResultInner. + */ + public static PrivateLinkResourceListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceListResultInner deserializedPrivateLinkResourceListResultInner + = new PrivateLinkResourceListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateLinkResource.fromJson(reader1)); + deserializedPrivateLinkResourceListResultInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceListResultInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateLinkResourceProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateLinkResourceProperties.java new file mode 100644 index 0000000000000..e07e85bf791bc --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateLinkResourceProperties.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.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.List; + +/** + * Properties of a private link resource. + */ +@Fluent +public final class PrivateLinkResourceProperties implements JsonSerializable { + /* + * The private link resource group id. + */ + private String groupId; + + /* + * The private link resource required member names. + */ + private List requiredMembers; + + /* + * The private link resource Private link DNS zone name. + */ + private List requiredZoneNames; + + /** + * Creates an instance of PrivateLinkResourceProperties class. + */ + public PrivateLinkResourceProperties() { + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + 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.writeArrayField("requiredZoneNames", this.requiredZoneNames, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceProperties 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 PrivateLinkResourceProperties. + */ + public static PrivateLinkResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceProperties deserializedPrivateLinkResourceProperties + = new PrivateLinkResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupId".equals(fieldName)) { + deserializedPrivateLinkResourceProperties.groupId = reader.getString(); + } else if ("requiredMembers".equals(fieldName)) { + List requiredMembers = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredMembers = requiredMembers; + } else if ("requiredZoneNames".equals(fieldName)) { + List requiredZoneNames = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredZoneNames = requiredZoneNames; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/QueueProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/QueueProperties.java new file mode 100644 index 0000000000000..f8e84164d7d69 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/QueueProperties.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.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 QueueProperties model. + */ +@Fluent +public final class QueueProperties implements JsonSerializable { + /* + * A name-value pair that represents queue metadata. + */ + private Map metadata; + + /* + * Integer indicating an approximate number of messages in the queue. This number is not lower than the actual + * number of messages in the queue, but could be higher. + */ + private Integer approximateMessageCount; + + /** + * Creates an instance of QueueProperties class. + */ + public QueueProperties() { + } + + /** + * Get the metadata property: A name-value pair that represents queue metadata. + * + * @return the metadata value. + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set the metadata property: A name-value pair that represents queue metadata. + * + * @param metadata the metadata value to set. + * @return the QueueProperties object itself. + */ + public QueueProperties withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the approximateMessageCount property: Integer indicating an approximate number of messages in the queue. This + * number is not lower than the actual number of messages in the queue, but could be higher. + * + * @return the approximateMessageCount value. + */ + public Integer approximateMessageCount() { + return this.approximateMessageCount; + } + + /** + * 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.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QueueProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QueueProperties 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 QueueProperties. + */ + public static QueueProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QueueProperties deserializedQueueProperties = new QueueProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedQueueProperties.metadata = metadata; + } else if ("approximateMessageCount".equals(fieldName)) { + deserializedQueueProperties.approximateMessageCount = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedQueueProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/QueueServicePropertiesInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/QueueServicePropertiesInner.java new file mode 100644 index 0000000000000..e3ee7d962b48c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/QueueServicePropertiesInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import java.io.IOException; + +/** + * The properties of a storage account’s Queue service. + */ +@Fluent +public final class QueueServicePropertiesInner extends ProxyResource { + /* + * The properties of a storage account’s Queue service. + */ + private QueueServicePropertiesProperties innerQueueServiceProperties; + + /* + * 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 QueueServicePropertiesInner class. + */ + public QueueServicePropertiesInner() { + } + + /** + * Get the innerQueueServiceProperties property: The properties of a storage account’s Queue service. + * + * @return the innerQueueServiceProperties value. + */ + private QueueServicePropertiesProperties innerQueueServiceProperties() { + return this.innerQueueServiceProperties; + } + + /** + * 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; + } + + /** + * Get the cors property: Specifies CORS rules for the Queue service. You can include up to five CorsRule elements + * in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and + * CORS will be disabled for the Queue service. + * + * @return the cors value. + */ + public CorsRules cors() { + return this.innerQueueServiceProperties() == null ? null : this.innerQueueServiceProperties().cors(); + } + + /** + * Set the cors property: Specifies CORS rules for the Queue service. You can include up to five CorsRule elements + * in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and + * CORS will be disabled for the Queue service. + * + * @param cors the cors value to set. + * @return the QueueServicePropertiesInner object itself. + */ + public QueueServicePropertiesInner withCors(CorsRules cors) { + if (this.innerQueueServiceProperties() == null) { + this.innerQueueServiceProperties = new QueueServicePropertiesProperties(); + } + this.innerQueueServiceProperties().withCors(cors); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerQueueServiceProperties() != null) { + innerQueueServiceProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerQueueServiceProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QueueServicePropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QueueServicePropertiesInner 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 QueueServicePropertiesInner. + */ + public static QueueServicePropertiesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QueueServicePropertiesInner deserializedQueueServicePropertiesInner = new QueueServicePropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedQueueServicePropertiesInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedQueueServicePropertiesInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedQueueServicePropertiesInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedQueueServicePropertiesInner.innerQueueServiceProperties + = QueueServicePropertiesProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedQueueServicePropertiesInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/QueueServicePropertiesProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/QueueServicePropertiesProperties.java new file mode 100644 index 0000000000000..d5e008d387f90 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/QueueServicePropertiesProperties.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.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 com.azure.resourcemanager.storage.generated.models.CorsRules; +import java.io.IOException; + +/** + * The properties of a storage account’s Queue service. + */ +@Fluent +public final class QueueServicePropertiesProperties implements JsonSerializable { + /* + * Specifies CORS rules for the Queue service. You can include up to five CorsRule elements in the request. If no + * CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for + * the Queue service. + */ + private CorsRules cors; + + /** + * Creates an instance of QueueServicePropertiesProperties class. + */ + public QueueServicePropertiesProperties() { + } + + /** + * Get the cors property: Specifies CORS rules for the Queue service. You can include up to five CorsRule elements + * in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and + * CORS will be disabled for the Queue service. + * + * @return the cors value. + */ + public CorsRules cors() { + return this.cors; + } + + /** + * Set the cors property: Specifies CORS rules for the Queue service. You can include up to five CorsRule elements + * in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and + * CORS will be disabled for the Queue service. + * + * @param cors the cors value to set. + * @return the QueueServicePropertiesProperties object itself. + */ + public QueueServicePropertiesProperties withCors(CorsRules cors) { + this.cors = cors; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (cors() != null) { + cors().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("cors", this.cors); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QueueServicePropertiesProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QueueServicePropertiesProperties 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 QueueServicePropertiesProperties. + */ + public static QueueServicePropertiesProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QueueServicePropertiesProperties deserializedQueueServicePropertiesProperties + = new QueueServicePropertiesProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cors".equals(fieldName)) { + deserializedQueueServicePropertiesProperties.cors = CorsRules.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedQueueServicePropertiesProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/SkuInformationInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/SkuInformationInner.java new file mode 100644 index 0000000000000..dcb73ef78f0f4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/SkuInformationInner.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.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 com.azure.resourcemanager.storage.generated.models.Kind; +import com.azure.resourcemanager.storage.generated.models.Restriction; +import com.azure.resourcemanager.storage.generated.models.SkuCapability; +import com.azure.resourcemanager.storage.generated.models.SkuName; +import com.azure.resourcemanager.storage.generated.models.SkuTier; +import java.io.IOException; +import java.util.List; + +/** + * Storage SKU and its properties. + */ +@Fluent +public final class SkuInformationInner implements JsonSerializable { + /* + * The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was + * called accountType. + */ + private SkuName name; + + /* + * The SKU tier. This is based on the SKU name. + */ + private SkuTier tier; + + /* + * The type of the resource, usually it is 'storageAccounts'. + */ + private String resourceType; + + /* + * Indicates the type of storage account. + */ + private Kind kind; + + /* + * The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. + * West US, East US, Southeast Asia, etc.). + */ + private List locations; + + /* + * The capability information in the specified SKU, including file encryption, network ACLs, change notification, + * etc. + */ + private List capabilities; + + /* + * The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. + */ + private List restrictions; + + /** + * Creates an instance of SkuInformationInner class. + */ + public SkuInformationInner() { + } + + /** + * Get the name property: The SKU name. Required for account creation; optional for update. Note that in older + * versions, SKU name was called accountType. + * + * @return the name value. + */ + public SkuName name() { + return this.name; + } + + /** + * Set the name property: The SKU name. Required for account creation; optional for update. Note that in older + * versions, SKU name was called accountType. + * + * @param name the name value to set. + * @return the SkuInformationInner object itself. + */ + public SkuInformationInner withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The SKU tier. This is based on the SKU name. + * + * @return the tier value. + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Get the resourceType property: The type of the resource, usually it is 'storageAccounts'. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the kind property: Indicates the type of storage account. + * + * @return the kind value. + */ + public Kind kind() { + return this.kind; + } + + /** + * Get the locations property: The set of locations that the SKU is available. This will be supported and registered + * Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Get the capabilities property: The capability information in the specified SKU, including file encryption, + * network ACLs, change notification, etc. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Get the restrictions property: The restrictions because of which SKU cannot be used. This is empty if there are + * no restrictions. + * + * @return the restrictions value. + */ + public List restrictions() { + return this.restrictions; + } + + /** + * Set the restrictions property: The restrictions because of which SKU cannot be used. This is empty if there are + * no restrictions. + * + * @param restrictions the restrictions value to set. + * @return the SkuInformationInner object itself. + */ + public SkuInformationInner withRestrictions(List restrictions) { + this.restrictions = restrictions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model SkuInformationInner")); + } + if (capabilities() != null) { + capabilities().forEach(e -> e.validate()); + } + if (restrictions() != null) { + restrictions().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SkuInformationInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + jsonWriter.writeArrayField("restrictions", this.restrictions, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SkuInformationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SkuInformationInner 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 SkuInformationInner. + */ + public static SkuInformationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SkuInformationInner deserializedSkuInformationInner = new SkuInformationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSkuInformationInner.name = SkuName.fromString(reader.getString()); + } else if ("tier".equals(fieldName)) { + deserializedSkuInformationInner.tier = SkuTier.fromString(reader.getString()); + } else if ("resourceType".equals(fieldName)) { + deserializedSkuInformationInner.resourceType = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedSkuInformationInner.kind = Kind.fromString(reader.getString()); + } else if ("locations".equals(fieldName)) { + List locations = reader.readArray(reader1 -> reader1.getString()); + deserializedSkuInformationInner.locations = locations; + } else if ("capabilities".equals(fieldName)) { + List capabilities = reader.readArray(reader1 -> SkuCapability.fromJson(reader1)); + deserializedSkuInformationInner.capabilities = capabilities; + } else if ("restrictions".equals(fieldName)) { + List restrictions = reader.readArray(reader1 -> Restriction.fromJson(reader1)); + deserializedSkuInformationInner.restrictions = restrictions; + } else { + reader.skipChildren(); + } + } + + return deserializedSkuInformationInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountInner.java new file mode 100644 index 0000000000000..4abd2cd31dc33 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountInner.java @@ -0,0 +1,974 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.storage.generated.models.AccessTier; +import com.azure.resourcemanager.storage.generated.models.AccountStatus; +import com.azure.resourcemanager.storage.generated.models.AllowedCopyScope; +import com.azure.resourcemanager.storage.generated.models.AzureFilesIdentityBasedAuthentication; +import com.azure.resourcemanager.storage.generated.models.CustomDomain; +import com.azure.resourcemanager.storage.generated.models.DnsEndpointType; +import com.azure.resourcemanager.storage.generated.models.Encryption; +import com.azure.resourcemanager.storage.generated.models.Endpoints; +import com.azure.resourcemanager.storage.generated.models.ExtendedLocation; +import com.azure.resourcemanager.storage.generated.models.GeoReplicationStats; +import com.azure.resourcemanager.storage.generated.models.Identity; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageAccount; +import com.azure.resourcemanager.storage.generated.models.KeyCreationTime; +import com.azure.resourcemanager.storage.generated.models.KeyPolicy; +import com.azure.resourcemanager.storage.generated.models.Kind; +import com.azure.resourcemanager.storage.generated.models.LargeFileSharesState; +import com.azure.resourcemanager.storage.generated.models.MinimumTlsVersion; +import com.azure.resourcemanager.storage.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.storage.generated.models.ProvisioningState; +import com.azure.resourcemanager.storage.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.storage.generated.models.RoutingPreference; +import com.azure.resourcemanager.storage.generated.models.SasPolicy; +import com.azure.resourcemanager.storage.generated.models.Sku; +import com.azure.resourcemanager.storage.generated.models.StorageAccountSkuConversionStatus; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * The storage account. + */ +@Fluent +public final class StorageAccountInner extends Resource { + /* + * Gets the SKU. + */ + private Sku sku; + + /* + * Gets the Kind. + */ + private Kind kind; + + /* + * The identity of the resource. + */ + private Identity identity; + + /* + * The extendedLocation of the resource. + */ + private ExtendedLocation extendedLocation; + + /* + * Properties of the storage account. + */ + private StorageAccountPropertiesInner innerProperties; + + /* + * 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 StorageAccountInner class. + */ + public StorageAccountInner() { + } + + /** + * Get the sku property: Gets the SKU. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Get the kind property: Gets the Kind. + * + * @return the kind value. + */ + public Kind kind() { + return this.kind; + } + + /** + * Get the identity property: The identity of the resource. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the resource. + * + * @param identity the identity value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get the extendedLocation property: The extendedLocation of the resource. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extendedLocation of the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the innerProperties property: Properties of the storage account. + * + * @return the innerProperties value. + */ + private StorageAccountPropertiesInner innerProperties() { + return this.innerProperties; + } + + /** + * 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 StorageAccountInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public StorageAccountInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: Gets the status of the storage account at the time the operation was called. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the primaryEndpoints property: Gets the URLs that are used to perform a retrieval of a public blob, queue, or + * table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob endpoint. + * + * @return the primaryEndpoints value. + */ + public Endpoints primaryEndpoints() { + return this.innerProperties() == null ? null : this.innerProperties().primaryEndpoints(); + } + + /** + * Get the primaryLocation property: Gets the location of the primary data center for the storage account. + * + * @return the primaryLocation value. + */ + public String primaryLocation() { + return this.innerProperties() == null ? null : this.innerProperties().primaryLocation(); + } + + /** + * Get the statusOfPrimary property: Gets the status indicating whether the primary location of the storage account + * is available or unavailable. + * + * @return the statusOfPrimary value. + */ + public AccountStatus statusOfPrimary() { + return this.innerProperties() == null ? null : this.innerProperties().statusOfPrimary(); + } + + /** + * Get the lastGeoFailoverTime property: Gets the timestamp of the most recent instance of a failover to the + * secondary location. Only the most recent timestamp is retained. This element is not returned if there has never + * been a failover instance. Only available if the accountType is Standard_GRS or Standard_RAGRS. + * + * @return the lastGeoFailoverTime value. + */ + public OffsetDateTime lastGeoFailoverTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastGeoFailoverTime(); + } + + /** + * Get the secondaryLocation property: Gets the location of the geo-replicated secondary for the storage account. + * Only available if the accountType is Standard_GRS or Standard_RAGRS. + * + * @return the secondaryLocation value. + */ + public String secondaryLocation() { + return this.innerProperties() == null ? null : this.innerProperties().secondaryLocation(); + } + + /** + * Get the statusOfSecondary property: Gets the status indicating whether the secondary location of the storage + * account is available or unavailable. Only available if the SKU name is Standard_GRS or Standard_RAGRS. + * + * @return the statusOfSecondary value. + */ + public AccountStatus statusOfSecondary() { + return this.innerProperties() == null ? null : this.innerProperties().statusOfSecondary(); + } + + /** + * Get the creationTime property: Gets the creation date and time of the storage account in UTC. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.innerProperties() == null ? null : this.innerProperties().creationTime(); + } + + /** + * Get the customDomain property: Gets the custom domain the user assigned to this storage account. + * + * @return the customDomain value. + */ + public CustomDomain customDomain() { + return this.innerProperties() == null ? null : this.innerProperties().customDomain(); + } + + /** + * Get the sasPolicy property: SasPolicy assigned to the storage account. + * + * @return the sasPolicy value. + */ + public SasPolicy sasPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().sasPolicy(); + } + + /** + * Get the keyPolicy property: KeyPolicy assigned to the storage account. + * + * @return the keyPolicy value. + */ + public KeyPolicy keyPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().keyPolicy(); + } + + /** + * Get the keyCreationTime property: Storage account keys creation time. + * + * @return the keyCreationTime value. + */ + public KeyCreationTime keyCreationTime() { + return this.innerProperties() == null ? null : this.innerProperties().keyCreationTime(); + } + + /** + * Get the secondaryEndpoints property: Gets the URLs that are used to perform a retrieval of a public blob, queue, + * or table object from the secondary location of the storage account. Only available if the SKU name is + * Standard_RAGRS. + * + * @return the secondaryEndpoints value. + */ + public Endpoints secondaryEndpoints() { + return this.innerProperties() == null ? null : this.innerProperties().secondaryEndpoints(); + } + + /** + * Get the encryption property: Encryption settings to be used for server-side encryption for the storage account. + * + * @return the encryption value. + */ + public Encryption encryption() { + return this.innerProperties() == null ? null : this.innerProperties().encryption(); + } + + /** + * Get the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier is used for + * billing. The 'Premium' access tier is the default value for premium block blobs storage account type and it + * cannot be changed for the premium block blobs storage account type. + * + * @return the accessTier value. + */ + public AccessTier accessTier() { + return this.innerProperties() == null ? null : this.innerProperties().accessTier(); + } + + /** + * Get the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @return the azureFilesIdentityBasedAuthentication value. + */ + public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { + return this.innerProperties() == null ? null : this.innerProperties().azureFilesIdentityBasedAuthentication(); + } + + /** + * Set the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @param azureFilesIdentityBasedAuthentication the azureFilesIdentityBasedAuthentication value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withAzureFilesIdentityBasedAuthentication( + AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withAzureFilesIdentityBasedAuthentication(azureFilesIdentityBasedAuthentication); + return this; + } + + /** + * Get the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. + * + * @return the enableHttpsTrafficOnly value. + */ + public Boolean enableHttpsTrafficOnly() { + return this.innerProperties() == null ? null : this.innerProperties().enableHttpsTrafficOnly(); + } + + /** + * Set the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. + * + * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withEnableHttpsTrafficOnly(enableHttpsTrafficOnly); + return this; + } + + /** + * Get the networkRuleSet property: Network rule set. + * + * @return the networkRuleSet value. + */ + public NetworkRuleSet networkRuleSet() { + return this.innerProperties() == null ? null : this.innerProperties().networkRuleSet(); + } + + /** + * Get the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @return the isSftpEnabled value. + */ + public Boolean isSftpEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isSftpEnabled(); + } + + /** + * Set the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @param isSftpEnabled the isSftpEnabled value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withIsSftpEnabled(Boolean isSftpEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withIsSftpEnabled(isSftpEnabled); + return this; + } + + /** + * Get the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @return the isLocalUserEnabled value. + */ + public Boolean isLocalUserEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isLocalUserEnabled(); + } + + /** + * Set the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @param isLocalUserEnabled the isLocalUserEnabled value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withIsLocalUserEnabled(Boolean isLocalUserEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withIsLocalUserEnabled(isLocalUserEnabled); + return this; + } + + /** + * Get the enableExtendedGroups property: Enables extended group support with local users feature, if set to true. + * + * @return the enableExtendedGroups value. + */ + public Boolean enableExtendedGroups() { + return this.innerProperties() == null ? null : this.innerProperties().enableExtendedGroups(); + } + + /** + * Set the enableExtendedGroups property: Enables extended group support with local users feature, if set to true. + * + * @param enableExtendedGroups the enableExtendedGroups value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withEnableExtendedGroups(Boolean enableExtendedGroups) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withEnableExtendedGroups(enableExtendedGroups); + return this; + } + + /** + * Get the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. + * + * @return the isHnsEnabled value. + */ + public Boolean isHnsEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isHnsEnabled(); + } + + /** + * Set the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. + * + * @param isHnsEnabled the isHnsEnabled value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withIsHnsEnabled(Boolean isHnsEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withIsHnsEnabled(isHnsEnabled); + return this; + } + + /** + * Get the geoReplicationStats property: Geo Replication Stats. + * + * @return the geoReplicationStats value. + */ + public GeoReplicationStats geoReplicationStats() { + return this.innerProperties() == null ? null : this.innerProperties().geoReplicationStats(); + } + + /** + * Get the failoverInProgress property: If the failover is in progress, the value will be true, otherwise, it will + * be null. + * + * @return the failoverInProgress value. + */ + public Boolean failoverInProgress() { + return this.innerProperties() == null ? null : this.innerProperties().failoverInProgress(); + } + + /** + * Get the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @return the largeFileSharesState value. + */ + public LargeFileSharesState largeFileSharesState() { + return this.innerProperties() == null ? null : this.innerProperties().largeFileSharesState(); + } + + /** + * Set the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @param largeFileSharesState the largeFileSharesState value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withLargeFileSharesState(LargeFileSharesState largeFileSharesState) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withLargeFileSharesState(largeFileSharesState); + return this; + } + + /** + * Get the privateEndpointConnections property: List of private endpoint connection associated with the specified + * storage account. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); + } + + /** + * Get the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @return the routingPreference value. + */ + public RoutingPreference routingPreference() { + return this.innerProperties() == null ? null : this.innerProperties().routingPreference(); + } + + /** + * Set the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @param routingPreference the routingPreference value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withRoutingPreference(RoutingPreference routingPreference) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withRoutingPreference(routingPreference); + return this; + } + + /** + * Get the blobRestoreStatus property: Blob restore status. + * + * @return the blobRestoreStatus value. + */ + public BlobRestoreStatusInner blobRestoreStatus() { + return this.innerProperties() == null ? null : this.innerProperties().blobRestoreStatus(); + } + + /** + * Get the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is false for this property. + * + * @return the allowBlobPublicAccess value. + */ + public Boolean allowBlobPublicAccess() { + return this.innerProperties() == null ? null : this.innerProperties().allowBlobPublicAccess(); + } + + /** + * Set the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is false for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withAllowBlobPublicAccess(allowBlobPublicAccess); + return this; + } + + /** + * Get the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @return the minimumTlsVersion value. + */ + public MinimumTlsVersion minimumTlsVersion() { + return this.innerProperties() == null ? null : this.innerProperties().minimumTlsVersion(); + } + + /** + * Set the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withMinimumTlsVersion(minimumTlsVersion); + return this; + } + + /** + * Get the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be authorized + * with the account access key via Shared Key. If false, then all requests, including shared access signatures, must + * be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. + * + * @return the allowSharedKeyAccess value. + */ + public Boolean allowSharedKeyAccess() { + return this.innerProperties() == null ? null : this.innerProperties().allowSharedKeyAccess(); + } + + /** + * Set the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be authorized + * with the account access key via Shared Key. If false, then all requests, including shared access signatures, must + * be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. + * + * @param allowSharedKeyAccess the allowSharedKeyAccess value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withAllowSharedKeyAccess(Boolean allowSharedKeyAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withAllowSharedKeyAccess(allowSharedKeyAccess); + return this; + } + + /** + * Get the enableNfsV3 property: NFS 3.0 protocol support enabled if set to true. + * + * @return the enableNfsV3 value. + */ + public Boolean enableNfsV3() { + return this.innerProperties() == null ? null : this.innerProperties().enableNfsV3(); + } + + /** + * Set the enableNfsV3 property: NFS 3.0 protocol support enabled if set to true. + * + * @param enableNfsV3 the enableNfsV3 value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withEnableNfsV3(Boolean enableNfsV3) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withEnableNfsV3(enableNfsV3); + return this; + } + + /** + * Get the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. Set this + * property to true for new or existing accounts only if object replication policies will involve storage accounts + * in different AAD tenants. The default interpretation is false for new accounts to follow best security practices + * by default. + * + * @return the allowCrossTenantReplication value. + */ + public Boolean allowCrossTenantReplication() { + return this.innerProperties() == null ? null : this.innerProperties().allowCrossTenantReplication(); + } + + /** + * Set the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. Set this + * property to true for new or existing accounts only if object replication policies will involve storage accounts + * in different AAD tenants. The default interpretation is false for new accounts to follow best security practices + * by default. + * + * @param allowCrossTenantReplication the allowCrossTenantReplication value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withAllowCrossTenantReplication(Boolean allowCrossTenantReplication) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withAllowCrossTenantReplication(allowCrossTenantReplication); + return this; + } + + /** + * Get the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @return the defaultToOAuthAuthentication value. + */ + public Boolean defaultToOAuthAuthentication() { + return this.innerProperties() == null ? null : this.innerProperties().defaultToOAuthAuthentication(); + } + + /** + * Set the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @param defaultToOAuthAuthentication the defaultToOAuthAuthentication value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withDefaultToOAuthAuthentication(Boolean defaultToOAuthAuthentication) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withDefaultToOAuthAuthentication(defaultToOAuthAuthentication); + return this; + } + + /** + * Get the publicNetworkAccess property: Allow, disallow, or let Network Security Perimeter configuration to + * evaluate public network access to Storage Account. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: Allow, disallow, or let Network Security Perimeter configuration to + * evaluate public network access to Storage Account. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Get the immutableStorageWithVersioning property: The property is immutable and can only be set to true at the + * account creation time. When set to true, it enables object level immutability for all the containers in the + * account by default. + * + * @return the immutableStorageWithVersioning value. + */ + public ImmutableStorageAccount immutableStorageWithVersioning() { + return this.innerProperties() == null ? null : this.innerProperties().immutableStorageWithVersioning(); + } + + /** + * Set the immutableStorageWithVersioning property: The property is immutable and can only be set to true at the + * account creation time. When set to true, it enables object level immutability for all the containers in the + * account by default. + * + * @param immutableStorageWithVersioning the immutableStorageWithVersioning value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner + withImmutableStorageWithVersioning(ImmutableStorageAccount immutableStorageWithVersioning) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withImmutableStorageWithVersioning(immutableStorageWithVersioning); + return this; + } + + /** + * Get the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @return the allowedCopyScope value. + */ + public AllowedCopyScope allowedCopyScope() { + return this.innerProperties() == null ? null : this.innerProperties().allowedCopyScope(); + } + + /** + * Set the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @param allowedCopyScope the allowedCopyScope value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withAllowedCopyScope(AllowedCopyScope allowedCopyScope) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withAllowedCopyScope(allowedCopyScope); + return this; + } + + /** + * Get the storageAccountSkuConversionStatus property: This property is readOnly and is set by server during + * asynchronous storage account sku conversion operations. + * + * @return the storageAccountSkuConversionStatus value. + */ + public StorageAccountSkuConversionStatus storageAccountSkuConversionStatus() { + return this.innerProperties() == null ? null : this.innerProperties().storageAccountSkuConversionStatus(); + } + + /** + * Set the storageAccountSkuConversionStatus property: This property is readOnly and is set by server during + * asynchronous storage account sku conversion operations. + * + * @param storageAccountSkuConversionStatus the storageAccountSkuConversionStatus value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner + withStorageAccountSkuConversionStatus(StorageAccountSkuConversionStatus storageAccountSkuConversionStatus) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withStorageAccountSkuConversionStatus(storageAccountSkuConversionStatus); + return this; + } + + /** + * Get the dnsEndpointType property: Allows you to specify the type of endpoint. Set this to AzureDNSZone to create + * a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint + * URL will have an alphanumeric DNS Zone identifier. + * + * @return the dnsEndpointType value. + */ + public DnsEndpointType dnsEndpointType() { + return this.innerProperties() == null ? null : this.innerProperties().dnsEndpointType(); + } + + /** + * Set the dnsEndpointType property: Allows you to specify the type of endpoint. Set this to AzureDNSZone to create + * a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint + * URL will have an alphanumeric DNS Zone identifier. + * + * @param dnsEndpointType the dnsEndpointType value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withDnsEndpointType(DnsEndpointType dnsEndpointType) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesInner(); + } + this.innerProperties().withDnsEndpointType(dnsEndpointType); + return this; + } + + /** + * Get the isSkuConversionBlocked property: This property will be set to true or false on an event of ongoing + * migration. Default value is null. + * + * @return the isSkuConversionBlocked value. + */ + public Boolean isSkuConversionBlocked() { + return this.innerProperties() == null ? null : this.innerProperties().isSkuConversionBlocked(); + } + + /** + * Get the accountMigrationInProgress property: If customer initiated account migration is in progress, the value + * will be true else it will be null. + * + * @return the accountMigrationInProgress value. + */ + public Boolean accountMigrationInProgress() { + return this.innerProperties() == null ? null : this.innerProperties().accountMigrationInProgress(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (innerProperties() != null) { + innerProperties().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("identity", this.identity); + jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountInner 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 StorageAccountInner. + */ + public static StorageAccountInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountInner deserializedStorageAccountInner = new StorageAccountInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedStorageAccountInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedStorageAccountInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedStorageAccountInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedStorageAccountInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedStorageAccountInner.withTags(tags); + } else if ("sku".equals(fieldName)) { + deserializedStorageAccountInner.sku = Sku.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedStorageAccountInner.kind = Kind.fromString(reader.getString()); + } else if ("identity".equals(fieldName)) { + deserializedStorageAccountInner.identity = Identity.fromJson(reader); + } else if ("extendedLocation".equals(fieldName)) { + deserializedStorageAccountInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedStorageAccountInner.innerProperties = StorageAccountPropertiesInner.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountListKeysResultInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountListKeysResultInner.java new file mode 100644 index 0000000000000..b105e40742523 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountListKeysResultInner.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.models.StorageAccountKey; +import java.io.IOException; +import java.util.List; + +/** + * The response from the ListKeys operation. + */ +@Immutable +public final class StorageAccountListKeysResultInner implements JsonSerializable { + /* + * Gets the list of storage account keys and their properties for the specified storage account. + */ + private List keys; + + /** + * Creates an instance of StorageAccountListKeysResultInner class. + */ + public StorageAccountListKeysResultInner() { + } + + /** + * Get the keys property: Gets the list of storage account keys and their properties for the specified storage + * account. + * + * @return the keys value. + */ + public List keys() { + return this.keys; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keys() != null) { + keys().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountListKeysResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountListKeysResultInner 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 StorageAccountListKeysResultInner. + */ + public static StorageAccountListKeysResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountListKeysResultInner deserializedStorageAccountListKeysResultInner + = new StorageAccountListKeysResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keys".equals(fieldName)) { + List keys = reader.readArray(reader1 -> StorageAccountKey.fromJson(reader1)); + deserializedStorageAccountListKeysResultInner.keys = keys; + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountListKeysResultInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountMigrationInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountMigrationInner.java new file mode 100644 index 0000000000000..2728a64e8bb91 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountMigrationInner.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.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 com.azure.resourcemanager.storage.generated.models.MigrationStatus; +import com.azure.resourcemanager.storage.generated.models.SkuName; +import java.io.IOException; + +/** + * The parameters or status associated with an ongoing or enqueued storage account migration in order to update its + * current SKU or region. + */ +@Fluent +public final class StorageAccountMigrationInner implements JsonSerializable { + /* + * Migration Resource Id + */ + private String id; + + /* + * current value is 'default' for customer initiated migration + */ + private String name; + + /* + * SrpAccountMigrationType in ARM contract which is 'accountMigrations' + */ + private String type; + + /* + * The properties of a storage account’s ongoing or enqueued migration. + */ + private StorageAccountMigrationProperties innerStorageAccountMigrationDetails + = new StorageAccountMigrationProperties(); + + /** + * Creates an instance of StorageAccountMigrationInner class. + */ + public StorageAccountMigrationInner() { + } + + /** + * Get the id property: Migration Resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: current value is 'default' for customer initiated migration. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: current value is 'default' for customer initiated migration. + * + * @param name the name value to set. + * @return the StorageAccountMigrationInner object itself. + */ + public StorageAccountMigrationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: SrpAccountMigrationType in ARM contract which is 'accountMigrations'. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: SrpAccountMigrationType in ARM contract which is 'accountMigrations'. + * + * @param type the type value to set. + * @return the StorageAccountMigrationInner object itself. + */ + public StorageAccountMigrationInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the innerStorageAccountMigrationDetails property: The properties of a storage account’s ongoing or enqueued + * migration. + * + * @return the innerStorageAccountMigrationDetails value. + */ + private StorageAccountMigrationProperties innerStorageAccountMigrationDetails() { + return this.innerStorageAccountMigrationDetails; + } + + /** + * Get the targetSkuName property: Target sku name for the account. + * + * @return the targetSkuName value. + */ + public SkuName targetSkuName() { + return this.innerStorageAccountMigrationDetails() == null + ? null + : this.innerStorageAccountMigrationDetails().targetSkuName(); + } + + /** + * Set the targetSkuName property: Target sku name for the account. + * + * @param targetSkuName the targetSkuName value to set. + * @return the StorageAccountMigrationInner object itself. + */ + public StorageAccountMigrationInner withTargetSkuName(SkuName targetSkuName) { + if (this.innerStorageAccountMigrationDetails() == null) { + this.innerStorageAccountMigrationDetails = new StorageAccountMigrationProperties(); + } + this.innerStorageAccountMigrationDetails().withTargetSkuName(targetSkuName); + return this; + } + + /** + * Get the migrationStatus property: Current status of migration. + * + * @return the migrationStatus value. + */ + public MigrationStatus migrationStatus() { + return this.innerStorageAccountMigrationDetails() == null + ? null + : this.innerStorageAccountMigrationDetails().migrationStatus(); + } + + /** + * Get the migrationFailedReason property: Error code for migration failure. + * + * @return the migrationFailedReason value. + */ + public String migrationFailedReason() { + return this.innerStorageAccountMigrationDetails() == null + ? null + : this.innerStorageAccountMigrationDetails().migrationFailedReason(); + } + + /** + * Get the migrationFailedDetailedReason property: Reason for migration failure. + * + * @return the migrationFailedDetailedReason value. + */ + public String migrationFailedDetailedReason() { + return this.innerStorageAccountMigrationDetails() == null + ? null + : this.innerStorageAccountMigrationDetails().migrationFailedDetailedReason(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerStorageAccountMigrationDetails() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerStorageAccountMigrationDetails in model StorageAccountMigrationInner")); + } else { + innerStorageAccountMigrationDetails().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageAccountMigrationInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerStorageAccountMigrationDetails); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountMigrationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountMigrationInner 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 StorageAccountMigrationInner. + */ + public static StorageAccountMigrationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountMigrationInner deserializedStorageAccountMigrationInner = new StorageAccountMigrationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedStorageAccountMigrationInner.innerStorageAccountMigrationDetails + = StorageAccountMigrationProperties.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedStorageAccountMigrationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedStorageAccountMigrationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedStorageAccountMigrationInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountMigrationInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountMigrationProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountMigrationProperties.java new file mode 100644 index 0000000000000..cef7d9a28da33 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountMigrationProperties.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.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 com.azure.resourcemanager.storage.generated.models.MigrationStatus; +import com.azure.resourcemanager.storage.generated.models.SkuName; +import java.io.IOException; + +/** + * The properties of a storage account’s ongoing or enqueued migration. + */ +@Fluent +public final class StorageAccountMigrationProperties implements JsonSerializable { + /* + * Target sku name for the account + */ + private SkuName targetSkuName; + + /* + * Current status of migration + */ + private MigrationStatus migrationStatus; + + /* + * Error code for migration failure + */ + private String migrationFailedReason; + + /* + * Reason for migration failure + */ + private String migrationFailedDetailedReason; + + /** + * Creates an instance of StorageAccountMigrationProperties class. + */ + public StorageAccountMigrationProperties() { + } + + /** + * Get the targetSkuName property: Target sku name for the account. + * + * @return the targetSkuName value. + */ + public SkuName targetSkuName() { + return this.targetSkuName; + } + + /** + * Set the targetSkuName property: Target sku name for the account. + * + * @param targetSkuName the targetSkuName value to set. + * @return the StorageAccountMigrationProperties object itself. + */ + public StorageAccountMigrationProperties withTargetSkuName(SkuName targetSkuName) { + this.targetSkuName = targetSkuName; + return this; + } + + /** + * Get the migrationStatus property: Current status of migration. + * + * @return the migrationStatus value. + */ + public MigrationStatus migrationStatus() { + return this.migrationStatus; + } + + /** + * Get the migrationFailedReason property: Error code for migration failure. + * + * @return the migrationFailedReason value. + */ + public String migrationFailedReason() { + return this.migrationFailedReason; + } + + /** + * Get the migrationFailedDetailedReason property: Reason for migration failure. + * + * @return the migrationFailedDetailedReason value. + */ + public String migrationFailedDetailedReason() { + return this.migrationFailedDetailedReason; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetSkuName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property targetSkuName in model StorageAccountMigrationProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageAccountMigrationProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetSkuName", this.targetSkuName == null ? null : this.targetSkuName.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountMigrationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountMigrationProperties 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 StorageAccountMigrationProperties. + */ + public static StorageAccountMigrationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountMigrationProperties deserializedStorageAccountMigrationProperties + = new StorageAccountMigrationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetSkuName".equals(fieldName)) { + deserializedStorageAccountMigrationProperties.targetSkuName + = SkuName.fromString(reader.getString()); + } else if ("migrationStatus".equals(fieldName)) { + deserializedStorageAccountMigrationProperties.migrationStatus + = MigrationStatus.fromString(reader.getString()); + } else if ("migrationFailedReason".equals(fieldName)) { + deserializedStorageAccountMigrationProperties.migrationFailedReason = reader.getString(); + } else if ("migrationFailedDetailedReason".equals(fieldName)) { + deserializedStorageAccountMigrationProperties.migrationFailedDetailedReason = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountMigrationProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountPropertiesCreateParameters.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountPropertiesCreateParameters.java new file mode 100644 index 0000000000000..cfdc3bc440eaa --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountPropertiesCreateParameters.java @@ -0,0 +1,869 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.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 com.azure.resourcemanager.storage.generated.models.AccessTier; +import com.azure.resourcemanager.storage.generated.models.AllowedCopyScope; +import com.azure.resourcemanager.storage.generated.models.AzureFilesIdentityBasedAuthentication; +import com.azure.resourcemanager.storage.generated.models.CustomDomain; +import com.azure.resourcemanager.storage.generated.models.DnsEndpointType; +import com.azure.resourcemanager.storage.generated.models.Encryption; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageAccount; +import com.azure.resourcemanager.storage.generated.models.KeyPolicy; +import com.azure.resourcemanager.storage.generated.models.LargeFileSharesState; +import com.azure.resourcemanager.storage.generated.models.MinimumTlsVersion; +import com.azure.resourcemanager.storage.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.storage.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.storage.generated.models.RoutingPreference; +import com.azure.resourcemanager.storage.generated.models.SasPolicy; +import java.io.IOException; + +/** + * The parameters used to create the storage account. + */ +@Fluent +public final class StorageAccountPropertiesCreateParameters + implements JsonSerializable { + /* + * Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + */ + private AllowedCopyScope allowedCopyScope; + + /* + * Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage + * Account. Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + */ + private PublicNetworkAccess publicNetworkAccess; + + /* + * SasPolicy assigned to the storage account. + */ + private SasPolicy sasPolicy; + + /* + * KeyPolicy assigned to the storage account. + */ + private KeyPolicy keyPolicy; + + /* + * User domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per + * storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name + * property. + */ + private CustomDomain customDomain; + + /* + * Encryption settings to be used for server-side encryption for the storage account. + */ + private Encryption encryption; + + /* + * Network rule set + */ + private NetworkRuleSet networkRuleSet; + + /* + * Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access + * tier is the default value for premium block blobs storage account type and it cannot be changed for the premium + * block blobs storage account type. + */ + private AccessTier accessTier; + + /* + * Provides the identity based authentication settings for Azure Files. + */ + private AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication; + + /* + * Allows https traffic only to storage service if sets to true. The default value is true since API version + * 2019-04-01. + */ + private Boolean enableHttpsTrafficOnly; + + /* + * Enables Secure File Transfer Protocol, if set to true + */ + private Boolean isSftpEnabled; + + /* + * Enables local users feature, if set to true + */ + private Boolean isLocalUserEnabled; + + /* + * Enables extended group support with local users feature, if set to true + */ + private Boolean enableExtendedGroups; + + /* + * Account HierarchicalNamespace enabled if sets to true. + */ + private Boolean isHnsEnabled; + + /* + * Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + */ + private LargeFileSharesState largeFileSharesState; + + /* + * Maintains information about the network routing choice opted by the user for data transfer + */ + private RoutingPreference routingPreference; + + /* + * Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is + * false for this property. + */ + private Boolean allowBlobPublicAccess; + + /* + * Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for + * this property. + */ + private MinimumTlsVersion minimumTlsVersion; + + /* + * Indicates whether the storage account permits requests to be authorized with the account access key via Shared + * Key. If false, then all requests, including shared access signatures, must be authorized with Azure Active + * Directory (Azure AD). The default value is null, which is equivalent to true. + */ + private Boolean allowSharedKeyAccess; + + /* + * NFS 3.0 protocol support enabled if set to true. + */ + private Boolean enableNfsV3; + + /* + * Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts + * only if object replication policies will involve storage accounts in different AAD tenants. The default + * interpretation is false for new accounts to follow best security practices by default. + */ + private Boolean allowCrossTenantReplication; + + /* + * A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is + * false for this property. + */ + private Boolean defaultToOAuthAuthentication; + + /* + * The property is immutable and can only be set to true at the account creation time. When set to true, it enables + * object level immutability for all the new containers in the account by default. + */ + private ImmutableStorageAccount immutableStorageWithVersioning; + + /* + * Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a + * single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric + * DNS Zone identifier. + */ + private DnsEndpointType dnsEndpointType; + + /** + * Creates an instance of StorageAccountPropertiesCreateParameters class. + */ + public StorageAccountPropertiesCreateParameters() { + } + + /** + * Get the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @return the allowedCopyScope value. + */ + public AllowedCopyScope allowedCopyScope() { + return this.allowedCopyScope; + } + + /** + * Set the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @param allowedCopyScope the allowedCopyScope value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withAllowedCopyScope(AllowedCopyScope allowedCopyScope) { + this.allowedCopyScope = allowedCopyScope; + return this; + } + + /** + * Get the publicNetworkAccess property: Allow, disallow, or let Network Security Perimeter configuration to + * evaluate public network access to Storage Account. Value is optional but if passed in, must be 'Enabled', + * 'Disabled' or 'SecuredByPerimeter'. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Allow, disallow, or let Network Security Perimeter configuration to + * evaluate public network access to Storage Account. Value is optional but if passed in, must be 'Enabled', + * 'Disabled' or 'SecuredByPerimeter'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the sasPolicy property: SasPolicy assigned to the storage account. + * + * @return the sasPolicy value. + */ + public SasPolicy sasPolicy() { + return this.sasPolicy; + } + + /** + * Set the sasPolicy property: SasPolicy assigned to the storage account. + * + * @param sasPolicy the sasPolicy value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withSasPolicy(SasPolicy sasPolicy) { + this.sasPolicy = sasPolicy; + return this; + } + + /** + * Get the keyPolicy property: KeyPolicy assigned to the storage account. + * + * @return the keyPolicy value. + */ + public KeyPolicy keyPolicy() { + return this.keyPolicy; + } + + /** + * Set the keyPolicy property: KeyPolicy assigned to the storage account. + * + * @param keyPolicy the keyPolicy value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withKeyPolicy(KeyPolicy keyPolicy) { + this.keyPolicy = keyPolicy; + return this; + } + + /** + * Get the customDomain property: User domain assigned to the storage account. Name is the CNAME source. Only one + * custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty + * string for the custom domain name property. + * + * @return the customDomain value. + */ + public CustomDomain customDomain() { + return this.customDomain; + } + + /** + * Set the customDomain property: User domain assigned to the storage account. Name is the CNAME source. Only one + * custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty + * string for the custom domain name property. + * + * @param customDomain the customDomain value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withCustomDomain(CustomDomain customDomain) { + this.customDomain = customDomain; + return this; + } + + /** + * Get the encryption property: Encryption settings to be used for server-side encryption for the storage account. + * + * @return the encryption value. + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Set the encryption property: Encryption settings to be used for server-side encryption for the storage account. + * + * @param encryption the encryption value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withEncryption(Encryption encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get the networkRuleSet property: Network rule set. + * + * @return the networkRuleSet value. + */ + public NetworkRuleSet networkRuleSet() { + return this.networkRuleSet; + } + + /** + * Set the networkRuleSet property: Network rule set. + * + * @param networkRuleSet the networkRuleSet value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + this.networkRuleSet = networkRuleSet; + return this; + } + + /** + * Get the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier is used for + * billing. The 'Premium' access tier is the default value for premium block blobs storage account type and it + * cannot be changed for the premium block blobs storage account type. + * + * @return the accessTier value. + */ + public AccessTier accessTier() { + return this.accessTier; + } + + /** + * Set the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier is used for + * billing. The 'Premium' access tier is the default value for premium block blobs storage account type and it + * cannot be changed for the premium block blobs storage account type. + * + * @param accessTier the accessTier value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withAccessTier(AccessTier accessTier) { + this.accessTier = accessTier; + return this; + } + + /** + * Get the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @return the azureFilesIdentityBasedAuthentication value. + */ + public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { + return this.azureFilesIdentityBasedAuthentication; + } + + /** + * Set the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @param azureFilesIdentityBasedAuthentication the azureFilesIdentityBasedAuthentication value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withAzureFilesIdentityBasedAuthentication( + AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { + this.azureFilesIdentityBasedAuthentication = azureFilesIdentityBasedAuthentication; + return this; + } + + /** + * Get the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. The + * default value is true since API version 2019-04-01. + * + * @return the enableHttpsTrafficOnly value. + */ + public Boolean enableHttpsTrafficOnly() { + return this.enableHttpsTrafficOnly; + } + + /** + * Set the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. The + * default value is true since API version 2019-04-01. + * + * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + this.enableHttpsTrafficOnly = enableHttpsTrafficOnly; + return this; + } + + /** + * Get the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @return the isSftpEnabled value. + */ + public Boolean isSftpEnabled() { + return this.isSftpEnabled; + } + + /** + * Set the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @param isSftpEnabled the isSftpEnabled value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withIsSftpEnabled(Boolean isSftpEnabled) { + this.isSftpEnabled = isSftpEnabled; + return this; + } + + /** + * Get the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @return the isLocalUserEnabled value. + */ + public Boolean isLocalUserEnabled() { + return this.isLocalUserEnabled; + } + + /** + * Set the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @param isLocalUserEnabled the isLocalUserEnabled value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withIsLocalUserEnabled(Boolean isLocalUserEnabled) { + this.isLocalUserEnabled = isLocalUserEnabled; + return this; + } + + /** + * Get the enableExtendedGroups property: Enables extended group support with local users feature, if set to true. + * + * @return the enableExtendedGroups value. + */ + public Boolean enableExtendedGroups() { + return this.enableExtendedGroups; + } + + /** + * Set the enableExtendedGroups property: Enables extended group support with local users feature, if set to true. + * + * @param enableExtendedGroups the enableExtendedGroups value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withEnableExtendedGroups(Boolean enableExtendedGroups) { + this.enableExtendedGroups = enableExtendedGroups; + return this; + } + + /** + * Get the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. + * + * @return the isHnsEnabled value. + */ + public Boolean isHnsEnabled() { + return this.isHnsEnabled; + } + + /** + * Set the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. + * + * @param isHnsEnabled the isHnsEnabled value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withIsHnsEnabled(Boolean isHnsEnabled) { + this.isHnsEnabled = isHnsEnabled; + return this; + } + + /** + * Get the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @return the largeFileSharesState value. + */ + public LargeFileSharesState largeFileSharesState() { + return this.largeFileSharesState; + } + + /** + * Set the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @param largeFileSharesState the largeFileSharesState value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters + withLargeFileSharesState(LargeFileSharesState largeFileSharesState) { + this.largeFileSharesState = largeFileSharesState; + return this; + } + + /** + * Get the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @return the routingPreference value. + */ + public RoutingPreference routingPreference() { + return this.routingPreference; + } + + /** + * Set the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @param routingPreference the routingPreference value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withRoutingPreference(RoutingPreference routingPreference) { + this.routingPreference = routingPreference; + return this; + } + + /** + * Get the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is false for this property. + * + * @return the allowBlobPublicAccess value. + */ + public Boolean allowBlobPublicAccess() { + return this.allowBlobPublicAccess; + } + + /** + * Set the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is false for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + this.allowBlobPublicAccess = allowBlobPublicAccess; + return this; + } + + /** + * Get the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @return the minimumTlsVersion value. + */ + public MinimumTlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + + /** + * Get the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be authorized + * with the account access key via Shared Key. If false, then all requests, including shared access signatures, must + * be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. + * + * @return the allowSharedKeyAccess value. + */ + public Boolean allowSharedKeyAccess() { + return this.allowSharedKeyAccess; + } + + /** + * Set the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be authorized + * with the account access key via Shared Key. If false, then all requests, including shared access signatures, must + * be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. + * + * @param allowSharedKeyAccess the allowSharedKeyAccess value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withAllowSharedKeyAccess(Boolean allowSharedKeyAccess) { + this.allowSharedKeyAccess = allowSharedKeyAccess; + return this; + } + + /** + * Get the enableNfsV3 property: NFS 3.0 protocol support enabled if set to true. + * + * @return the enableNfsV3 value. + */ + public Boolean enableNfsV3() { + return this.enableNfsV3; + } + + /** + * Set the enableNfsV3 property: NFS 3.0 protocol support enabled if set to true. + * + * @param enableNfsV3 the enableNfsV3 value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withEnableNfsV3(Boolean enableNfsV3) { + this.enableNfsV3 = enableNfsV3; + return this; + } + + /** + * Get the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. Set this + * property to true for new or existing accounts only if object replication policies will involve storage accounts + * in different AAD tenants. The default interpretation is false for new accounts to follow best security practices + * by default. + * + * @return the allowCrossTenantReplication value. + */ + public Boolean allowCrossTenantReplication() { + return this.allowCrossTenantReplication; + } + + /** + * Set the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. Set this + * property to true for new or existing accounts only if object replication policies will involve storage accounts + * in different AAD tenants. The default interpretation is false for new accounts to follow best security practices + * by default. + * + * @param allowCrossTenantReplication the allowCrossTenantReplication value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters + withAllowCrossTenantReplication(Boolean allowCrossTenantReplication) { + this.allowCrossTenantReplication = allowCrossTenantReplication; + return this; + } + + /** + * Get the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @return the defaultToOAuthAuthentication value. + */ + public Boolean defaultToOAuthAuthentication() { + return this.defaultToOAuthAuthentication; + } + + /** + * Set the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @param defaultToOAuthAuthentication the defaultToOAuthAuthentication value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters + withDefaultToOAuthAuthentication(Boolean defaultToOAuthAuthentication) { + this.defaultToOAuthAuthentication = defaultToOAuthAuthentication; + return this; + } + + /** + * Get the immutableStorageWithVersioning property: The property is immutable and can only be set to true at the + * account creation time. When set to true, it enables object level immutability for all the new containers in the + * account by default. + * + * @return the immutableStorageWithVersioning value. + */ + public ImmutableStorageAccount immutableStorageWithVersioning() { + return this.immutableStorageWithVersioning; + } + + /** + * Set the immutableStorageWithVersioning property: The property is immutable and can only be set to true at the + * account creation time. When set to true, it enables object level immutability for all the new containers in the + * account by default. + * + * @param immutableStorageWithVersioning the immutableStorageWithVersioning value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters + withImmutableStorageWithVersioning(ImmutableStorageAccount immutableStorageWithVersioning) { + this.immutableStorageWithVersioning = immutableStorageWithVersioning; + return this; + } + + /** + * Get the dnsEndpointType property: Allows you to specify the type of endpoint. Set this to AzureDNSZone to create + * a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint + * URL will have an alphanumeric DNS Zone identifier. + * + * @return the dnsEndpointType value. + */ + public DnsEndpointType dnsEndpointType() { + return this.dnsEndpointType; + } + + /** + * Set the dnsEndpointType property: Allows you to specify the type of endpoint. Set this to AzureDNSZone to create + * a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint + * URL will have an alphanumeric DNS Zone identifier. + * + * @param dnsEndpointType the dnsEndpointType value to set. + * @return the StorageAccountPropertiesCreateParameters object itself. + */ + public StorageAccountPropertiesCreateParameters withDnsEndpointType(DnsEndpointType dnsEndpointType) { + this.dnsEndpointType = dnsEndpointType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sasPolicy() != null) { + sasPolicy().validate(); + } + if (keyPolicy() != null) { + keyPolicy().validate(); + } + if (customDomain() != null) { + customDomain().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + if (networkRuleSet() != null) { + networkRuleSet().validate(); + } + if (azureFilesIdentityBasedAuthentication() != null) { + azureFilesIdentityBasedAuthentication().validate(); + } + if (routingPreference() != null) { + routingPreference().validate(); + } + if (immutableStorageWithVersioning() != null) { + immutableStorageWithVersioning().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("allowedCopyScope", + this.allowedCopyScope == null ? null : this.allowedCopyScope.toString()); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + jsonWriter.writeJsonField("sasPolicy", this.sasPolicy); + jsonWriter.writeJsonField("keyPolicy", this.keyPolicy); + jsonWriter.writeJsonField("customDomain", this.customDomain); + jsonWriter.writeJsonField("encryption", this.encryption); + jsonWriter.writeJsonField("networkAcls", this.networkRuleSet); + jsonWriter.writeStringField("accessTier", this.accessTier == null ? null : this.accessTier.toString()); + jsonWriter.writeJsonField("azureFilesIdentityBasedAuthentication", this.azureFilesIdentityBasedAuthentication); + jsonWriter.writeBooleanField("supportsHttpsTrafficOnly", this.enableHttpsTrafficOnly); + jsonWriter.writeBooleanField("isSftpEnabled", this.isSftpEnabled); + jsonWriter.writeBooleanField("isLocalUserEnabled", this.isLocalUserEnabled); + jsonWriter.writeBooleanField("enableExtendedGroups", this.enableExtendedGroups); + jsonWriter.writeBooleanField("isHnsEnabled", this.isHnsEnabled); + jsonWriter.writeStringField("largeFileSharesState", + this.largeFileSharesState == null ? null : this.largeFileSharesState.toString()); + jsonWriter.writeJsonField("routingPreference", this.routingPreference); + jsonWriter.writeBooleanField("allowBlobPublicAccess", this.allowBlobPublicAccess); + jsonWriter.writeStringField("minimumTlsVersion", + this.minimumTlsVersion == null ? null : this.minimumTlsVersion.toString()); + jsonWriter.writeBooleanField("allowSharedKeyAccess", this.allowSharedKeyAccess); + jsonWriter.writeBooleanField("isNfsV3Enabled", this.enableNfsV3); + jsonWriter.writeBooleanField("allowCrossTenantReplication", this.allowCrossTenantReplication); + jsonWriter.writeBooleanField("defaultToOAuthAuthentication", this.defaultToOAuthAuthentication); + jsonWriter.writeJsonField("immutableStorageWithVersioning", this.immutableStorageWithVersioning); + jsonWriter.writeStringField("dnsEndpointType", + this.dnsEndpointType == null ? null : this.dnsEndpointType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountPropertiesCreateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountPropertiesCreateParameters 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 StorageAccountPropertiesCreateParameters. + */ + public static StorageAccountPropertiesCreateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountPropertiesCreateParameters deserializedStorageAccountPropertiesCreateParameters + = new StorageAccountPropertiesCreateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowedCopyScope".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.allowedCopyScope + = AllowedCopyScope.fromString(reader.getString()); + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.publicNetworkAccess + = PublicNetworkAccess.fromString(reader.getString()); + } else if ("sasPolicy".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.sasPolicy = SasPolicy.fromJson(reader); + } else if ("keyPolicy".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.keyPolicy = KeyPolicy.fromJson(reader); + } else if ("customDomain".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.customDomain = CustomDomain.fromJson(reader); + } else if ("encryption".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.encryption = Encryption.fromJson(reader); + } else if ("networkAcls".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.networkRuleSet + = NetworkRuleSet.fromJson(reader); + } else if ("accessTier".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.accessTier + = AccessTier.fromString(reader.getString()); + } else if ("azureFilesIdentityBasedAuthentication".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.azureFilesIdentityBasedAuthentication + = AzureFilesIdentityBasedAuthentication.fromJson(reader); + } else if ("supportsHttpsTrafficOnly".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.enableHttpsTrafficOnly + = reader.getNullable(JsonReader::getBoolean); + } else if ("isSftpEnabled".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.isSftpEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("isLocalUserEnabled".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.isLocalUserEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableExtendedGroups".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.enableExtendedGroups + = reader.getNullable(JsonReader::getBoolean); + } else if ("isHnsEnabled".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.isHnsEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("largeFileSharesState".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.largeFileSharesState + = LargeFileSharesState.fromString(reader.getString()); + } else if ("routingPreference".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.routingPreference + = RoutingPreference.fromJson(reader); + } else if ("allowBlobPublicAccess".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.allowBlobPublicAccess + = reader.getNullable(JsonReader::getBoolean); + } else if ("minimumTlsVersion".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.minimumTlsVersion + = MinimumTlsVersion.fromString(reader.getString()); + } else if ("allowSharedKeyAccess".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.allowSharedKeyAccess + = reader.getNullable(JsonReader::getBoolean); + } else if ("isNfsV3Enabled".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.enableNfsV3 + = reader.getNullable(JsonReader::getBoolean); + } else if ("allowCrossTenantReplication".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.allowCrossTenantReplication + = reader.getNullable(JsonReader::getBoolean); + } else if ("defaultToOAuthAuthentication".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.defaultToOAuthAuthentication + = reader.getNullable(JsonReader::getBoolean); + } else if ("immutableStorageWithVersioning".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.immutableStorageWithVersioning + = ImmutableStorageAccount.fromJson(reader); + } else if ("dnsEndpointType".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.dnsEndpointType + = DnsEndpointType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountPropertiesCreateParameters; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountPropertiesInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountPropertiesInner.java new file mode 100644 index 0000000000000..52c16d01efa39 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountPropertiesInner.java @@ -0,0 +1,1123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.storage.generated.models.AccessTier; +import com.azure.resourcemanager.storage.generated.models.AccountStatus; +import com.azure.resourcemanager.storage.generated.models.AllowedCopyScope; +import com.azure.resourcemanager.storage.generated.models.AzureFilesIdentityBasedAuthentication; +import com.azure.resourcemanager.storage.generated.models.CustomDomain; +import com.azure.resourcemanager.storage.generated.models.DnsEndpointType; +import com.azure.resourcemanager.storage.generated.models.Encryption; +import com.azure.resourcemanager.storage.generated.models.Endpoints; +import com.azure.resourcemanager.storage.generated.models.GeoReplicationStats; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageAccount; +import com.azure.resourcemanager.storage.generated.models.KeyCreationTime; +import com.azure.resourcemanager.storage.generated.models.KeyPolicy; +import com.azure.resourcemanager.storage.generated.models.LargeFileSharesState; +import com.azure.resourcemanager.storage.generated.models.MinimumTlsVersion; +import com.azure.resourcemanager.storage.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.storage.generated.models.ProvisioningState; +import com.azure.resourcemanager.storage.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.storage.generated.models.RoutingPreference; +import com.azure.resourcemanager.storage.generated.models.SasPolicy; +import com.azure.resourcemanager.storage.generated.models.StorageAccountSkuConversionStatus; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Properties of the storage account. + */ +@Fluent +public final class StorageAccountPropertiesInner implements JsonSerializable { + /* + * Gets the status of the storage account at the time the operation was called. + */ + private ProvisioningState provisioningState; + + /* + * Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object. Note that + * Standard_ZRS and Premium_LRS accounts only return the blob endpoint. + */ + private Endpoints primaryEndpoints; + + /* + * Gets the location of the primary data center for the storage account. + */ + private String primaryLocation; + + /* + * Gets the status indicating whether the primary location of the storage account is available or unavailable. + */ + private AccountStatus statusOfPrimary; + + /* + * Gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent + * timestamp is retained. This element is not returned if there has never been a failover instance. Only available + * if the accountType is Standard_GRS or Standard_RAGRS. + */ + private OffsetDateTime lastGeoFailoverTime; + + /* + * Gets the location of the geo-replicated secondary for the storage account. Only available if the accountType is + * Standard_GRS or Standard_RAGRS. + */ + private String secondaryLocation; + + /* + * Gets the status indicating whether the secondary location of the storage account is available or unavailable. + * Only available if the SKU name is Standard_GRS or Standard_RAGRS. + */ + private AccountStatus statusOfSecondary; + + /* + * Gets the creation date and time of the storage account in UTC. + */ + private OffsetDateTime creationTime; + + /* + * Gets the custom domain the user assigned to this storage account. + */ + private CustomDomain customDomain; + + /* + * SasPolicy assigned to the storage account. + */ + private SasPolicy sasPolicy; + + /* + * KeyPolicy assigned to the storage account. + */ + private KeyPolicy keyPolicy; + + /* + * Storage account keys creation time. + */ + private KeyCreationTime keyCreationTime; + + /* + * Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object from the secondary + * location of the storage account. Only available if the SKU name is Standard_RAGRS. + */ + private Endpoints secondaryEndpoints; + + /* + * Encryption settings to be used for server-side encryption for the storage account. + */ + private Encryption encryption; + + /* + * Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access + * tier is the default value for premium block blobs storage account type and it cannot be changed for the premium + * block blobs storage account type. + */ + private AccessTier accessTier; + + /* + * Provides the identity based authentication settings for Azure Files. + */ + private AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication; + + /* + * Allows https traffic only to storage service if sets to true. + */ + private Boolean enableHttpsTrafficOnly; + + /* + * Network rule set + */ + private NetworkRuleSet networkRuleSet; + + /* + * Enables Secure File Transfer Protocol, if set to true + */ + private Boolean isSftpEnabled; + + /* + * Enables local users feature, if set to true + */ + private Boolean isLocalUserEnabled; + + /* + * Enables extended group support with local users feature, if set to true + */ + private Boolean enableExtendedGroups; + + /* + * Account HierarchicalNamespace enabled if sets to true. + */ + private Boolean isHnsEnabled; + + /* + * Geo Replication Stats + */ + private GeoReplicationStats geoReplicationStats; + + /* + * If the failover is in progress, the value will be true, otherwise, it will be null. + */ + private Boolean failoverInProgress; + + /* + * Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + */ + private LargeFileSharesState largeFileSharesState; + + /* + * List of private endpoint connection associated with the specified storage account + */ + private List privateEndpointConnections; + + /* + * Maintains information about the network routing choice opted by the user for data transfer + */ + private RoutingPreference routingPreference; + + /* + * Blob restore status + */ + private BlobRestoreStatusInner blobRestoreStatus; + + /* + * Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is + * false for this property. + */ + private Boolean allowBlobPublicAccess; + + /* + * Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for + * this property. + */ + private MinimumTlsVersion minimumTlsVersion; + + /* + * Indicates whether the storage account permits requests to be authorized with the account access key via Shared + * Key. If false, then all requests, including shared access signatures, must be authorized with Azure Active + * Directory (Azure AD). The default value is null, which is equivalent to true. + */ + private Boolean allowSharedKeyAccess; + + /* + * NFS 3.0 protocol support enabled if set to true. + */ + private Boolean enableNfsV3; + + /* + * Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts + * only if object replication policies will involve storage accounts in different AAD tenants. The default + * interpretation is false for new accounts to follow best security practices by default. + */ + private Boolean allowCrossTenantReplication; + + /* + * A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is + * false for this property. + */ + private Boolean defaultToOAuthAuthentication; + + /* + * Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage + * Account. + */ + private PublicNetworkAccess publicNetworkAccess; + + /* + * The property is immutable and can only be set to true at the account creation time. When set to true, it enables + * object level immutability for all the containers in the account by default. + */ + private ImmutableStorageAccount immutableStorageWithVersioning; + + /* + * Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + */ + private AllowedCopyScope allowedCopyScope; + + /* + * This property is readOnly and is set by server during asynchronous storage account sku conversion operations. + */ + private StorageAccountSkuConversionStatus storageAccountSkuConversionStatus; + + /* + * Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a + * single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric + * DNS Zone identifier. + */ + private DnsEndpointType dnsEndpointType; + + /* + * This property will be set to true or false on an event of ongoing migration. Default value is null. + */ + private Boolean isSkuConversionBlocked; + + /* + * If customer initiated account migration is in progress, the value will be true else it will be null. + */ + private Boolean accountMigrationInProgress; + + /** + * Creates an instance of StorageAccountPropertiesInner class. + */ + public StorageAccountPropertiesInner() { + } + + /** + * Get the provisioningState property: Gets the status of the storage account at the time the operation was called. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the primaryEndpoints property: Gets the URLs that are used to perform a retrieval of a public blob, queue, or + * table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob endpoint. + * + * @return the primaryEndpoints value. + */ + public Endpoints primaryEndpoints() { + return this.primaryEndpoints; + } + + /** + * Get the primaryLocation property: Gets the location of the primary data center for the storage account. + * + * @return the primaryLocation value. + */ + public String primaryLocation() { + return this.primaryLocation; + } + + /** + * Get the statusOfPrimary property: Gets the status indicating whether the primary location of the storage account + * is available or unavailable. + * + * @return the statusOfPrimary value. + */ + public AccountStatus statusOfPrimary() { + return this.statusOfPrimary; + } + + /** + * Get the lastGeoFailoverTime property: Gets the timestamp of the most recent instance of a failover to the + * secondary location. Only the most recent timestamp is retained. This element is not returned if there has never + * been a failover instance. Only available if the accountType is Standard_GRS or Standard_RAGRS. + * + * @return the lastGeoFailoverTime value. + */ + public OffsetDateTime lastGeoFailoverTime() { + return this.lastGeoFailoverTime; + } + + /** + * Get the secondaryLocation property: Gets the location of the geo-replicated secondary for the storage account. + * Only available if the accountType is Standard_GRS or Standard_RAGRS. + * + * @return the secondaryLocation value. + */ + public String secondaryLocation() { + return this.secondaryLocation; + } + + /** + * Get the statusOfSecondary property: Gets the status indicating whether the secondary location of the storage + * account is available or unavailable. Only available if the SKU name is Standard_GRS or Standard_RAGRS. + * + * @return the statusOfSecondary value. + */ + public AccountStatus statusOfSecondary() { + return this.statusOfSecondary; + } + + /** + * Get the creationTime property: Gets the creation date and time of the storage account in UTC. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Get the customDomain property: Gets the custom domain the user assigned to this storage account. + * + * @return the customDomain value. + */ + public CustomDomain customDomain() { + return this.customDomain; + } + + /** + * Get the sasPolicy property: SasPolicy assigned to the storage account. + * + * @return the sasPolicy value. + */ + public SasPolicy sasPolicy() { + return this.sasPolicy; + } + + /** + * Get the keyPolicy property: KeyPolicy assigned to the storage account. + * + * @return the keyPolicy value. + */ + public KeyPolicy keyPolicy() { + return this.keyPolicy; + } + + /** + * Get the keyCreationTime property: Storage account keys creation time. + * + * @return the keyCreationTime value. + */ + public KeyCreationTime keyCreationTime() { + return this.keyCreationTime; + } + + /** + * Get the secondaryEndpoints property: Gets the URLs that are used to perform a retrieval of a public blob, queue, + * or table object from the secondary location of the storage account. Only available if the SKU name is + * Standard_RAGRS. + * + * @return the secondaryEndpoints value. + */ + public Endpoints secondaryEndpoints() { + return this.secondaryEndpoints; + } + + /** + * Get the encryption property: Encryption settings to be used for server-side encryption for the storage account. + * + * @return the encryption value. + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Get the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier is used for + * billing. The 'Premium' access tier is the default value for premium block blobs storage account type and it + * cannot be changed for the premium block blobs storage account type. + * + * @return the accessTier value. + */ + public AccessTier accessTier() { + return this.accessTier; + } + + /** + * Get the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @return the azureFilesIdentityBasedAuthentication value. + */ + public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { + return this.azureFilesIdentityBasedAuthentication; + } + + /** + * Set the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @param azureFilesIdentityBasedAuthentication the azureFilesIdentityBasedAuthentication value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withAzureFilesIdentityBasedAuthentication( + AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { + this.azureFilesIdentityBasedAuthentication = azureFilesIdentityBasedAuthentication; + return this; + } + + /** + * Get the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. + * + * @return the enableHttpsTrafficOnly value. + */ + public Boolean enableHttpsTrafficOnly() { + return this.enableHttpsTrafficOnly; + } + + /** + * Set the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. + * + * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + this.enableHttpsTrafficOnly = enableHttpsTrafficOnly; + return this; + } + + /** + * Get the networkRuleSet property: Network rule set. + * + * @return the networkRuleSet value. + */ + public NetworkRuleSet networkRuleSet() { + return this.networkRuleSet; + } + + /** + * Get the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @return the isSftpEnabled value. + */ + public Boolean isSftpEnabled() { + return this.isSftpEnabled; + } + + /** + * Set the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @param isSftpEnabled the isSftpEnabled value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withIsSftpEnabled(Boolean isSftpEnabled) { + this.isSftpEnabled = isSftpEnabled; + return this; + } + + /** + * Get the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @return the isLocalUserEnabled value. + */ + public Boolean isLocalUserEnabled() { + return this.isLocalUserEnabled; + } + + /** + * Set the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @param isLocalUserEnabled the isLocalUserEnabled value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withIsLocalUserEnabled(Boolean isLocalUserEnabled) { + this.isLocalUserEnabled = isLocalUserEnabled; + return this; + } + + /** + * Get the enableExtendedGroups property: Enables extended group support with local users feature, if set to true. + * + * @return the enableExtendedGroups value. + */ + public Boolean enableExtendedGroups() { + return this.enableExtendedGroups; + } + + /** + * Set the enableExtendedGroups property: Enables extended group support with local users feature, if set to true. + * + * @param enableExtendedGroups the enableExtendedGroups value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withEnableExtendedGroups(Boolean enableExtendedGroups) { + this.enableExtendedGroups = enableExtendedGroups; + return this; + } + + /** + * Get the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. + * + * @return the isHnsEnabled value. + */ + public Boolean isHnsEnabled() { + return this.isHnsEnabled; + } + + /** + * Set the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. + * + * @param isHnsEnabled the isHnsEnabled value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withIsHnsEnabled(Boolean isHnsEnabled) { + this.isHnsEnabled = isHnsEnabled; + return this; + } + + /** + * Get the geoReplicationStats property: Geo Replication Stats. + * + * @return the geoReplicationStats value. + */ + public GeoReplicationStats geoReplicationStats() { + return this.geoReplicationStats; + } + + /** + * Get the failoverInProgress property: If the failover is in progress, the value will be true, otherwise, it will + * be null. + * + * @return the failoverInProgress value. + */ + public Boolean failoverInProgress() { + return this.failoverInProgress; + } + + /** + * Get the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @return the largeFileSharesState value. + */ + public LargeFileSharesState largeFileSharesState() { + return this.largeFileSharesState; + } + + /** + * Set the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @param largeFileSharesState the largeFileSharesState value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withLargeFileSharesState(LargeFileSharesState largeFileSharesState) { + this.largeFileSharesState = largeFileSharesState; + return this; + } + + /** + * Get the privateEndpointConnections property: List of private endpoint connection associated with the specified + * storage account. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Get the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @return the routingPreference value. + */ + public RoutingPreference routingPreference() { + return this.routingPreference; + } + + /** + * Set the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @param routingPreference the routingPreference value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withRoutingPreference(RoutingPreference routingPreference) { + this.routingPreference = routingPreference; + return this; + } + + /** + * Get the blobRestoreStatus property: Blob restore status. + * + * @return the blobRestoreStatus value. + */ + public BlobRestoreStatusInner blobRestoreStatus() { + return this.blobRestoreStatus; + } + + /** + * Get the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is false for this property. + * + * @return the allowBlobPublicAccess value. + */ + public Boolean allowBlobPublicAccess() { + return this.allowBlobPublicAccess; + } + + /** + * Set the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is false for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + this.allowBlobPublicAccess = allowBlobPublicAccess; + return this; + } + + /** + * Get the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @return the minimumTlsVersion value. + */ + public MinimumTlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + + /** + * Get the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be authorized + * with the account access key via Shared Key. If false, then all requests, including shared access signatures, must + * be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. + * + * @return the allowSharedKeyAccess value. + */ + public Boolean allowSharedKeyAccess() { + return this.allowSharedKeyAccess; + } + + /** + * Set the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be authorized + * with the account access key via Shared Key. If false, then all requests, including shared access signatures, must + * be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. + * + * @param allowSharedKeyAccess the allowSharedKeyAccess value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withAllowSharedKeyAccess(Boolean allowSharedKeyAccess) { + this.allowSharedKeyAccess = allowSharedKeyAccess; + return this; + } + + /** + * Get the enableNfsV3 property: NFS 3.0 protocol support enabled if set to true. + * + * @return the enableNfsV3 value. + */ + public Boolean enableNfsV3() { + return this.enableNfsV3; + } + + /** + * Set the enableNfsV3 property: NFS 3.0 protocol support enabled if set to true. + * + * @param enableNfsV3 the enableNfsV3 value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withEnableNfsV3(Boolean enableNfsV3) { + this.enableNfsV3 = enableNfsV3; + return this; + } + + /** + * Get the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. Set this + * property to true for new or existing accounts only if object replication policies will involve storage accounts + * in different AAD tenants. The default interpretation is false for new accounts to follow best security practices + * by default. + * + * @return the allowCrossTenantReplication value. + */ + public Boolean allowCrossTenantReplication() { + return this.allowCrossTenantReplication; + } + + /** + * Set the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. Set this + * property to true for new or existing accounts only if object replication policies will involve storage accounts + * in different AAD tenants. The default interpretation is false for new accounts to follow best security practices + * by default. + * + * @param allowCrossTenantReplication the allowCrossTenantReplication value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withAllowCrossTenantReplication(Boolean allowCrossTenantReplication) { + this.allowCrossTenantReplication = allowCrossTenantReplication; + return this; + } + + /** + * Get the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @return the defaultToOAuthAuthentication value. + */ + public Boolean defaultToOAuthAuthentication() { + return this.defaultToOAuthAuthentication; + } + + /** + * Set the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @param defaultToOAuthAuthentication the defaultToOAuthAuthentication value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withDefaultToOAuthAuthentication(Boolean defaultToOAuthAuthentication) { + this.defaultToOAuthAuthentication = defaultToOAuthAuthentication; + return this; + } + + /** + * Get the publicNetworkAccess property: Allow, disallow, or let Network Security Perimeter configuration to + * evaluate public network access to Storage Account. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Allow, disallow, or let Network Security Perimeter configuration to + * evaluate public network access to Storage Account. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the immutableStorageWithVersioning property: The property is immutable and can only be set to true at the + * account creation time. When set to true, it enables object level immutability for all the containers in the + * account by default. + * + * @return the immutableStorageWithVersioning value. + */ + public ImmutableStorageAccount immutableStorageWithVersioning() { + return this.immutableStorageWithVersioning; + } + + /** + * Set the immutableStorageWithVersioning property: The property is immutable and can only be set to true at the + * account creation time. When set to true, it enables object level immutability for all the containers in the + * account by default. + * + * @param immutableStorageWithVersioning the immutableStorageWithVersioning value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner + withImmutableStorageWithVersioning(ImmutableStorageAccount immutableStorageWithVersioning) { + this.immutableStorageWithVersioning = immutableStorageWithVersioning; + return this; + } + + /** + * Get the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @return the allowedCopyScope value. + */ + public AllowedCopyScope allowedCopyScope() { + return this.allowedCopyScope; + } + + /** + * Set the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @param allowedCopyScope the allowedCopyScope value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withAllowedCopyScope(AllowedCopyScope allowedCopyScope) { + this.allowedCopyScope = allowedCopyScope; + return this; + } + + /** + * Get the storageAccountSkuConversionStatus property: This property is readOnly and is set by server during + * asynchronous storage account sku conversion operations. + * + * @return the storageAccountSkuConversionStatus value. + */ + public StorageAccountSkuConversionStatus storageAccountSkuConversionStatus() { + return this.storageAccountSkuConversionStatus; + } + + /** + * Set the storageAccountSkuConversionStatus property: This property is readOnly and is set by server during + * asynchronous storage account sku conversion operations. + * + * @param storageAccountSkuConversionStatus the storageAccountSkuConversionStatus value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner + withStorageAccountSkuConversionStatus(StorageAccountSkuConversionStatus storageAccountSkuConversionStatus) { + this.storageAccountSkuConversionStatus = storageAccountSkuConversionStatus; + return this; + } + + /** + * Get the dnsEndpointType property: Allows you to specify the type of endpoint. Set this to AzureDNSZone to create + * a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint + * URL will have an alphanumeric DNS Zone identifier. + * + * @return the dnsEndpointType value. + */ + public DnsEndpointType dnsEndpointType() { + return this.dnsEndpointType; + } + + /** + * Set the dnsEndpointType property: Allows you to specify the type of endpoint. Set this to AzureDNSZone to create + * a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint + * URL will have an alphanumeric DNS Zone identifier. + * + * @param dnsEndpointType the dnsEndpointType value to set. + * @return the StorageAccountPropertiesInner object itself. + */ + public StorageAccountPropertiesInner withDnsEndpointType(DnsEndpointType dnsEndpointType) { + this.dnsEndpointType = dnsEndpointType; + return this; + } + + /** + * Get the isSkuConversionBlocked property: This property will be set to true or false on an event of ongoing + * migration. Default value is null. + * + * @return the isSkuConversionBlocked value. + */ + public Boolean isSkuConversionBlocked() { + return this.isSkuConversionBlocked; + } + + /** + * Get the accountMigrationInProgress property: If customer initiated account migration is in progress, the value + * will be true else it will be null. + * + * @return the accountMigrationInProgress value. + */ + public Boolean accountMigrationInProgress() { + return this.accountMigrationInProgress; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (primaryEndpoints() != null) { + primaryEndpoints().validate(); + } + if (customDomain() != null) { + customDomain().validate(); + } + if (sasPolicy() != null) { + sasPolicy().validate(); + } + if (keyPolicy() != null) { + keyPolicy().validate(); + } + if (keyCreationTime() != null) { + keyCreationTime().validate(); + } + if (secondaryEndpoints() != null) { + secondaryEndpoints().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + if (azureFilesIdentityBasedAuthentication() != null) { + azureFilesIdentityBasedAuthentication().validate(); + } + if (networkRuleSet() != null) { + networkRuleSet().validate(); + } + if (geoReplicationStats() != null) { + geoReplicationStats().validate(); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + if (routingPreference() != null) { + routingPreference().validate(); + } + if (blobRestoreStatus() != null) { + blobRestoreStatus().validate(); + } + if (immutableStorageWithVersioning() != null) { + immutableStorageWithVersioning().validate(); + } + if (storageAccountSkuConversionStatus() != null) { + storageAccountSkuConversionStatus().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("azureFilesIdentityBasedAuthentication", this.azureFilesIdentityBasedAuthentication); + jsonWriter.writeBooleanField("supportsHttpsTrafficOnly", this.enableHttpsTrafficOnly); + jsonWriter.writeBooleanField("isSftpEnabled", this.isSftpEnabled); + jsonWriter.writeBooleanField("isLocalUserEnabled", this.isLocalUserEnabled); + jsonWriter.writeBooleanField("enableExtendedGroups", this.enableExtendedGroups); + jsonWriter.writeBooleanField("isHnsEnabled", this.isHnsEnabled); + jsonWriter.writeStringField("largeFileSharesState", + this.largeFileSharesState == null ? null : this.largeFileSharesState.toString()); + jsonWriter.writeJsonField("routingPreference", this.routingPreference); + jsonWriter.writeBooleanField("allowBlobPublicAccess", this.allowBlobPublicAccess); + jsonWriter.writeStringField("minimumTlsVersion", + this.minimumTlsVersion == null ? null : this.minimumTlsVersion.toString()); + jsonWriter.writeBooleanField("allowSharedKeyAccess", this.allowSharedKeyAccess); + jsonWriter.writeBooleanField("isNfsV3Enabled", this.enableNfsV3); + jsonWriter.writeBooleanField("allowCrossTenantReplication", this.allowCrossTenantReplication); + jsonWriter.writeBooleanField("defaultToOAuthAuthentication", this.defaultToOAuthAuthentication); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + jsonWriter.writeJsonField("immutableStorageWithVersioning", this.immutableStorageWithVersioning); + jsonWriter.writeStringField("allowedCopyScope", + this.allowedCopyScope == null ? null : this.allowedCopyScope.toString()); + jsonWriter.writeJsonField("storageAccountSkuConversionStatus", this.storageAccountSkuConversionStatus); + jsonWriter.writeStringField("dnsEndpointType", + this.dnsEndpointType == null ? null : this.dnsEndpointType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountPropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountPropertiesInner 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 StorageAccountPropertiesInner. + */ + public static StorageAccountPropertiesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountPropertiesInner deserializedStorageAccountPropertiesInner + = new StorageAccountPropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("primaryEndpoints".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.primaryEndpoints = Endpoints.fromJson(reader); + } else if ("primaryLocation".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.primaryLocation = reader.getString(); + } else if ("statusOfPrimary".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.statusOfPrimary + = AccountStatus.fromString(reader.getString()); + } else if ("lastGeoFailoverTime".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.lastGeoFailoverTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("secondaryLocation".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.secondaryLocation = reader.getString(); + } else if ("statusOfSecondary".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.statusOfSecondary + = AccountStatus.fromString(reader.getString()); + } else if ("creationTime".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.creationTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("customDomain".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.customDomain = CustomDomain.fromJson(reader); + } else if ("sasPolicy".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.sasPolicy = SasPolicy.fromJson(reader); + } else if ("keyPolicy".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.keyPolicy = KeyPolicy.fromJson(reader); + } else if ("keyCreationTime".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.keyCreationTime = KeyCreationTime.fromJson(reader); + } else if ("secondaryEndpoints".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.secondaryEndpoints = Endpoints.fromJson(reader); + } else if ("encryption".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.encryption = Encryption.fromJson(reader); + } else if ("accessTier".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.accessTier = AccessTier.fromString(reader.getString()); + } else if ("azureFilesIdentityBasedAuthentication".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.azureFilesIdentityBasedAuthentication + = AzureFilesIdentityBasedAuthentication.fromJson(reader); + } else if ("supportsHttpsTrafficOnly".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.enableHttpsTrafficOnly + = reader.getNullable(JsonReader::getBoolean); + } else if ("networkAcls".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.networkRuleSet = NetworkRuleSet.fromJson(reader); + } else if ("isSftpEnabled".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.isSftpEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("isLocalUserEnabled".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.isLocalUserEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableExtendedGroups".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.enableExtendedGroups + = reader.getNullable(JsonReader::getBoolean); + } else if ("isHnsEnabled".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.isHnsEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("geoReplicationStats".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.geoReplicationStats + = GeoReplicationStats.fromJson(reader); + } else if ("failoverInProgress".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.failoverInProgress + = reader.getNullable(JsonReader::getBoolean); + } else if ("largeFileSharesState".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.largeFileSharesState + = LargeFileSharesState.fromString(reader.getString()); + } else if ("privateEndpointConnections".equals(fieldName)) { + List privateEndpointConnections + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedStorageAccountPropertiesInner.privateEndpointConnections = privateEndpointConnections; + } else if ("routingPreference".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.routingPreference = RoutingPreference.fromJson(reader); + } else if ("blobRestoreStatus".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.blobRestoreStatus + = BlobRestoreStatusInner.fromJson(reader); + } else if ("allowBlobPublicAccess".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.allowBlobPublicAccess + = reader.getNullable(JsonReader::getBoolean); + } else if ("minimumTlsVersion".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.minimumTlsVersion + = MinimumTlsVersion.fromString(reader.getString()); + } else if ("allowSharedKeyAccess".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.allowSharedKeyAccess + = reader.getNullable(JsonReader::getBoolean); + } else if ("isNfsV3Enabled".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.enableNfsV3 = reader.getNullable(JsonReader::getBoolean); + } else if ("allowCrossTenantReplication".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.allowCrossTenantReplication + = reader.getNullable(JsonReader::getBoolean); + } else if ("defaultToOAuthAuthentication".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.defaultToOAuthAuthentication + = reader.getNullable(JsonReader::getBoolean); + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.publicNetworkAccess + = PublicNetworkAccess.fromString(reader.getString()); + } else if ("immutableStorageWithVersioning".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.immutableStorageWithVersioning + = ImmutableStorageAccount.fromJson(reader); + } else if ("allowedCopyScope".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.allowedCopyScope + = AllowedCopyScope.fromString(reader.getString()); + } else if ("storageAccountSkuConversionStatus".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.storageAccountSkuConversionStatus + = StorageAccountSkuConversionStatus.fromJson(reader); + } else if ("dnsEndpointType".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.dnsEndpointType + = DnsEndpointType.fromString(reader.getString()); + } else if ("isSkuConversionBlocked".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.isSkuConversionBlocked + = reader.getNullable(JsonReader::getBoolean); + } else if ("accountMigrationInProgress".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.accountMigrationInProgress + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountPropertiesInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountPropertiesUpdateParameters.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountPropertiesUpdateParameters.java new file mode 100644 index 0000000000000..12bb900fd2365 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountPropertiesUpdateParameters.java @@ -0,0 +1,811 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.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 com.azure.resourcemanager.storage.generated.models.AccessTier; +import com.azure.resourcemanager.storage.generated.models.AllowedCopyScope; +import com.azure.resourcemanager.storage.generated.models.AzureFilesIdentityBasedAuthentication; +import com.azure.resourcemanager.storage.generated.models.CustomDomain; +import com.azure.resourcemanager.storage.generated.models.DnsEndpointType; +import com.azure.resourcemanager.storage.generated.models.Encryption; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageAccount; +import com.azure.resourcemanager.storage.generated.models.KeyPolicy; +import com.azure.resourcemanager.storage.generated.models.LargeFileSharesState; +import com.azure.resourcemanager.storage.generated.models.MinimumTlsVersion; +import com.azure.resourcemanager.storage.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.storage.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.storage.generated.models.RoutingPreference; +import com.azure.resourcemanager.storage.generated.models.SasPolicy; +import java.io.IOException; + +/** + * The parameters used when updating a storage account. + */ +@Fluent +public final class StorageAccountPropertiesUpdateParameters + implements JsonSerializable { + /* + * Custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is + * supported per storage account at this time. To clear the existing custom domain, use an empty string for the + * custom domain name property. + */ + private CustomDomain customDomain; + + /* + * Not applicable. Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be + * disabled. + */ + private Encryption encryption; + + /* + * SasPolicy assigned to the storage account. + */ + private SasPolicy sasPolicy; + + /* + * KeyPolicy assigned to the storage account. + */ + private KeyPolicy keyPolicy; + + /* + * Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access + * tier is the default value for premium block blobs storage account type and it cannot be changed for the premium + * block blobs storage account type. + */ + private AccessTier accessTier; + + /* + * Provides the identity based authentication settings for Azure Files. + */ + private AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication; + + /* + * Allows https traffic only to storage service if sets to true. + */ + private Boolean enableHttpsTrafficOnly; + + /* + * Enables Secure File Transfer Protocol, if set to true + */ + private Boolean isSftpEnabled; + + /* + * Enables local users feature, if set to true + */ + private Boolean isLocalUserEnabled; + + /* + * Enables extended group support with local users feature, if set to true + */ + private Boolean enableExtendedGroups; + + /* + * Network rule set + */ + private NetworkRuleSet networkRuleSet; + + /* + * Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + */ + private LargeFileSharesState largeFileSharesState; + + /* + * Maintains information about the network routing choice opted by the user for data transfer + */ + private RoutingPreference routingPreference; + + /* + * Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is + * false for this property. + */ + private Boolean allowBlobPublicAccess; + + /* + * Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for + * this property. + */ + private MinimumTlsVersion minimumTlsVersion; + + /* + * Indicates whether the storage account permits requests to be authorized with the account access key via Shared + * Key. If false, then all requests, including shared access signatures, must be authorized with Azure Active + * Directory (Azure AD). The default value is null, which is equivalent to true. + */ + private Boolean allowSharedKeyAccess; + + /* + * Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts + * only if object replication policies will involve storage accounts in different AAD tenants. The default + * interpretation is false for new accounts to follow best security practices by default. + */ + private Boolean allowCrossTenantReplication; + + /* + * A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is + * false for this property. + */ + private Boolean defaultToOAuthAuthentication; + + /* + * Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage + * Account. Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + */ + private PublicNetworkAccess publicNetworkAccess; + + /* + * The property is immutable and can only be set to true at the account creation time. When set to true, it enables + * object level immutability for all the containers in the account by default. + */ + private ImmutableStorageAccount immutableStorageWithVersioning; + + /* + * Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + */ + private AllowedCopyScope allowedCopyScope; + + /* + * Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a + * single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric + * DNS Zone identifier. + */ + private DnsEndpointType dnsEndpointType; + + /** + * Creates an instance of StorageAccountPropertiesUpdateParameters class. + */ + public StorageAccountPropertiesUpdateParameters() { + } + + /** + * Get the customDomain property: Custom domain assigned to the storage account by the user. Name is the CNAME + * source. Only one custom domain is supported per storage account at this time. To clear the existing custom + * domain, use an empty string for the custom domain name property. + * + * @return the customDomain value. + */ + public CustomDomain customDomain() { + return this.customDomain; + } + + /** + * Set the customDomain property: Custom domain assigned to the storage account by the user. Name is the CNAME + * source. Only one custom domain is supported per storage account at this time. To clear the existing custom + * domain, use an empty string for the custom domain name property. + * + * @param customDomain the customDomain value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withCustomDomain(CustomDomain customDomain) { + this.customDomain = customDomain; + return this; + } + + /** + * Get the encryption property: Not applicable. Azure Storage encryption at rest is enabled by default for all + * storage accounts and cannot be disabled. + * + * @return the encryption value. + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Set the encryption property: Not applicable. Azure Storage encryption at rest is enabled by default for all + * storage accounts and cannot be disabled. + * + * @param encryption the encryption value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withEncryption(Encryption encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get the sasPolicy property: SasPolicy assigned to the storage account. + * + * @return the sasPolicy value. + */ + public SasPolicy sasPolicy() { + return this.sasPolicy; + } + + /** + * Set the sasPolicy property: SasPolicy assigned to the storage account. + * + * @param sasPolicy the sasPolicy value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withSasPolicy(SasPolicy sasPolicy) { + this.sasPolicy = sasPolicy; + return this; + } + + /** + * Get the keyPolicy property: KeyPolicy assigned to the storage account. + * + * @return the keyPolicy value. + */ + public KeyPolicy keyPolicy() { + return this.keyPolicy; + } + + /** + * Set the keyPolicy property: KeyPolicy assigned to the storage account. + * + * @param keyPolicy the keyPolicy value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withKeyPolicy(KeyPolicy keyPolicy) { + this.keyPolicy = keyPolicy; + return this; + } + + /** + * Get the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier is used for + * billing. The 'Premium' access tier is the default value for premium block blobs storage account type and it + * cannot be changed for the premium block blobs storage account type. + * + * @return the accessTier value. + */ + public AccessTier accessTier() { + return this.accessTier; + } + + /** + * Set the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier is used for + * billing. The 'Premium' access tier is the default value for premium block blobs storage account type and it + * cannot be changed for the premium block blobs storage account type. + * + * @param accessTier the accessTier value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withAccessTier(AccessTier accessTier) { + this.accessTier = accessTier; + return this; + } + + /** + * Get the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @return the azureFilesIdentityBasedAuthentication value. + */ + public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { + return this.azureFilesIdentityBasedAuthentication; + } + + /** + * Set the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @param azureFilesIdentityBasedAuthentication the azureFilesIdentityBasedAuthentication value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withAzureFilesIdentityBasedAuthentication( + AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { + this.azureFilesIdentityBasedAuthentication = azureFilesIdentityBasedAuthentication; + return this; + } + + /** + * Get the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. + * + * @return the enableHttpsTrafficOnly value. + */ + public Boolean enableHttpsTrafficOnly() { + return this.enableHttpsTrafficOnly; + } + + /** + * Set the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. + * + * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + this.enableHttpsTrafficOnly = enableHttpsTrafficOnly; + return this; + } + + /** + * Get the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @return the isSftpEnabled value. + */ + public Boolean isSftpEnabled() { + return this.isSftpEnabled; + } + + /** + * Set the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @param isSftpEnabled the isSftpEnabled value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withIsSftpEnabled(Boolean isSftpEnabled) { + this.isSftpEnabled = isSftpEnabled; + return this; + } + + /** + * Get the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @return the isLocalUserEnabled value. + */ + public Boolean isLocalUserEnabled() { + return this.isLocalUserEnabled; + } + + /** + * Set the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @param isLocalUserEnabled the isLocalUserEnabled value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withIsLocalUserEnabled(Boolean isLocalUserEnabled) { + this.isLocalUserEnabled = isLocalUserEnabled; + return this; + } + + /** + * Get the enableExtendedGroups property: Enables extended group support with local users feature, if set to true. + * + * @return the enableExtendedGroups value. + */ + public Boolean enableExtendedGroups() { + return this.enableExtendedGroups; + } + + /** + * Set the enableExtendedGroups property: Enables extended group support with local users feature, if set to true. + * + * @param enableExtendedGroups the enableExtendedGroups value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withEnableExtendedGroups(Boolean enableExtendedGroups) { + this.enableExtendedGroups = enableExtendedGroups; + return this; + } + + /** + * Get the networkRuleSet property: Network rule set. + * + * @return the networkRuleSet value. + */ + public NetworkRuleSet networkRuleSet() { + return this.networkRuleSet; + } + + /** + * Set the networkRuleSet property: Network rule set. + * + * @param networkRuleSet the networkRuleSet value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + this.networkRuleSet = networkRuleSet; + return this; + } + + /** + * Get the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @return the largeFileSharesState value. + */ + public LargeFileSharesState largeFileSharesState() { + return this.largeFileSharesState; + } + + /** + * Set the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @param largeFileSharesState the largeFileSharesState value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters + withLargeFileSharesState(LargeFileSharesState largeFileSharesState) { + this.largeFileSharesState = largeFileSharesState; + return this; + } + + /** + * Get the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @return the routingPreference value. + */ + public RoutingPreference routingPreference() { + return this.routingPreference; + } + + /** + * Set the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @param routingPreference the routingPreference value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withRoutingPreference(RoutingPreference routingPreference) { + this.routingPreference = routingPreference; + return this; + } + + /** + * Get the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is false for this property. + * + * @return the allowBlobPublicAccess value. + */ + public Boolean allowBlobPublicAccess() { + return this.allowBlobPublicAccess; + } + + /** + * Set the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is false for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + this.allowBlobPublicAccess = allowBlobPublicAccess; + return this; + } + + /** + * Get the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @return the minimumTlsVersion value. + */ + public MinimumTlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + + /** + * Get the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be authorized + * with the account access key via Shared Key. If false, then all requests, including shared access signatures, must + * be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. + * + * @return the allowSharedKeyAccess value. + */ + public Boolean allowSharedKeyAccess() { + return this.allowSharedKeyAccess; + } + + /** + * Set the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be authorized + * with the account access key via Shared Key. If false, then all requests, including shared access signatures, must + * be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. + * + * @param allowSharedKeyAccess the allowSharedKeyAccess value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withAllowSharedKeyAccess(Boolean allowSharedKeyAccess) { + this.allowSharedKeyAccess = allowSharedKeyAccess; + return this; + } + + /** + * Get the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. Set this + * property to true for new or existing accounts only if object replication policies will involve storage accounts + * in different AAD tenants. The default interpretation is false for new accounts to follow best security practices + * by default. + * + * @return the allowCrossTenantReplication value. + */ + public Boolean allowCrossTenantReplication() { + return this.allowCrossTenantReplication; + } + + /** + * Set the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. Set this + * property to true for new or existing accounts only if object replication policies will involve storage accounts + * in different AAD tenants. The default interpretation is false for new accounts to follow best security practices + * by default. + * + * @param allowCrossTenantReplication the allowCrossTenantReplication value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters + withAllowCrossTenantReplication(Boolean allowCrossTenantReplication) { + this.allowCrossTenantReplication = allowCrossTenantReplication; + return this; + } + + /** + * Get the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @return the defaultToOAuthAuthentication value. + */ + public Boolean defaultToOAuthAuthentication() { + return this.defaultToOAuthAuthentication; + } + + /** + * Set the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @param defaultToOAuthAuthentication the defaultToOAuthAuthentication value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters + withDefaultToOAuthAuthentication(Boolean defaultToOAuthAuthentication) { + this.defaultToOAuthAuthentication = defaultToOAuthAuthentication; + return this; + } + + /** + * Get the publicNetworkAccess property: Allow, disallow, or let Network Security Perimeter configuration to + * evaluate public network access to Storage Account. Value is optional but if passed in, must be 'Enabled', + * 'Disabled' or 'SecuredByPerimeter'. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Allow, disallow, or let Network Security Perimeter configuration to + * evaluate public network access to Storage Account. Value is optional but if passed in, must be 'Enabled', + * 'Disabled' or 'SecuredByPerimeter'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the immutableStorageWithVersioning property: The property is immutable and can only be set to true at the + * account creation time. When set to true, it enables object level immutability for all the containers in the + * account by default. + * + * @return the immutableStorageWithVersioning value. + */ + public ImmutableStorageAccount immutableStorageWithVersioning() { + return this.immutableStorageWithVersioning; + } + + /** + * Set the immutableStorageWithVersioning property: The property is immutable and can only be set to true at the + * account creation time. When set to true, it enables object level immutability for all the containers in the + * account by default. + * + * @param immutableStorageWithVersioning the immutableStorageWithVersioning value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters + withImmutableStorageWithVersioning(ImmutableStorageAccount immutableStorageWithVersioning) { + this.immutableStorageWithVersioning = immutableStorageWithVersioning; + return this; + } + + /** + * Get the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @return the allowedCopyScope value. + */ + public AllowedCopyScope allowedCopyScope() { + return this.allowedCopyScope; + } + + /** + * Set the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @param allowedCopyScope the allowedCopyScope value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withAllowedCopyScope(AllowedCopyScope allowedCopyScope) { + this.allowedCopyScope = allowedCopyScope; + return this; + } + + /** + * Get the dnsEndpointType property: Allows you to specify the type of endpoint. Set this to AzureDNSZone to create + * a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint + * URL will have an alphanumeric DNS Zone identifier. + * + * @return the dnsEndpointType value. + */ + public DnsEndpointType dnsEndpointType() { + return this.dnsEndpointType; + } + + /** + * Set the dnsEndpointType property: Allows you to specify the type of endpoint. Set this to AzureDNSZone to create + * a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint + * URL will have an alphanumeric DNS Zone identifier. + * + * @param dnsEndpointType the dnsEndpointType value to set. + * @return the StorageAccountPropertiesUpdateParameters object itself. + */ + public StorageAccountPropertiesUpdateParameters withDnsEndpointType(DnsEndpointType dnsEndpointType) { + this.dnsEndpointType = dnsEndpointType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (customDomain() != null) { + customDomain().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + if (sasPolicy() != null) { + sasPolicy().validate(); + } + if (keyPolicy() != null) { + keyPolicy().validate(); + } + if (azureFilesIdentityBasedAuthentication() != null) { + azureFilesIdentityBasedAuthentication().validate(); + } + if (networkRuleSet() != null) { + networkRuleSet().validate(); + } + if (routingPreference() != null) { + routingPreference().validate(); + } + if (immutableStorageWithVersioning() != null) { + immutableStorageWithVersioning().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("customDomain", this.customDomain); + jsonWriter.writeJsonField("encryption", this.encryption); + jsonWriter.writeJsonField("sasPolicy", this.sasPolicy); + jsonWriter.writeJsonField("keyPolicy", this.keyPolicy); + jsonWriter.writeStringField("accessTier", this.accessTier == null ? null : this.accessTier.toString()); + jsonWriter.writeJsonField("azureFilesIdentityBasedAuthentication", this.azureFilesIdentityBasedAuthentication); + jsonWriter.writeBooleanField("supportsHttpsTrafficOnly", this.enableHttpsTrafficOnly); + jsonWriter.writeBooleanField("isSftpEnabled", this.isSftpEnabled); + jsonWriter.writeBooleanField("isLocalUserEnabled", this.isLocalUserEnabled); + jsonWriter.writeBooleanField("enableExtendedGroups", this.enableExtendedGroups); + jsonWriter.writeJsonField("networkAcls", this.networkRuleSet); + jsonWriter.writeStringField("largeFileSharesState", + this.largeFileSharesState == null ? null : this.largeFileSharesState.toString()); + jsonWriter.writeJsonField("routingPreference", this.routingPreference); + jsonWriter.writeBooleanField("allowBlobPublicAccess", this.allowBlobPublicAccess); + jsonWriter.writeStringField("minimumTlsVersion", + this.minimumTlsVersion == null ? null : this.minimumTlsVersion.toString()); + jsonWriter.writeBooleanField("allowSharedKeyAccess", this.allowSharedKeyAccess); + jsonWriter.writeBooleanField("allowCrossTenantReplication", this.allowCrossTenantReplication); + jsonWriter.writeBooleanField("defaultToOAuthAuthentication", this.defaultToOAuthAuthentication); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + jsonWriter.writeJsonField("immutableStorageWithVersioning", this.immutableStorageWithVersioning); + jsonWriter.writeStringField("allowedCopyScope", + this.allowedCopyScope == null ? null : this.allowedCopyScope.toString()); + jsonWriter.writeStringField("dnsEndpointType", + this.dnsEndpointType == null ? null : this.dnsEndpointType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountPropertiesUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountPropertiesUpdateParameters 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 StorageAccountPropertiesUpdateParameters. + */ + public static StorageAccountPropertiesUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountPropertiesUpdateParameters deserializedStorageAccountPropertiesUpdateParameters + = new StorageAccountPropertiesUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("customDomain".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.customDomain = CustomDomain.fromJson(reader); + } else if ("encryption".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.encryption = Encryption.fromJson(reader); + } else if ("sasPolicy".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.sasPolicy = SasPolicy.fromJson(reader); + } else if ("keyPolicy".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.keyPolicy = KeyPolicy.fromJson(reader); + } else if ("accessTier".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.accessTier + = AccessTier.fromString(reader.getString()); + } else if ("azureFilesIdentityBasedAuthentication".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.azureFilesIdentityBasedAuthentication + = AzureFilesIdentityBasedAuthentication.fromJson(reader); + } else if ("supportsHttpsTrafficOnly".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.enableHttpsTrafficOnly + = reader.getNullable(JsonReader::getBoolean); + } else if ("isSftpEnabled".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.isSftpEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("isLocalUserEnabled".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.isLocalUserEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableExtendedGroups".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.enableExtendedGroups + = reader.getNullable(JsonReader::getBoolean); + } else if ("networkAcls".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.networkRuleSet + = NetworkRuleSet.fromJson(reader); + } else if ("largeFileSharesState".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.largeFileSharesState + = LargeFileSharesState.fromString(reader.getString()); + } else if ("routingPreference".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.routingPreference + = RoutingPreference.fromJson(reader); + } else if ("allowBlobPublicAccess".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.allowBlobPublicAccess + = reader.getNullable(JsonReader::getBoolean); + } else if ("minimumTlsVersion".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.minimumTlsVersion + = MinimumTlsVersion.fromString(reader.getString()); + } else if ("allowSharedKeyAccess".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.allowSharedKeyAccess + = reader.getNullable(JsonReader::getBoolean); + } else if ("allowCrossTenantReplication".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.allowCrossTenantReplication + = reader.getNullable(JsonReader::getBoolean); + } else if ("defaultToOAuthAuthentication".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.defaultToOAuthAuthentication + = reader.getNullable(JsonReader::getBoolean); + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.publicNetworkAccess + = PublicNetworkAccess.fromString(reader.getString()); + } else if ("immutableStorageWithVersioning".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.immutableStorageWithVersioning + = ImmutableStorageAccount.fromJson(reader); + } else if ("allowedCopyScope".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.allowedCopyScope + = AllowedCopyScope.fromString(reader.getString()); + } else if ("dnsEndpointType".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.dnsEndpointType + = DnsEndpointType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountPropertiesUpdateParameters; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageQueueInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageQueueInner.java new file mode 100644 index 0000000000000..1ff25cc464c1c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageQueueInner.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The StorageQueue model. + */ +@Fluent +public final class StorageQueueInner extends ProxyResource { + /* + * Queue resource properties. + */ + private QueueProperties innerQueueProperties; + + /* + * 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 StorageQueueInner class. + */ + public StorageQueueInner() { + } + + /** + * Get the innerQueueProperties property: Queue resource properties. + * + * @return the innerQueueProperties value. + */ + private QueueProperties innerQueueProperties() { + return this.innerQueueProperties; + } + + /** + * 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; + } + + /** + * Get the metadata property: A name-value pair that represents queue metadata. + * + * @return the metadata value. + */ + public Map metadata() { + return this.innerQueueProperties() == null ? null : this.innerQueueProperties().metadata(); + } + + /** + * Set the metadata property: A name-value pair that represents queue metadata. + * + * @param metadata the metadata value to set. + * @return the StorageQueueInner object itself. + */ + public StorageQueueInner withMetadata(Map metadata) { + if (this.innerQueueProperties() == null) { + this.innerQueueProperties = new QueueProperties(); + } + this.innerQueueProperties().withMetadata(metadata); + return this; + } + + /** + * Get the approximateMessageCount property: Integer indicating an approximate number of messages in the queue. This + * number is not lower than the actual number of messages in the queue, but could be higher. + * + * @return the approximateMessageCount value. + */ + public Integer approximateMessageCount() { + return this.innerQueueProperties() == null ? null : this.innerQueueProperties().approximateMessageCount(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerQueueProperties() != null) { + innerQueueProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerQueueProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageQueueInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageQueueInner 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 StorageQueueInner. + */ + public static StorageQueueInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageQueueInner deserializedStorageQueueInner = new StorageQueueInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedStorageQueueInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedStorageQueueInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedStorageQueueInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedStorageQueueInner.innerQueueProperties = QueueProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageQueueInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageTaskAssignmentInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageTaskAssignmentInner.java new file mode 100644 index 0000000000000..a1ff2e296f317 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageTaskAssignmentInner.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignmentProperties; +import java.io.IOException; + +/** + * The storage task assignment. + */ +@Fluent +public final class StorageTaskAssignmentInner extends ProxyResource { + /* + * Properties of the storage task assignment. + */ + private StorageTaskAssignmentProperties properties; + + /* + * 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 StorageTaskAssignmentInner class. + */ + public StorageTaskAssignmentInner() { + } + + /** + * Get the properties property: Properties of the storage task assignment. + * + * @return the properties value. + */ + public StorageTaskAssignmentProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the storage task assignment. + * + * @param properties the properties value to set. + * @return the StorageTaskAssignmentInner object itself. + */ + public StorageTaskAssignmentInner withProperties(StorageTaskAssignmentProperties properties) { + this.properties = properties; + return this; + } + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model StorageTaskAssignmentInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageTaskAssignmentInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageTaskAssignmentInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTaskAssignmentInner 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 StorageTaskAssignmentInner. + */ + public static StorageTaskAssignmentInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTaskAssignmentInner deserializedStorageTaskAssignmentInner = new StorageTaskAssignmentInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedStorageTaskAssignmentInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedStorageTaskAssignmentInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedStorageTaskAssignmentInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedStorageTaskAssignmentInner.properties + = StorageTaskAssignmentProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTaskAssignmentInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageTaskReportInstanceInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageTaskReportInstanceInner.java new file mode 100644 index 0000000000000..0d2ff96d341c2 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageTaskReportInstanceInner.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.storage.generated.models.StorageTaskReportProperties; +import java.io.IOException; + +/** + * Storage Tasks run report instance. + */ +@Fluent +public final class StorageTaskReportInstanceInner extends ProxyResource { + /* + * Storage task execution report for a run instance. + */ + private StorageTaskReportProperties properties; + + /* + * 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 StorageTaskReportInstanceInner class. + */ + public StorageTaskReportInstanceInner() { + } + + /** + * Get the properties property: Storage task execution report for a run instance. + * + * @return the properties value. + */ + public StorageTaskReportProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Storage task execution report for a run instance. + * + * @param properties the properties value to set. + * @return the StorageTaskReportInstanceInner object itself. + */ + public StorageTaskReportInstanceInner withProperties(StorageTaskReportProperties properties) { + this.properties = properties; + return this; + } + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageTaskReportInstanceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTaskReportInstanceInner 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 StorageTaskReportInstanceInner. + */ + public static StorageTaskReportInstanceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTaskReportInstanceInner deserializedStorageTaskReportInstanceInner + = new StorageTaskReportInstanceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedStorageTaskReportInstanceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedStorageTaskReportInstanceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedStorageTaskReportInstanceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedStorageTaskReportInstanceInner.properties + = StorageTaskReportProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTaskReportInstanceInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableInner.java new file mode 100644 index 0000000000000..64b88974b76ce --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableInner.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.storage.generated.models.TableSignedIdentifier; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the table, including Id, resource name, resource type. + */ +@Fluent +public final class TableInner extends ProxyResource { + /* + * Table resource properties. + */ + private TableProperties innerTableProperties; + + /* + * 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 TableInner class. + */ + public TableInner() { + } + + /** + * Get the innerTableProperties property: Table resource properties. + * + * @return the innerTableProperties value. + */ + private TableProperties innerTableProperties() { + return this.innerTableProperties; + } + + /** + * 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; + } + + /** + * Get the tableName property: Table name under the specified account. + * + * @return the tableName value. + */ + public String tableName() { + return this.innerTableProperties() == null ? null : this.innerTableProperties().tableName(); + } + + /** + * Get the signedIdentifiers property: List of stored access policies specified on the table. + * + * @return the signedIdentifiers value. + */ + public List signedIdentifiers() { + return this.innerTableProperties() == null ? null : this.innerTableProperties().signedIdentifiers(); + } + + /** + * Set the signedIdentifiers property: List of stored access policies specified on the table. + * + * @param signedIdentifiers the signedIdentifiers value to set. + * @return the TableInner object itself. + */ + public TableInner withSignedIdentifiers(List signedIdentifiers) { + if (this.innerTableProperties() == null) { + this.innerTableProperties = new TableProperties(); + } + this.innerTableProperties().withSignedIdentifiers(signedIdentifiers); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerTableProperties() != null) { + innerTableProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerTableProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TableInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TableInner 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 TableInner. + */ + public static TableInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TableInner deserializedTableInner = new TableInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedTableInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedTableInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedTableInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedTableInner.innerTableProperties = TableProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTableInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableProperties.java new file mode 100644 index 0000000000000..97f57bc1b1444 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableProperties.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.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 com.azure.resourcemanager.storage.generated.models.TableSignedIdentifier; +import java.io.IOException; +import java.util.List; + +/** + * The TableProperties model. + */ +@Fluent +public final class TableProperties implements JsonSerializable { + /* + * Table name under the specified account + */ + private String tableName; + + /* + * List of stored access policies specified on the table. + */ + private List signedIdentifiers; + + /** + * Creates an instance of TableProperties class. + */ + public TableProperties() { + } + + /** + * Get the tableName property: Table name under the specified account. + * + * @return the tableName value. + */ + public String tableName() { + return this.tableName; + } + + /** + * Get the signedIdentifiers property: List of stored access policies specified on the table. + * + * @return the signedIdentifiers value. + */ + public List signedIdentifiers() { + return this.signedIdentifiers; + } + + /** + * Set the signedIdentifiers property: List of stored access policies specified on the table. + * + * @param signedIdentifiers the signedIdentifiers value to set. + * @return the TableProperties object itself. + */ + public TableProperties withSignedIdentifiers(List signedIdentifiers) { + this.signedIdentifiers = signedIdentifiers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (signedIdentifiers() != null) { + signedIdentifiers().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("signedIdentifiers", this.signedIdentifiers, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TableProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TableProperties 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 TableProperties. + */ + public static TableProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TableProperties deserializedTableProperties = new TableProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tableName".equals(fieldName)) { + deserializedTableProperties.tableName = reader.getString(); + } else if ("signedIdentifiers".equals(fieldName)) { + List signedIdentifiers + = reader.readArray(reader1 -> TableSignedIdentifier.fromJson(reader1)); + deserializedTableProperties.signedIdentifiers = signedIdentifiers; + } else { + reader.skipChildren(); + } + } + + return deserializedTableProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableServicePropertiesInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableServicePropertiesInner.java new file mode 100644 index 0000000000000..5795dde3e1ec4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableServicePropertiesInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import java.io.IOException; + +/** + * The properties of a storage account’s Table service. + */ +@Fluent +public final class TableServicePropertiesInner extends ProxyResource { + /* + * The properties of a storage account’s Table service. + */ + private TableServicePropertiesProperties innerTableServiceProperties; + + /* + * 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 TableServicePropertiesInner class. + */ + public TableServicePropertiesInner() { + } + + /** + * Get the innerTableServiceProperties property: The properties of a storage account’s Table service. + * + * @return the innerTableServiceProperties value. + */ + private TableServicePropertiesProperties innerTableServiceProperties() { + return this.innerTableServiceProperties; + } + + /** + * 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; + } + + /** + * Get the cors property: Specifies CORS rules for the Table service. You can include up to five CorsRule elements + * in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and + * CORS will be disabled for the Table service. + * + * @return the cors value. + */ + public CorsRules cors() { + return this.innerTableServiceProperties() == null ? null : this.innerTableServiceProperties().cors(); + } + + /** + * Set the cors property: Specifies CORS rules for the Table service. You can include up to five CorsRule elements + * in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and + * CORS will be disabled for the Table service. + * + * @param cors the cors value to set. + * @return the TableServicePropertiesInner object itself. + */ + public TableServicePropertiesInner withCors(CorsRules cors) { + if (this.innerTableServiceProperties() == null) { + this.innerTableServiceProperties = new TableServicePropertiesProperties(); + } + this.innerTableServiceProperties().withCors(cors); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerTableServiceProperties() != null) { + innerTableServiceProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerTableServiceProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TableServicePropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TableServicePropertiesInner 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 TableServicePropertiesInner. + */ + public static TableServicePropertiesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TableServicePropertiesInner deserializedTableServicePropertiesInner = new TableServicePropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedTableServicePropertiesInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedTableServicePropertiesInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedTableServicePropertiesInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedTableServicePropertiesInner.innerTableServiceProperties + = TableServicePropertiesProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTableServicePropertiesInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableServicePropertiesProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableServicePropertiesProperties.java new file mode 100644 index 0000000000000..17d84ea7741c1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableServicePropertiesProperties.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.fluent.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 com.azure.resourcemanager.storage.generated.models.CorsRules; +import java.io.IOException; + +/** + * The properties of a storage account’s Table service. + */ +@Fluent +public final class TableServicePropertiesProperties implements JsonSerializable { + /* + * Specifies CORS rules for the Table service. You can include up to five CorsRule elements in the request. If no + * CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for + * the Table service. + */ + private CorsRules cors; + + /** + * Creates an instance of TableServicePropertiesProperties class. + */ + public TableServicePropertiesProperties() { + } + + /** + * Get the cors property: Specifies CORS rules for the Table service. You can include up to five CorsRule elements + * in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and + * CORS will be disabled for the Table service. + * + * @return the cors value. + */ + public CorsRules cors() { + return this.cors; + } + + /** + * Set the cors property: Specifies CORS rules for the Table service. You can include up to five CorsRule elements + * in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and + * CORS will be disabled for the Table service. + * + * @param cors the cors value to set. + * @return the TableServicePropertiesProperties object itself. + */ + public TableServicePropertiesProperties withCors(CorsRules cors) { + this.cors = cors; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (cors() != null) { + cors().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("cors", this.cors); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TableServicePropertiesProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TableServicePropertiesProperties 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 TableServicePropertiesProperties. + */ + public static TableServicePropertiesProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TableServicePropertiesProperties deserializedTableServicePropertiesProperties + = new TableServicePropertiesProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cors".equals(fieldName)) { + deserializedTableServicePropertiesProperties.cors = CorsRules.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTableServicePropertiesProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/UsageInner.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/UsageInner.java new file mode 100644 index 0000000000000..032c5d1e7a404 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/UsageInner.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.models.UsageName; +import com.azure.resourcemanager.storage.generated.models.UsageUnit; +import java.io.IOException; + +/** + * Describes Storage Resource Usage. + */ +@Immutable +public final class UsageInner implements JsonSerializable { + /* + * Gets the unit of measurement. + */ + private UsageUnit unit; + + /* + * Gets the current count of the allocated resources in the subscription. + */ + private Integer currentValue; + + /* + * Gets the maximum count of the resources that can be allocated in the subscription. + */ + private Integer limit; + + /* + * Gets the name of the type of usage. + */ + private UsageName name; + + /** + * Creates an instance of UsageInner class. + */ + public UsageInner() { + } + + /** + * Get the unit property: Gets the unit of measurement. + * + * @return the unit value. + */ + public UsageUnit unit() { + return this.unit; + } + + /** + * Get the currentValue property: Gets the current count of the allocated resources in the subscription. + * + * @return the currentValue value. + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Get the limit property: Gets the maximum count of the resources that can be allocated in the subscription. + * + * @return the limit value. + */ + public Integer limit() { + return this.limit; + } + + /** + * Get the name property: Gets the name of the type of usage. + * + * @return the name value. + */ + public UsageName name() { + return this.name; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() != null) { + name().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UsageInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UsageInner 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 UsageInner. + */ + public static UsageInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UsageInner deserializedUsageInner = new UsageInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("unit".equals(fieldName)) { + deserializedUsageInner.unit = UsageUnit.fromString(reader.getString()); + } else if ("currentValue".equals(fieldName)) { + deserializedUsageInner.currentValue = reader.getNullable(JsonReader::getInt); + } else if ("limit".equals(fieldName)) { + deserializedUsageInner.limit = reader.getNullable(JsonReader::getInt); + } else if ("name".equals(fieldName)) { + deserializedUsageInner.name = UsageName.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUsageInner; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/package-info.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/package-info.java new file mode 100644 index 0000000000000..457bb0932044b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the inner data models for StorageManagementClient. + * The Azure Storage Management API. + */ +package com.azure.resourcemanager.storage.generated.fluent.models; diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/package-info.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/package-info.java new file mode 100644 index 0000000000000..1d0d0267e1a09 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the service clients for StorageManagementClient. + * The Azure Storage Management API. + */ +package com.azure.resourcemanager.storage.generated.fluent; diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobContainerImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobContainerImpl.java new file mode 100644 index 0000000000000..75ddffd7d8fa5 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobContainerImpl.java @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobContainerInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LegalHoldInner; +import com.azure.resourcemanager.storage.generated.models.BlobContainer; +import com.azure.resourcemanager.storage.generated.models.ImmutabilityPolicyProperties; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageWithVersioning; +import com.azure.resourcemanager.storage.generated.models.LeaseContainerRequest; +import com.azure.resourcemanager.storage.generated.models.LeaseContainerResponse; +import com.azure.resourcemanager.storage.generated.models.LeaseDuration; +import com.azure.resourcemanager.storage.generated.models.LeaseState; +import com.azure.resourcemanager.storage.generated.models.LeaseStatus; +import com.azure.resourcemanager.storage.generated.models.LegalHold; +import com.azure.resourcemanager.storage.generated.models.LegalHoldProperties; +import com.azure.resourcemanager.storage.generated.models.PublicAccess; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Map; + +public final class BlobContainerImpl implements BlobContainer, BlobContainer.Definition, BlobContainer.Update { + private BlobContainerInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String version() { + return this.innerModel().version(); + } + + public Boolean deleted() { + return this.innerModel().deleted(); + } + + public OffsetDateTime deletedTime() { + return this.innerModel().deletedTime(); + } + + public Integer remainingRetentionDays() { + return this.innerModel().remainingRetentionDays(); + } + + public String defaultEncryptionScope() { + return this.innerModel().defaultEncryptionScope(); + } + + public Boolean denyEncryptionScopeOverride() { + return this.innerModel().denyEncryptionScopeOverride(); + } + + public PublicAccess publicAccess() { + return this.innerModel().publicAccess(); + } + + public OffsetDateTime lastModifiedTime() { + return this.innerModel().lastModifiedTime(); + } + + public LeaseStatus leaseStatus() { + return this.innerModel().leaseStatus(); + } + + public LeaseState leaseState() { + return this.innerModel().leaseState(); + } + + public LeaseDuration leaseDuration() { + return this.innerModel().leaseDuration(); + } + + public Map metadata() { + Map inner = this.innerModel().metadata(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ImmutabilityPolicyProperties immutabilityPolicy() { + return this.innerModel().immutabilityPolicy(); + } + + public LegalHoldProperties legalHold() { + return this.innerModel().legalHold(); + } + + public Boolean hasLegalHold() { + return this.innerModel().hasLegalHold(); + } + + public Boolean hasImmutabilityPolicy() { + return this.innerModel().hasImmutabilityPolicy(); + } + + public ImmutableStorageWithVersioning immutableStorageWithVersioning() { + return this.innerModel().immutableStorageWithVersioning(); + } + + public Boolean enableNfsV3RootSquash() { + return this.innerModel().enableNfsV3RootSquash(); + } + + public Boolean enableNfsV3AllSquash() { + return this.innerModel().enableNfsV3AllSquash(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public BlobContainerInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String containerName; + + public BlobContainerImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public BlobContainer create() { + this.innerObject = serviceManager.serviceClient() + .getBlobContainers() + .createWithResponse(resourceGroupName, accountName, containerName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public BlobContainer create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBlobContainers() + .createWithResponse(resourceGroupName, accountName, containerName, this.innerModel(), context) + .getValue(); + return this; + } + + BlobContainerImpl(String name, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new BlobContainerInner(); + this.serviceManager = serviceManager; + this.containerName = name; + } + + public BlobContainerImpl update() { + return this; + } + + public BlobContainer apply() { + this.innerObject = serviceManager.serviceClient() + .getBlobContainers() + .updateWithResponse(resourceGroupName, accountName, containerName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public BlobContainer apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBlobContainers() + .updateWithResponse(resourceGroupName, accountName, containerName, this.innerModel(), context) + .getValue(); + return this; + } + + BlobContainerImpl(BlobContainerInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.containerName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "containers"); + } + + public BlobContainer refresh() { + this.innerObject = serviceManager.serviceClient() + .getBlobContainers() + .getWithResponse(resourceGroupName, accountName, containerName, Context.NONE) + .getValue(); + return this; + } + + public BlobContainer refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBlobContainers() + .getWithResponse(resourceGroupName, accountName, containerName, context) + .getValue(); + return this; + } + + public Response setLegalHoldWithResponse(LegalHoldInner legalHold, Context context) { + return serviceManager.blobContainers() + .setLegalHoldWithResponse(resourceGroupName, accountName, containerName, legalHold, context); + } + + public LegalHold setLegalHold(LegalHoldInner legalHold) { + return serviceManager.blobContainers().setLegalHold(resourceGroupName, accountName, containerName, legalHold); + } + + public Response clearLegalHoldWithResponse(LegalHoldInner legalHold, Context context) { + return serviceManager.blobContainers() + .clearLegalHoldWithResponse(resourceGroupName, accountName, containerName, legalHold, context); + } + + public LegalHold clearLegalHold(LegalHoldInner legalHold) { + return serviceManager.blobContainers().clearLegalHold(resourceGroupName, accountName, containerName, legalHold); + } + + public Response leaseWithResponse(LeaseContainerRequest parameters, Context context) { + return serviceManager.blobContainers() + .leaseWithResponse(resourceGroupName, accountName, containerName, parameters, context); + } + + public LeaseContainerResponse lease() { + return serviceManager.blobContainers().lease(resourceGroupName, accountName, containerName); + } + + public void objectLevelWorm() { + serviceManager.blobContainers().objectLevelWorm(resourceGroupName, accountName, containerName); + } + + public void objectLevelWorm(Context context) { + serviceManager.blobContainers().objectLevelWorm(resourceGroupName, accountName, containerName, context); + } + + public BlobContainerImpl withDefaultEncryptionScope(String defaultEncryptionScope) { + this.innerModel().withDefaultEncryptionScope(defaultEncryptionScope); + return this; + } + + public BlobContainerImpl withDenyEncryptionScopeOverride(Boolean denyEncryptionScopeOverride) { + this.innerModel().withDenyEncryptionScopeOverride(denyEncryptionScopeOverride); + return this; + } + + public BlobContainerImpl withPublicAccess(PublicAccess publicAccess) { + this.innerModel().withPublicAccess(publicAccess); + return this; + } + + public BlobContainerImpl withMetadata(Map metadata) { + this.innerModel().withMetadata(metadata); + return this; + } + + public BlobContainerImpl + withImmutableStorageWithVersioning(ImmutableStorageWithVersioning immutableStorageWithVersioning) { + this.innerModel().withImmutableStorageWithVersioning(immutableStorageWithVersioning); + return this; + } + + public BlobContainerImpl withEnableNfsV3RootSquash(Boolean enableNfsV3RootSquash) { + this.innerModel().withEnableNfsV3RootSquash(enableNfsV3RootSquash); + return this; + } + + public BlobContainerImpl withEnableNfsV3AllSquash(Boolean enableNfsV3AllSquash) { + this.innerModel().withEnableNfsV3AllSquash(enableNfsV3AllSquash); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobContainersClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobContainersClientImpl.java new file mode 100644 index 0000000000000..982831457836b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobContainersClientImpl.java @@ -0,0 +1,2872 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.storage.generated.fluent.BlobContainersClient; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobContainerInner; +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LeaseContainerResponseInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LegalHoldInner; +import com.azure.resourcemanager.storage.generated.fluent.models.ListContainerItemInner; +import com.azure.resourcemanager.storage.generated.models.BlobContainersCreateOrUpdateImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.BlobContainersDeleteImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.BlobContainersExtendImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.BlobContainersGetImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.BlobContainersLockImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.LeaseContainerRequest; +import com.azure.resourcemanager.storage.generated.models.ListContainerItems; +import com.azure.resourcemanager.storage.generated.models.ListContainersInclude; +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 BlobContainersClient. + */ +public final class BlobContainersClientImpl implements BlobContainersClient { + /** + * The proxy service used to perform REST calls. + */ + private final BlobContainersService service; + + /** + * The service client containing this operation class. + */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of BlobContainersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BlobContainersClientImpl(StorageManagementClientImpl client) { + this.service + = RestProxy.create(BlobContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientBlobContainers to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + public interface BlobContainersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$maxpagesize") String maxpagesize, @QueryParam("$filter") String filter, + @QueryParam("$include") ListContainersInclude include, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("containerName") String containerName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") BlobContainerInner blobContainer, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("containerName") String containerName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") BlobContainerInner blobContainer, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("containerName") String containerName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("containerName") String containerName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> setLegalHold(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("containerName") String containerName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") LegalHoldInner legalHold, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> clearLegalHold(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("containerName") String containerName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") LegalHoldInner legalHold, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdateImmutabilityPolicy( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, @PathParam("containerName") String containerName, + @PathParam("immutabilityPolicyName") String immutabilityPolicyName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("If-Match") String ifMatch, @BodyParam("application/json") ImmutabilityPolicyInner parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono getImmutabilityPolicy(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("containerName") String containerName, + @PathParam("immutabilityPolicyName") String immutabilityPolicyName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("If-Match") String ifMatch, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono deleteImmutabilityPolicy( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, @PathParam("containerName") String containerName, + @PathParam("immutabilityPolicyName") String immutabilityPolicyName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("If-Match") String ifMatch, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono lockImmutabilityPolicy(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("containerName") String containerName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("If-Match") String ifMatch, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono extendImmutabilityPolicy( + @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, @PathParam("containerName") String containerName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("If-Match") String ifMatch, @BodyParam("application/json") ImmutabilityPolicyInner parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> lease(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("containerName") String containerName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") LeaseContainerRequest parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/migrate") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> objectLevelWorm(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("containerName") String containerName, @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> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation + * token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. + * @param filter Optional. When specified, only container names starting with the filter will be listed. + * @param include Optional, used to include the properties for soft deleted blob containers. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName, String maxpagesize, String filter, ListContainersInclude include) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), maxpagesize, filter, include, 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())); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation + * token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. + * @param filter Optional. When specified, only container names starting with the filter will be listed. + * @param include Optional, used to include the properties for soft deleted blob containers. + * @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 response schema along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName, String maxpagesize, String filter, ListContainersInclude include, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), maxpagesize, filter, include, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation + * token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. + * @param filter Optional. When specified, only container names starting with the filter will be listed. + * @param include Optional, used to include the properties for soft deleted blob containers. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, + String maxpagesize, String filter, ListContainersInclude include) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, include), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation + * token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + final String maxpagesize = null; + final String filter = null; + final ListContainersInclude include = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, include), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation + * token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. + * @param filter Optional. When specified, only container names starting with the filter will be listed. + * @param include Optional, used to include the properties for soft deleted blob containers. + * @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 response schema as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, + String maxpagesize, String filter, ListContainersInclude include, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, include, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation + * token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + final String maxpagesize = null; + final String filter = null; + final ListContainersInclude include = null; + return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter, include)); + } + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation + * token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. + * @param filter Optional. When specified, only container names starting with the filter will be listed. + * @param include Optional, used to include the properties for soft deleted blob containers. + * @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 response schema as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, String maxpagesize, + String filter, ListContainersInclude include, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter, include, context)); + } + + /** + * Creates a new container under the specified account as described by request body. The container resource includes + * metadata and properties for that container. It does not include a list of the blobs contained by the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties of the blob container to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the blob container, including Id, resource name, resource type, Etag along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, String accountName, + String containerName, BlobContainerInner blobContainer) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName 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 (blobContainer == null) { + return Mono.error(new IllegalArgumentException("Parameter blobContainer is required and cannot be null.")); + } else { + blobContainer.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.create(this.client.getEndpoint(), resourceGroupName, accountName, containerName, + this.client.getApiVersion(), this.client.getSubscriptionId(), blobContainer, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new container under the specified account as described by request body. The container resource includes + * metadata and properties for that container. It does not include a list of the blobs contained by the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties of the blob container to create. + * @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 properties of the blob container, including Id, resource name, resource type, Etag along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, String accountName, + String containerName, BlobContainerInner blobContainer, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName 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 (blobContainer == null) { + return Mono.error(new IllegalArgumentException("Parameter blobContainer is required and cannot be null.")); + } else { + blobContainer.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), resourceGroupName, accountName, containerName, + this.client.getApiVersion(), this.client.getSubscriptionId(), blobContainer, accept, context); + } + + /** + * Creates a new container under the specified account as described by request body. The container resource includes + * metadata and properties for that container. It does not include a list of the blobs contained by the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties of the blob container to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the blob container, including Id, resource name, resource type, Etag on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String accountName, String containerName, + BlobContainerInner blobContainer) { + return createWithResponseAsync(resourceGroupName, accountName, containerName, blobContainer) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a new container under the specified account as described by request body. The container resource includes + * metadata and properties for that container. It does not include a list of the blobs contained by the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties of the blob container to create. + * @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 properties of the blob container, including Id, resource name, resource type, Etag along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse(String resourceGroupName, String accountName, + String containerName, BlobContainerInner blobContainer, Context context) { + return createWithResponseAsync(resourceGroupName, accountName, containerName, blobContainer, context).block(); + } + + /** + * Creates a new container under the specified account as described by request body. The container resource includes + * metadata and properties for that container. It does not include a list of the blobs contained by the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties of the blob container to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobContainerInner create(String resourceGroupName, String accountName, String containerName, + BlobContainerInner blobContainer) { + return createWithResponse(resourceGroupName, accountName, containerName, blobContainer, Context.NONE) + .getValue(); + } + + /** + * Updates container properties as specified in request body. Properties not mentioned in the request will be + * unchanged. Update fails if the specified container doesn't already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties to update for the blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the blob container, including Id, resource name, resource type, Etag along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String accountName, + String containerName, BlobContainerInner blobContainer) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName 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 (blobContainer == null) { + return Mono.error(new IllegalArgumentException("Parameter blobContainer is required and cannot be null.")); + } else { + blobContainer.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.update(this.client.getEndpoint(), resourceGroupName, accountName, containerName, + this.client.getApiVersion(), this.client.getSubscriptionId(), blobContainer, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates container properties as specified in request body. Properties not mentioned in the request will be + * unchanged. Update fails if the specified container doesn't already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties to update for the blob container. + * @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 properties of the blob container, including Id, resource name, resource type, Etag along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String accountName, + String containerName, BlobContainerInner blobContainer, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName 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 (blobContainer == null) { + return Mono.error(new IllegalArgumentException("Parameter blobContainer is required and cannot be null.")); + } else { + blobContainer.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), resourceGroupName, accountName, containerName, + this.client.getApiVersion(), this.client.getSubscriptionId(), blobContainer, accept, context); + } + + /** + * Updates container properties as specified in request body. Properties not mentioned in the request will be + * unchanged. Update fails if the specified container doesn't already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties to update for the blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the blob container, including Id, resource name, resource type, Etag on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String accountName, String containerName, + BlobContainerInner blobContainer) { + return updateWithResponseAsync(resourceGroupName, accountName, containerName, blobContainer) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates container properties as specified in request body. Properties not mentioned in the request will be + * unchanged. Update fails if the specified container doesn't already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties to update for the blob container. + * @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 properties of the blob container, including Id, resource name, resource type, Etag along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String accountName, + String containerName, BlobContainerInner blobContainer, Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, containerName, blobContainer, context).block(); + } + + /** + * Updates container properties as specified in request body. Properties not mentioned in the request will be + * unchanged. Update fails if the specified container doesn't already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param blobContainer Properties to update for the blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobContainerInner update(String resourceGroupName, String accountName, String containerName, + BlobContainerInner blobContainer) { + return updateWithResponse(resourceGroupName, accountName, containerName, blobContainer, Context.NONE) + .getValue(); + } + + /** + * Gets properties of a specified container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String containerName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName 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.get(this.client.getEndpoint(), resourceGroupName, accountName, + containerName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets properties of a specified container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @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 properties of a specified container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String containerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName 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.get(this.client.getEndpoint(), resourceGroupName, accountName, containerName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + } + + /** + * Gets properties of a specified container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String containerName) { + return getWithResponseAsync(resourceGroupName, accountName, containerName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets properties of a specified container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @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 properties of a specified container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, + String containerName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, containerName, context).block(); + } + + /** + * Gets properties of a specified container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobContainerInner get(String resourceGroupName, String accountName, String containerName) { + return getWithResponse(resourceGroupName, accountName, containerName, Context.NONE).getValue(); + } + + /** + * Deletes specified container under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 accountName, + String containerName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName 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.")); + } + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, accountName, + containerName, this.client.getApiVersion(), this.client.getSubscriptionId(), context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes specified container under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @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 accountName, + String containerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName 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.")); + } + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, accountName, containerName, + this.client.getApiVersion(), this.client.getSubscriptionId(), context); + } + + /** + * Deletes specified container under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 accountName, String containerName) { + return deleteWithResponseAsync(resourceGroupName, accountName, containerName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes specified container under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String accountName, String containerName, + Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, containerName, context).block(); + } + + /** + * Deletes specified container under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String containerName) { + deleteWithResponse(resourceGroupName, accountName, containerName, Context.NONE); + } + + /** + * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append + * pattern and does not clear out the existing tags that are not specified in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be set to a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 LegalHold property of a blob container along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> setLegalHoldWithResponseAsync(String resourceGroupName, String accountName, + String containerName, LegalHoldInner legalHold) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName 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 (legalHold == null) { + return Mono.error(new IllegalArgumentException("Parameter legalHold is required and cannot be null.")); + } else { + legalHold.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.setLegalHold(this.client.getEndpoint(), resourceGroupName, accountName, + containerName, this.client.getApiVersion(), this.client.getSubscriptionId(), legalHold, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append + * pattern and does not clear out the existing tags that are not specified in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be set to a blob container. + * @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 LegalHold property of a blob container along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> setLegalHoldWithResponseAsync(String resourceGroupName, String accountName, + String containerName, LegalHoldInner legalHold, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName 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 (legalHold == null) { + return Mono.error(new IllegalArgumentException("Parameter legalHold is required and cannot be null.")); + } else { + legalHold.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.setLegalHold(this.client.getEndpoint(), resourceGroupName, accountName, containerName, + this.client.getApiVersion(), this.client.getSubscriptionId(), legalHold, accept, context); + } + + /** + * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append + * pattern and does not clear out the existing tags that are not specified in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be set to a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 LegalHold property of a blob container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setLegalHoldAsync(String resourceGroupName, String accountName, String containerName, + LegalHoldInner legalHold) { + return setLegalHoldWithResponseAsync(resourceGroupName, accountName, containerName, legalHold) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append + * pattern and does not clear out the existing tags that are not specified in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be set to a blob container. + * @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 LegalHold property of a blob container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response setLegalHoldWithResponse(String resourceGroupName, String accountName, + String containerName, LegalHoldInner legalHold, Context context) { + return setLegalHoldWithResponseAsync(resourceGroupName, accountName, containerName, legalHold, context).block(); + } + + /** + * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append + * pattern and does not clear out the existing tags that are not specified in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be set to a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 LegalHold property of a blob container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LegalHoldInner setLegalHold(String resourceGroupName, String accountName, String containerName, + LegalHoldInner legalHold) { + return setLegalHoldWithResponse(resourceGroupName, accountName, containerName, legalHold, Context.NONE) + .getValue(); + } + + /** + * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold + * clears out only the specified tags in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be clear from a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 LegalHold property of a blob container along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> clearLegalHoldWithResponseAsync(String resourceGroupName, String accountName, + String containerName, LegalHoldInner legalHold) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName 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 (legalHold == null) { + return Mono.error(new IllegalArgumentException("Parameter legalHold is required and cannot be null.")); + } else { + legalHold.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.clearLegalHold(this.client.getEndpoint(), resourceGroupName, accountName, + containerName, this.client.getApiVersion(), this.client.getSubscriptionId(), legalHold, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold + * clears out only the specified tags in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be clear from a blob container. + * @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 LegalHold property of a blob container along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> clearLegalHoldWithResponseAsync(String resourceGroupName, String accountName, + String containerName, LegalHoldInner legalHold, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName 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 (legalHold == null) { + return Mono.error(new IllegalArgumentException("Parameter legalHold is required and cannot be null.")); + } else { + legalHold.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.clearLegalHold(this.client.getEndpoint(), resourceGroupName, accountName, containerName, + this.client.getApiVersion(), this.client.getSubscriptionId(), legalHold, accept, context); + } + + /** + * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold + * clears out only the specified tags in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be clear from a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 LegalHold property of a blob container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono clearLegalHoldAsync(String resourceGroupName, String accountName, String containerName, + LegalHoldInner legalHold) { + return clearLegalHoldWithResponseAsync(resourceGroupName, accountName, containerName, legalHold) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold + * clears out only the specified tags in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be clear from a blob container. + * @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 LegalHold property of a blob container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response clearLegalHoldWithResponse(String resourceGroupName, String accountName, + String containerName, LegalHoldInner legalHold, Context context) { + return clearLegalHoldWithResponseAsync(resourceGroupName, accountName, containerName, legalHold, context) + .block(); + } + + /** + * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold + * clears out only the specified tags in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be clear from a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 LegalHold property of a blob container. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LegalHoldInner clearLegalHold(String resourceGroupName, String accountName, String containerName, + LegalHoldInner legalHold) { + return clearLegalHoldWithResponse(resourceGroupName, accountName, containerName, legalHold, Context.NONE) + .getValue(); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for + * this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @param parameters The ImmutabilityPolicy Properties that will be created or updated to a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono + createOrUpdateImmutabilityPolicyWithResponseAsync(String resourceGroupName, String accountName, + String containerName, String ifMatch, ImmutabilityPolicyInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName 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 (parameters != null) { + parameters.validate(); + } + final String immutabilityPolicyName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdateImmutabilityPolicy(this.client.getEndpoint(), + resourceGroupName, accountName, containerName, immutabilityPolicyName, this.client.getApiVersion(), + this.client.getSubscriptionId(), ifMatch, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for + * this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @param parameters The ImmutabilityPolicy Properties that will be created or updated to a blob container. + * @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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono + createOrUpdateImmutabilityPolicyWithResponseAsync(String resourceGroupName, String accountName, + String containerName, String ifMatch, ImmutabilityPolicyInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName 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 (parameters != null) { + parameters.validate(); + } + final String immutabilityPolicyName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdateImmutabilityPolicy(this.client.getEndpoint(), resourceGroupName, accountName, + containerName, immutabilityPolicyName, this.client.getApiVersion(), this.client.getSubscriptionId(), + ifMatch, parameters, accept, context); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for + * this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateImmutabilityPolicyAsync(String resourceGroupName, + String accountName, String containerName) { + final String ifMatch = null; + final ImmutabilityPolicyInner parameters = null; + return createOrUpdateImmutabilityPolicyWithResponseAsync(resourceGroupName, accountName, containerName, ifMatch, + parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for + * this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @param parameters The ImmutabilityPolicy Properties that will be created or updated to a blob container. + * @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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobContainersCreateOrUpdateImmutabilityPolicyResponse createOrUpdateImmutabilityPolicyWithResponse( + String resourceGroupName, String accountName, String containerName, String ifMatch, + ImmutabilityPolicyInner parameters, Context context) { + return createOrUpdateImmutabilityPolicyWithResponseAsync(resourceGroupName, accountName, containerName, ifMatch, + parameters, context).block(); + } + + /** + * Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for + * this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImmutabilityPolicyInner createOrUpdateImmutabilityPolicy(String resourceGroupName, String accountName, + String containerName) { + final String ifMatch = null; + final ImmutabilityPolicyInner parameters = null; + return createOrUpdateImmutabilityPolicyWithResponse(resourceGroupName, accountName, containerName, ifMatch, + parameters, Context.NONE).getValue(); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 existing immutability policy along with the corresponding ETag in response headers and body on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getImmutabilityPolicyWithResponseAsync( + String resourceGroupName, String accountName, String containerName, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName 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 immutabilityPolicyName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getImmutabilityPolicy(this.client.getEndpoint(), resourceGroupName, + accountName, containerName, immutabilityPolicyName, this.client.getApiVersion(), + this.client.getSubscriptionId(), ifMatch, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @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 existing immutability policy along with the corresponding ETag in response headers and body on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getImmutabilityPolicyWithResponseAsync( + String resourceGroupName, String accountName, String containerName, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName 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 immutabilityPolicyName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getImmutabilityPolicy(this.client.getEndpoint(), resourceGroupName, accountName, containerName, + immutabilityPolicyName, this.client.getApiVersion(), this.client.getSubscriptionId(), ifMatch, accept, + context); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 existing immutability policy along with the corresponding ETag in response headers and body on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getImmutabilityPolicyAsync(String resourceGroupName, String accountName, + String containerName) { + final String ifMatch = null; + return getImmutabilityPolicyWithResponseAsync(resourceGroupName, accountName, containerName, ifMatch) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @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 existing immutability policy along with the corresponding ETag in response headers and body. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobContainersGetImmutabilityPolicyResponse getImmutabilityPolicyWithResponse(String resourceGroupName, + String accountName, String containerName, String ifMatch, Context context) { + return getImmutabilityPolicyWithResponseAsync(resourceGroupName, accountName, containerName, ifMatch, context) + .block(); + } + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 existing immutability policy along with the corresponding ETag in response headers and body. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImmutabilityPolicyInner getImmutabilityPolicy(String resourceGroupName, String accountName, + String containerName) { + final String ifMatch = null; + return getImmutabilityPolicyWithResponse(resourceGroupName, accountName, containerName, ifMatch, Context.NONE) + .getValue(); + } + + /** + * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to + * 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the + * only way is to delete the container after deleting all expired blobs inside the policy locked container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteImmutabilityPolicyWithResponseAsync( + String resourceGroupName, String accountName, String containerName, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName 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 (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + final String immutabilityPolicyName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.deleteImmutabilityPolicy(this.client.getEndpoint(), resourceGroupName, + accountName, containerName, immutabilityPolicyName, this.client.getApiVersion(), + this.client.getSubscriptionId(), ifMatch, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to + * 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the + * only way is to delete the container after deleting all expired blobs inside the policy locked container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteImmutabilityPolicyWithResponseAsync( + String resourceGroupName, String accountName, String containerName, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName 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 (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + final String immutabilityPolicyName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.deleteImmutabilityPolicy(this.client.getEndpoint(), resourceGroupName, accountName, + containerName, immutabilityPolicyName, this.client.getApiVersion(), this.client.getSubscriptionId(), + ifMatch, accept, context); + } + + /** + * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to + * 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the + * only way is to delete the container after deleting all expired blobs inside the policy locked container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteImmutabilityPolicyAsync(String resourceGroupName, String accountName, + String containerName, String ifMatch) { + return deleteImmutabilityPolicyWithResponseAsync(resourceGroupName, accountName, containerName, ifMatch) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to + * 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the + * only way is to delete the container after deleting all expired blobs inside the policy locked container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobContainersDeleteImmutabilityPolicyResponse deleteImmutabilityPolicyWithResponse(String resourceGroupName, + String accountName, String containerName, String ifMatch, Context context) { + return deleteImmutabilityPolicyWithResponseAsync(resourceGroupName, accountName, containerName, ifMatch, + context).block(); + } + + /** + * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to + * 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the + * only way is to delete the container after deleting all expired blobs inside the policy locked container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImmutabilityPolicyInner deleteImmutabilityPolicy(String resourceGroupName, String accountName, + String containerName, String ifMatch) { + return deleteImmutabilityPolicyWithResponse(resourceGroupName, accountName, containerName, ifMatch, + Context.NONE).getValue(); + } + + /** + * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is + * ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono lockImmutabilityPolicyWithResponseAsync( + String resourceGroupName, String accountName, String containerName, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName 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 (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.lockImmutabilityPolicy(this.client.getEndpoint(), resourceGroupName, + accountName, containerName, this.client.getApiVersion(), this.client.getSubscriptionId(), ifMatch, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is + * ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono lockImmutabilityPolicyWithResponseAsync( + String resourceGroupName, String accountName, String containerName, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName 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 (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.lockImmutabilityPolicy(this.client.getEndpoint(), resourceGroupName, accountName, containerName, + this.client.getApiVersion(), this.client.getSubscriptionId(), ifMatch, accept, context); + } + + /** + * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is + * ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono lockImmutabilityPolicyAsync(String resourceGroupName, String accountName, + String containerName, String ifMatch) { + return lockImmutabilityPolicyWithResponseAsync(resourceGroupName, accountName, containerName, ifMatch) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is + * ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobContainersLockImmutabilityPolicyResponse lockImmutabilityPolicyWithResponse(String resourceGroupName, + String accountName, String containerName, String ifMatch, Context context) { + return lockImmutabilityPolicyWithResponseAsync(resourceGroupName, accountName, containerName, ifMatch, context) + .block(); + } + + /** + * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is + * ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImmutabilityPolicyInner lockImmutabilityPolicy(String resourceGroupName, String accountName, + String containerName, String ifMatch) { + return lockImmutabilityPolicyWithResponse(resourceGroupName, accountName, containerName, ifMatch, Context.NONE) + .getValue(); + } + + /** + * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a + * Locked policy will be this action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @param parameters The ImmutabilityPolicy Properties that will be extended for a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono extendImmutabilityPolicyWithResponseAsync( + String resourceGroupName, String accountName, String containerName, String ifMatch, + ImmutabilityPolicyInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName 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 (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.extendImmutabilityPolicy(this.client.getEndpoint(), resourceGroupName, + accountName, containerName, this.client.getApiVersion(), this.client.getSubscriptionId(), ifMatch, + parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a + * Locked policy will be this action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @param parameters The ImmutabilityPolicy Properties that will be extended for a blob container. + * @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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono extendImmutabilityPolicyWithResponseAsync( + String resourceGroupName, String accountName, String containerName, String ifMatch, + ImmutabilityPolicyInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName 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 (ifMatch == null) { + return Mono.error(new IllegalArgumentException("Parameter ifMatch is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.extendImmutabilityPolicy(this.client.getEndpoint(), resourceGroupName, accountName, + containerName, this.client.getApiVersion(), this.client.getSubscriptionId(), ifMatch, parameters, accept, + context); + } + + /** + * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a + * Locked policy will be this action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono extendImmutabilityPolicyAsync(String resourceGroupName, String accountName, + String containerName, String ifMatch) { + final ImmutabilityPolicyInner parameters = null; + return extendImmutabilityPolicyWithResponseAsync(resourceGroupName, accountName, containerName, ifMatch, + parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a + * Locked policy will be this action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @param parameters The ImmutabilityPolicy Properties that will be extended for a blob container. + * @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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobContainersExtendImmutabilityPolicyResponse extendImmutabilityPolicyWithResponse(String resourceGroupName, + String accountName, String containerName, String ifMatch, ImmutabilityPolicyInner parameters, Context context) { + return extendImmutabilityPolicyWithResponseAsync(resourceGroupName, accountName, containerName, ifMatch, + parameters, context).block(); + } + + /** + * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a + * Locked policy will be this action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImmutabilityPolicyInner extendImmutabilityPolicy(String resourceGroupName, String accountName, + String containerName, String ifMatch) { + final ImmutabilityPolicyInner parameters = null; + return extendImmutabilityPolicyWithResponse(resourceGroupName, accountName, containerName, ifMatch, parameters, + Context.NONE).getValue(); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock + * duration can be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Container response schema along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> leaseWithResponseAsync(String resourceGroupName, + String accountName, String containerName, LeaseContainerRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName 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 (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.lease(this.client.getEndpoint(), resourceGroupName, accountName, containerName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock + * duration can be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @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 lease Container response schema along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> leaseWithResponseAsync(String resourceGroupName, + String accountName, String containerName, LeaseContainerRequest parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName 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 (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.lease(this.client.getEndpoint(), resourceGroupName, accountName, containerName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock + * duration can be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Container response schema on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono leaseAsync(String resourceGroupName, String accountName, + String containerName) { + final LeaseContainerRequest parameters = null; + return leaseWithResponseAsync(resourceGroupName, accountName, containerName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock + * duration can be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @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 lease Container response schema along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response leaseWithResponse(String resourceGroupName, String accountName, + String containerName, LeaseContainerRequest parameters, Context context) { + return leaseWithResponseAsync(resourceGroupName, accountName, containerName, parameters, context).block(); + } + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock + * duration can be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Container response schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LeaseContainerResponseInner lease(String resourceGroupName, String accountName, String containerName) { + final LeaseContainerRequest parameters = null; + return leaseWithResponse(resourceGroupName, accountName, containerName, parameters, Context.NONE).getValue(); + } + + /** + * This operation migrates a blob container from container level WORM to object level immutability enabled + * container. Prerequisites require a container level immutability policy either in locked or unlocked state, + * Account level versioning must be enabled and there should be no Legal hold on the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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>> objectLevelWormWithResponseAsync(String resourceGroupName, + String accountName, String containerName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName 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.objectLevelWorm(this.client.getEndpoint(), resourceGroupName, accountName, + containerName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This operation migrates a blob container from container level WORM to object level immutability enabled + * container. Prerequisites require a container level immutability policy either in locked or unlocked state, + * Account level versioning must be enabled and there should be no Legal hold on the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @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>> objectLevelWormWithResponseAsync(String resourceGroupName, + String accountName, String containerName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName 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.objectLevelWorm(this.client.getEndpoint(), resourceGroupName, accountName, containerName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + } + + /** + * This operation migrates a blob container from container level WORM to object level immutability enabled + * container. Prerequisites require a container level immutability policy either in locked or unlocked state, + * Account level versioning must be enabled and there should be no Legal hold on the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> beginObjectLevelWormAsync(String resourceGroupName, String accountName, + String containerName) { + Mono>> mono + = objectLevelWormWithResponseAsync(resourceGroupName, accountName, containerName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * This operation migrates a blob container from container level WORM to object level immutability enabled + * container. Prerequisites require a container level immutability policy either in locked or unlocked state, + * Account level versioning must be enabled and there should be no Legal hold on the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @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> beginObjectLevelWormAsync(String resourceGroupName, String accountName, + String containerName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = objectLevelWormWithResponseAsync(resourceGroupName, accountName, containerName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * This operation migrates a blob container from container level WORM to object level immutability enabled + * container. Prerequisites require a container level immutability policy either in locked or unlocked state, + * Account level versioning must be enabled and there should be no Legal hold on the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> beginObjectLevelWorm(String resourceGroupName, String accountName, + String containerName) { + return this.beginObjectLevelWormAsync(resourceGroupName, accountName, containerName).getSyncPoller(); + } + + /** + * This operation migrates a blob container from container level WORM to object level immutability enabled + * container. Prerequisites require a container level immutability policy either in locked or unlocked state, + * Account level versioning must be enabled and there should be no Legal hold on the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @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> beginObjectLevelWorm(String resourceGroupName, String accountName, + String containerName, Context context) { + return this.beginObjectLevelWormAsync(resourceGroupName, accountName, containerName, context).getSyncPoller(); + } + + /** + * This operation migrates a blob container from container level WORM to object level immutability enabled + * container. Prerequisites require a container level immutability policy either in locked or unlocked state, + * Account level versioning must be enabled and there should be no Legal hold on the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 objectLevelWormAsync(String resourceGroupName, String accountName, String containerName) { + return beginObjectLevelWormAsync(resourceGroupName, accountName, containerName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This operation migrates a blob container from container level WORM to object level immutability enabled + * container. Prerequisites require a container level immutability policy either in locked or unlocked state, + * Account level versioning must be enabled and there should be no Legal hold on the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @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 objectLevelWormAsync(String resourceGroupName, String accountName, String containerName, + Context context) { + return beginObjectLevelWormAsync(resourceGroupName, accountName, containerName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This operation migrates a blob container from container level WORM to object level immutability enabled + * container. Prerequisites require a container level immutability policy either in locked or unlocked state, + * Account level versioning must be enabled and there should be no Legal hold on the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 objectLevelWorm(String resourceGroupName, String accountName, String containerName) { + objectLevelWormAsync(resourceGroupName, accountName, containerName).block(); + } + + /** + * This operation migrates a blob container from container level WORM to object level immutability enabled + * container. Prerequisites require a container level immutability policy either in locked or unlocked state, + * Account level versioning must be enabled and there should be no Legal hold on the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @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 objectLevelWorm(String resourceGroupName, String accountName, String containerName, Context context) { + objectLevelWormAsync(resourceGroupName, accountName, containerName, context).block(); + } + + /** + * 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 response schema 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 response schema 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/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobContainersImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobContainersImpl.java new file mode 100644 index 0000000000000..fdb2cc7f04d74 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobContainersImpl.java @@ -0,0 +1,432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.BlobContainersClient; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobContainerInner; +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LeaseContainerResponseInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LegalHoldInner; +import com.azure.resourcemanager.storage.generated.fluent.models.ListContainerItemInner; +import com.azure.resourcemanager.storage.generated.models.BlobContainer; +import com.azure.resourcemanager.storage.generated.models.BlobContainers; +import com.azure.resourcemanager.storage.generated.models.BlobContainersDeleteImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.BlobContainersExtendImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.BlobContainersGetImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.BlobContainersLockImmutabilityPolicyResponse; +import com.azure.resourcemanager.storage.generated.models.ImmutabilityPolicy; +import com.azure.resourcemanager.storage.generated.models.LeaseContainerRequest; +import com.azure.resourcemanager.storage.generated.models.LeaseContainerResponse; +import com.azure.resourcemanager.storage.generated.models.LegalHold; +import com.azure.resourcemanager.storage.generated.models.ListContainerItem; +import com.azure.resourcemanager.storage.generated.models.ListContainersInclude; + +public final class BlobContainersImpl implements BlobContainers { + private static final ClientLogger LOGGER = new ClientLogger(BlobContainersImpl.class); + + private final BlobContainersClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public BlobContainersImpl(BlobContainersClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ListContainerItemImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, String maxpagesize, + String filter, ListContainersInclude include, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName, maxpagesize, filter, include, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ListContainerItemImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String accountName, String containerName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, accountName, containerName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new BlobContainerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BlobContainer get(String resourceGroupName, String accountName, String containerName) { + BlobContainerInner inner = this.serviceClient().get(resourceGroupName, accountName, containerName); + if (inner != null) { + return new BlobContainerImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String accountName, String containerName, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, containerName, context); + } + + public void delete(String resourceGroupName, String accountName, String containerName) { + this.serviceClient().delete(resourceGroupName, accountName, containerName); + } + + public Response setLegalHoldWithResponse(String resourceGroupName, String accountName, + String containerName, LegalHoldInner legalHold, Context context) { + Response inner = this.serviceClient() + .setLegalHoldWithResponse(resourceGroupName, accountName, containerName, legalHold, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LegalHoldImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LegalHold setLegalHold(String resourceGroupName, String accountName, String containerName, + LegalHoldInner legalHold) { + LegalHoldInner inner + = this.serviceClient().setLegalHold(resourceGroupName, accountName, containerName, legalHold); + if (inner != null) { + return new LegalHoldImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response clearLegalHoldWithResponse(String resourceGroupName, String accountName, + String containerName, LegalHoldInner legalHold, Context context) { + Response inner = this.serviceClient() + .clearLegalHoldWithResponse(resourceGroupName, accountName, containerName, legalHold, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LegalHoldImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LegalHold clearLegalHold(String resourceGroupName, String accountName, String containerName, + LegalHoldInner legalHold) { + LegalHoldInner inner + = this.serviceClient().clearLegalHold(resourceGroupName, accountName, containerName, legalHold); + if (inner != null) { + return new LegalHoldImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getImmutabilityPolicyWithResponse(String resourceGroupName, String accountName, + String containerName, String ifMatch, Context context) { + BlobContainersGetImmutabilityPolicyResponse inner = this.serviceClient() + .getImmutabilityPolicyWithResponse(resourceGroupName, accountName, containerName, ifMatch, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ImmutabilityPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ImmutabilityPolicy getImmutabilityPolicy(String resourceGroupName, String accountName, + String containerName) { + ImmutabilityPolicyInner inner + = this.serviceClient().getImmutabilityPolicy(resourceGroupName, accountName, containerName); + if (inner != null) { + return new ImmutabilityPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteImmutabilityPolicyWithResponse(String resourceGroupName, + String accountName, String containerName, String ifMatch, Context context) { + BlobContainersDeleteImmutabilityPolicyResponse inner = this.serviceClient() + .deleteImmutabilityPolicyWithResponse(resourceGroupName, accountName, containerName, ifMatch, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ImmutabilityPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ImmutabilityPolicy deleteImmutabilityPolicy(String resourceGroupName, String accountName, + String containerName, String ifMatch) { + ImmutabilityPolicyInner inner + = this.serviceClient().deleteImmutabilityPolicy(resourceGroupName, accountName, containerName, ifMatch); + if (inner != null) { + return new ImmutabilityPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response lockImmutabilityPolicyWithResponse(String resourceGroupName, String accountName, + String containerName, String ifMatch, Context context) { + BlobContainersLockImmutabilityPolicyResponse inner = this.serviceClient() + .lockImmutabilityPolicyWithResponse(resourceGroupName, accountName, containerName, ifMatch, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ImmutabilityPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ImmutabilityPolicy lockImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, + String ifMatch) { + ImmutabilityPolicyInner inner + = this.serviceClient().lockImmutabilityPolicy(resourceGroupName, accountName, containerName, ifMatch); + if (inner != null) { + return new ImmutabilityPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response extendImmutabilityPolicyWithResponse(String resourceGroupName, + String accountName, String containerName, String ifMatch, ImmutabilityPolicyInner parameters, Context context) { + BlobContainersExtendImmutabilityPolicyResponse inner = this.serviceClient() + .extendImmutabilityPolicyWithResponse(resourceGroupName, accountName, containerName, ifMatch, parameters, + context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ImmutabilityPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ImmutabilityPolicy extendImmutabilityPolicy(String resourceGroupName, String accountName, + String containerName, String ifMatch) { + ImmutabilityPolicyInner inner + = this.serviceClient().extendImmutabilityPolicy(resourceGroupName, accountName, containerName, ifMatch); + if (inner != null) { + return new ImmutabilityPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response leaseWithResponse(String resourceGroupName, String accountName, + String containerName, LeaseContainerRequest parameters, Context context) { + Response inner = this.serviceClient() + .leaseWithResponse(resourceGroupName, accountName, containerName, parameters, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LeaseContainerResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LeaseContainerResponse lease(String resourceGroupName, String accountName, String containerName) { + LeaseContainerResponseInner inner = this.serviceClient().lease(resourceGroupName, accountName, containerName); + if (inner != null) { + return new LeaseContainerResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public void objectLevelWorm(String resourceGroupName, String accountName, String containerName) { + this.serviceClient().objectLevelWorm(resourceGroupName, accountName, containerName); + } + + public void objectLevelWorm(String resourceGroupName, String accountName, String containerName, Context context) { + this.serviceClient().objectLevelWorm(resourceGroupName, accountName, containerName, context); + } + + public BlobContainer 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String containerName = ResourceManagerUtils.getValueFromIdByName(id, "containers"); + if (containerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containers'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, containerName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String containerName = ResourceManagerUtils.getValueFromIdByName(id, "containers"); + if (containerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containers'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, containerName, context); + } + + public ImmutabilityPolicy getImmutabilityPolicyById(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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String containerName = ResourceManagerUtils.getValueFromIdByName(id, "containers"); + if (containerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containers'.", id))); + } + String localIfMatch = null; + return this + .getImmutabilityPolicyWithResponse(resourceGroupName, accountName, containerName, localIfMatch, + Context.NONE) + .getValue(); + } + + public Response getImmutabilityPolicyByIdWithResponse(String id, String ifMatch, + 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String containerName = ResourceManagerUtils.getValueFromIdByName(id, "containers"); + if (containerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containers'.", id))); + } + return this.getImmutabilityPolicyWithResponse(resourceGroupName, accountName, containerName, ifMatch, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String containerName = ResourceManagerUtils.getValueFromIdByName(id, "containers"); + if (containerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containers'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, containerName, Context.NONE); + } + + public Response 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String containerName = ResourceManagerUtils.getValueFromIdByName(id, "containers"); + if (containerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containers'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, containerName, context); + } + + public ImmutabilityPolicy deleteImmutabilityPolicyById(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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String containerName = ResourceManagerUtils.getValueFromIdByName(id, "containers"); + if (containerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containers'.", id))); + } + String localIfMatch = null; + return this + .deleteImmutabilityPolicyWithResponse(resourceGroupName, accountName, containerName, localIfMatch, + Context.NONE) + .getValue(); + } + + public Response deleteImmutabilityPolicyByIdWithResponse(String id, String ifMatch, + 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String containerName = ResourceManagerUtils.getValueFromIdByName(id, "containers"); + if (containerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containers'.", id))); + } + return this.deleteImmutabilityPolicyWithResponse(resourceGroupName, accountName, containerName, ifMatch, + context); + } + + private BlobContainersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public BlobContainerImpl define(String name) { + return new BlobContainerImpl(name, this.manager()); + } + + public ImmutabilityPolicyImpl defineImmutabilityPolicy() { + return new ImmutabilityPolicyImpl(this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobInventoryPoliciesClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobInventoryPoliciesClientImpl.java new file mode 100644 index 0000000000000..13ce91a087be2 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobInventoryPoliciesClientImpl.java @@ -0,0 +1,732 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.BlobInventoryPoliciesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobInventoryPolicyInner; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyName; +import com.azure.resourcemanager.storage.generated.models.ListBlobInventoryPolicy; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in BlobInventoryPoliciesClient. + */ +public final class BlobInventoryPoliciesClientImpl implements BlobInventoryPoliciesClient { + /** + * The proxy service used to perform REST calls. + */ + private final BlobInventoryPoliciesService service; + + /** + * The service client containing this operation class. + */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of BlobInventoryPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BlobInventoryPoliciesClientImpl(StorageManagementClientImpl client) { + this.service = RestProxy.create(BlobInventoryPoliciesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientBlobInventoryPolicies to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + public interface BlobInventoryPoliciesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("blobInventoryPolicyName") BlobInventoryPolicyName blobInventoryPolicyName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("blobInventoryPolicyName") BlobInventoryPolicyName blobInventoryPolicyName, + @BodyParam("application/json") BlobInventoryPolicyInner properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("blobInventoryPolicyName") BlobInventoryPolicyName blobInventoryPolicyName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 blob inventory policy associated with the specified storage account along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + BlobInventoryPolicyName blobInventoryPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (blobInventoryPolicyName == null) { + return Mono.error( + new IllegalArgumentException("Parameter blobInventoryPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), blobInventoryPolicyName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @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 blob inventory policy associated with the specified storage account along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (blobInventoryPolicyName == null) { + return Mono.error( + new IllegalArgumentException("Parameter blobInventoryPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), blobInventoryPolicyName, accept, context); + } + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 blob inventory policy associated with the specified storage account on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, + BlobInventoryPolicyName blobInventoryPolicyName) { + return getWithResponseAsync(resourceGroupName, accountName, blobInventoryPolicyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @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 blob inventory policy associated with the specified storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, blobInventoryPolicyName, context).block(); + } + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 blob inventory policy associated with the specified storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobInventoryPolicyInner get(String resourceGroupName, String accountName, + BlobInventoryPolicyName blobInventoryPolicyName) { + return getWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, Context.NONE).getValue(); + } + + /** + * Sets the blob inventory policy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @param properties The blob inventory policy set to a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account blob inventory policy along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String accountName, BlobInventoryPolicyName blobInventoryPolicyName, BlobInventoryPolicyInner properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (blobInventoryPolicyName == null) { + return Mono.error( + new IllegalArgumentException("Parameter blobInventoryPolicyName 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 accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), blobInventoryPolicyName, properties, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Sets the blob inventory policy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @param properties The blob inventory policy set to a storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account blob inventory policy along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String accountName, BlobInventoryPolicyName blobInventoryPolicyName, BlobInventoryPolicyInner properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (blobInventoryPolicyName == null) { + return Mono.error( + new IllegalArgumentException("Parameter blobInventoryPolicyName 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), blobInventoryPolicyName, properties, accept, + context); + } + + /** + * Sets the blob inventory policy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @param properties The blob inventory policy set to a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account blob inventory policy on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, BlobInventoryPolicyInner properties) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, blobInventoryPolicyName, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Sets the blob inventory policy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @param properties The blob inventory policy set to a storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account blob inventory policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, BlobInventoryPolicyInner properties, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, blobInventoryPolicyName, properties, + context).block(); + } + + /** + * Sets the blob inventory policy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @param properties The blob inventory policy set to a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account blob inventory policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobInventoryPolicyInner createOrUpdate(String resourceGroupName, String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, BlobInventoryPolicyInner properties) { + return createOrUpdateWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, properties, + Context.NONE).getValue(); + } + + /** + * Deletes the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 accountName, + BlobInventoryPolicyName blobInventoryPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (blobInventoryPolicyName == null) { + return Mono.error( + new IllegalArgumentException("Parameter blobInventoryPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), blobInventoryPolicyName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @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 accountName, + BlobInventoryPolicyName blobInventoryPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (blobInventoryPolicyName == null) { + return Mono.error( + new IllegalArgumentException("Parameter blobInventoryPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), blobInventoryPolicyName, accept, context); + } + + /** + * Deletes the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 accountName, + BlobInventoryPolicyName blobInventoryPolicyName) { + return deleteWithResponseAsync(resourceGroupName, accountName, blobInventoryPolicyName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, blobInventoryPolicyName, context).block(); + } + + /** + * Deletes the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName) { + deleteWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, Context.NONE); + } + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 blob inventory policy associated with the specified storage account along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 blob inventory policy associated with the specified storage account along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), null, null)); + } + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 blob inventory policy associated with the specified storage account as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName)); + } + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 blob inventory policy associated with the specified storage account as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, context)); + } + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 blob inventory policy associated with the specified storage account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName)); + } + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 blob inventory policy associated with the specified storage account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobInventoryPoliciesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobInventoryPoliciesImpl.java new file mode 100644 index 0000000000000..8285752452b63 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobInventoryPoliciesImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.BlobInventoryPoliciesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobInventoryPolicyInner; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicies; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicy; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyName; + +public final class BlobInventoryPoliciesImpl implements BlobInventoryPolicies { + private static final ClientLogger LOGGER = new ClientLogger(BlobInventoryPoliciesImpl.class); + + private final BlobInventoryPoliciesClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public BlobInventoryPoliciesImpl(BlobInventoryPoliciesClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new BlobInventoryPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BlobInventoryPolicy get(String resourceGroupName, String accountName, + BlobInventoryPolicyName blobInventoryPolicyName) { + BlobInventoryPolicyInner inner + = this.serviceClient().get(resourceGroupName, accountName, blobInventoryPolicyName); + if (inner != null) { + return new BlobInventoryPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, context); + } + + public void delete(String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName) { + this.serviceClient().delete(resourceGroupName, accountName, blobInventoryPolicyName); + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BlobInventoryPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BlobInventoryPolicyImpl(inner1, this.manager())); + } + + public BlobInventoryPolicy 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String blobInventoryPolicyNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "inventoryPolicies"); + if (blobInventoryPolicyNameLocal == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'inventoryPolicies'.", id))); + } + BlobInventoryPolicyName blobInventoryPolicyName + = BlobInventoryPolicyName.fromString(blobInventoryPolicyNameLocal); + return this.getWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String blobInventoryPolicyNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "inventoryPolicies"); + if (blobInventoryPolicyNameLocal == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'inventoryPolicies'.", id))); + } + BlobInventoryPolicyName blobInventoryPolicyName + = BlobInventoryPolicyName.fromString(blobInventoryPolicyNameLocal); + return this.getWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String blobInventoryPolicyNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "inventoryPolicies"); + if (blobInventoryPolicyNameLocal == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'inventoryPolicies'.", id))); + } + BlobInventoryPolicyName blobInventoryPolicyName + = BlobInventoryPolicyName.fromString(blobInventoryPolicyNameLocal); + this.deleteWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, Context.NONE); + } + + public Response 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String blobInventoryPolicyNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "inventoryPolicies"); + if (blobInventoryPolicyNameLocal == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'inventoryPolicies'.", id))); + } + BlobInventoryPolicyName blobInventoryPolicyName + = BlobInventoryPolicyName.fromString(blobInventoryPolicyNameLocal); + return this.deleteWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, context); + } + + private BlobInventoryPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public BlobInventoryPolicyImpl define(BlobInventoryPolicyName name) { + return new BlobInventoryPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobInventoryPolicyImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobInventoryPolicyImpl.java new file mode 100644 index 0000000000000..49dcac2ebcee7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobInventoryPolicyImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobInventoryPolicyInner; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicy; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyName; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicySchema; +import java.time.OffsetDateTime; + +public final class BlobInventoryPolicyImpl + implements BlobInventoryPolicy, BlobInventoryPolicy.Definition, BlobInventoryPolicy.Update { + private BlobInventoryPolicyInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public OffsetDateTime lastModifiedTime() { + return this.innerModel().lastModifiedTime(); + } + + public BlobInventoryPolicySchema policy() { + return this.innerModel().policy(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public BlobInventoryPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private BlobInventoryPolicyName blobInventoryPolicyName; + + public BlobInventoryPolicyImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public BlobInventoryPolicy create() { + this.innerObject = serviceManager.serviceClient() + .getBlobInventoryPolicies() + .createOrUpdateWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public BlobInventoryPolicy create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBlobInventoryPolicies() + .createOrUpdateWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, this.innerModel(), + context) + .getValue(); + return this; + } + + BlobInventoryPolicyImpl(BlobInventoryPolicyName name, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new BlobInventoryPolicyInner(); + this.serviceManager = serviceManager; + this.blobInventoryPolicyName = name; + } + + public BlobInventoryPolicyImpl update() { + return this; + } + + public BlobInventoryPolicy apply() { + this.innerObject = serviceManager.serviceClient() + .getBlobInventoryPolicies() + .createOrUpdateWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public BlobInventoryPolicy apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBlobInventoryPolicies() + .createOrUpdateWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, this.innerModel(), + context) + .getValue(); + return this; + } + + BlobInventoryPolicyImpl(BlobInventoryPolicyInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.blobInventoryPolicyName = BlobInventoryPolicyName + .fromString(ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "inventoryPolicies")); + } + + public BlobInventoryPolicy refresh() { + this.innerObject = serviceManager.serviceClient() + .getBlobInventoryPolicies() + .getWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, Context.NONE) + .getValue(); + return this; + } + + public BlobInventoryPolicy refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBlobInventoryPolicies() + .getWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, context) + .getValue(); + return this; + } + + public BlobInventoryPolicyImpl withPolicy(BlobInventoryPolicySchema policy) { + this.innerModel().withPolicy(policy); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobRestoreStatusImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobRestoreStatusImpl.java new file mode 100644 index 0000000000000..28166f669d811 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobRestoreStatusImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.BlobRestoreStatusInner; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreParameters; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreProgressStatus; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreStatus; + +public final class BlobRestoreStatusImpl implements BlobRestoreStatus { + private BlobRestoreStatusInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + BlobRestoreStatusImpl(BlobRestoreStatusInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public BlobRestoreProgressStatus status() { + return this.innerModel().status(); + } + + public String failureReason() { + return this.innerModel().failureReason(); + } + + public String restoreId() { + return this.innerModel().restoreId(); + } + + public BlobRestoreParameters parameters() { + return this.innerModel().parameters(); + } + + public BlobRestoreStatusInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobServicePropertiesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobServicePropertiesImpl.java new file mode 100644 index 0000000000000..bb9e7553779fe --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobServicePropertiesImpl.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobServicePropertiesInner; +import com.azure.resourcemanager.storage.generated.models.BlobServiceProperties; +import com.azure.resourcemanager.storage.generated.models.ChangeFeed; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.azure.resourcemanager.storage.generated.models.DeleteRetentionPolicy; +import com.azure.resourcemanager.storage.generated.models.LastAccessTimeTrackingPolicy; +import com.azure.resourcemanager.storage.generated.models.RestorePolicyProperties; +import com.azure.resourcemanager.storage.generated.models.Sku; + +public final class BlobServicePropertiesImpl + implements BlobServiceProperties, BlobServiceProperties.Definition, BlobServiceProperties.Update { + private BlobServicePropertiesInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public CorsRules cors() { + return this.innerModel().cors(); + } + + public String defaultServiceVersion() { + return this.innerModel().defaultServiceVersion(); + } + + public DeleteRetentionPolicy deleteRetentionPolicy() { + return this.innerModel().deleteRetentionPolicy(); + } + + public Boolean isVersioningEnabled() { + return this.innerModel().isVersioningEnabled(); + } + + public Boolean automaticSnapshotPolicyEnabled() { + return this.innerModel().automaticSnapshotPolicyEnabled(); + } + + public ChangeFeed changeFeed() { + return this.innerModel().changeFeed(); + } + + public RestorePolicyProperties restorePolicy() { + return this.innerModel().restorePolicy(); + } + + public DeleteRetentionPolicy containerDeleteRetentionPolicy() { + return this.innerModel().containerDeleteRetentionPolicy(); + } + + public LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy() { + return this.innerModel().lastAccessTimeTrackingPolicy(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public BlobServicePropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + public BlobServicePropertiesImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public BlobServiceProperties create() { + this.innerObject = serviceManager.serviceClient() + .getBlobServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public BlobServiceProperties create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBlobServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), context) + .getValue(); + return this; + } + + BlobServicePropertiesImpl(com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new BlobServicePropertiesInner(); + this.serviceManager = serviceManager; + } + + public BlobServicePropertiesImpl update() { + return this; + } + + public BlobServiceProperties apply() { + this.innerObject = serviceManager.serviceClient() + .getBlobServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public BlobServiceProperties apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBlobServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), context) + .getValue(); + return this; + } + + BlobServicePropertiesImpl(BlobServicePropertiesInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + } + + public BlobServiceProperties refresh() { + this.innerObject = serviceManager.serviceClient() + .getBlobServices() + .getServicePropertiesWithResponse(resourceGroupName, accountName, Context.NONE) + .getValue(); + return this; + } + + public BlobServiceProperties refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBlobServices() + .getServicePropertiesWithResponse(resourceGroupName, accountName, context) + .getValue(); + return this; + } + + public BlobServicePropertiesImpl withCors(CorsRules cors) { + this.innerModel().withCors(cors); + return this; + } + + public BlobServicePropertiesImpl withDefaultServiceVersion(String defaultServiceVersion) { + this.innerModel().withDefaultServiceVersion(defaultServiceVersion); + return this; + } + + public BlobServicePropertiesImpl withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy) { + this.innerModel().withDeleteRetentionPolicy(deleteRetentionPolicy); + return this; + } + + public BlobServicePropertiesImpl withIsVersioningEnabled(Boolean isVersioningEnabled) { + this.innerModel().withIsVersioningEnabled(isVersioningEnabled); + return this; + } + + public BlobServicePropertiesImpl withAutomaticSnapshotPolicyEnabled(Boolean automaticSnapshotPolicyEnabled) { + this.innerModel().withAutomaticSnapshotPolicyEnabled(automaticSnapshotPolicyEnabled); + return this; + } + + public BlobServicePropertiesImpl withChangeFeed(ChangeFeed changeFeed) { + this.innerModel().withChangeFeed(changeFeed); + return this; + } + + public BlobServicePropertiesImpl withRestorePolicy(RestorePolicyProperties restorePolicy) { + this.innerModel().withRestorePolicy(restorePolicy); + return this; + } + + public BlobServicePropertiesImpl + withContainerDeleteRetentionPolicy(DeleteRetentionPolicy containerDeleteRetentionPolicy) { + this.innerModel().withContainerDeleteRetentionPolicy(containerDeleteRetentionPolicy); + return this; + } + + public BlobServicePropertiesImpl + withLastAccessTimeTrackingPolicy(LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy) { + this.innerModel().withLastAccessTimeTrackingPolicy(lastAccessTimeTrackingPolicy); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobServicesClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobServicesClientImpl.java new file mode 100644 index 0000000000000..25055aab63c84 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobServicesClientImpl.java @@ -0,0 +1,550 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.BodyParam; +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.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.BlobServicesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobServicePropertiesInner; +import com.azure.resourcemanager.storage.generated.models.BlobServiceItems; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in BlobServicesClient. + */ +public final class BlobServicesClientImpl implements BlobServicesClient { + /** + * The proxy service used to perform REST calls. + */ + private final BlobServicesService service; + + /** + * The service client containing this operation class. + */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of BlobServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BlobServicesClientImpl(StorageManagementClientImpl client) { + this.service + = RestProxy.create(BlobServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientBlobServices to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + public interface BlobServicesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> setServiceProperties(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("BlobServicesName") String blobServicesName, + @BodyParam("application/json") BlobServicePropertiesInner parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getServiceProperties(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("BlobServicesName") String blobServicesName, @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List blob services of storage account. It returns a collection of one object named default. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List blob services of storage account. It returns a collection of one object named default. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), null, null)); + } + + /** + * List blob services of storage account. It returns a collection of one object named default. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName)); + } + + /** + * List blob services of storage account. It returns a collection of one object named default. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, context)); + } + + /** + * List blob services of storage account. It returns a collection of one object named default. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName)); + } + + /** + * List blob services of storage account. It returns a collection of one object named default. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); + } + + /** + * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics + * and CORS (Cross-Origin Resource Sharing) rules. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of a storage account’s Blob service along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> setServicePropertiesWithResponseAsync(String resourceGroupName, + String accountName, BlobServicePropertiesInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String blobServicesName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.setServiceProperties(this.client.getEndpoint(), resourceGroupName, + accountName, this.client.getApiVersion(), this.client.getSubscriptionId(), blobServicesName, parameters, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics + * and CORS (Cross-Origin Resource Sharing) rules. + * @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 properties of a storage account’s Blob service along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> setServicePropertiesWithResponseAsync(String resourceGroupName, + String accountName, BlobServicePropertiesInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String blobServicesName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.setServiceProperties(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), blobServicesName, parameters, accept, + context); + } + + /** + * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics + * and CORS (Cross-Origin Resource Sharing) rules. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of a storage account’s Blob service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setServicePropertiesAsync(String resourceGroupName, String accountName, + BlobServicePropertiesInner parameters) { + return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics + * and CORS (Cross-Origin Resource Sharing) rules. + * @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 properties of a storage account’s Blob service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response setServicePropertiesWithResponse(String resourceGroupName, + String accountName, BlobServicePropertiesInner parameters, Context context) { + return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Blob service, including properties for Storage Analytics + * and CORS (Cross-Origin Resource Sharing) rules. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of a storage account’s Blob service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobServicePropertiesInner setServiceProperties(String resourceGroupName, String accountName, + BlobServicePropertiesInner parameters) { + return setServicePropertiesWithResponse(resourceGroupName, accountName, parameters, Context.NONE).getValue(); + } + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getServicePropertiesWithResponseAsync(String resourceGroupName, + String accountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String blobServicesName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getServiceProperties(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), blobServicesName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getServicePropertiesWithResponseAsync(String resourceGroupName, + String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String blobServicesName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getServiceProperties(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), blobServicesName, accept, context); + } + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getServicePropertiesAsync(String resourceGroupName, String accountName) { + return getServicePropertiesWithResponseAsync(resourceGroupName, accountName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getServicePropertiesWithResponse(String resourceGroupName, + String accountName, Context context) { + return getServicePropertiesWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName) { + return getServicePropertiesWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobServicesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobServicesImpl.java new file mode 100644 index 0000000000000..eacd8ceea7d07 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobServicesImpl.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.BlobServicesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobServicePropertiesInner; +import com.azure.resourcemanager.storage.generated.models.BlobServiceProperties; +import com.azure.resourcemanager.storage.generated.models.BlobServices; + +public final class BlobServicesImpl implements BlobServices { + private static final ClientLogger LOGGER = new ClientLogger(BlobServicesImpl.class); + + private final BlobServicesClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public BlobServicesImpl(BlobServicesClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BlobServicePropertiesImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BlobServicePropertiesImpl(inner1, this.manager())); + } + + public Response getServicePropertiesWithResponse(String resourceGroupName, + String accountName, Context context) { + Response inner + = this.serviceClient().getServicePropertiesWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new BlobServicePropertiesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BlobServiceProperties getServiceProperties(String resourceGroupName, String accountName) { + BlobServicePropertiesInner inner = this.serviceClient().getServiceProperties(resourceGroupName, accountName); + if (inner != null) { + return new BlobServicePropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public BlobServiceProperties getServicePropertiesById(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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + return this.getServicePropertiesWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } + + public Response getServicePropertiesByIdWithResponse(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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + return this.getServicePropertiesWithResponse(resourceGroupName, accountName, context); + } + + private BlobServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public BlobServicePropertiesImpl define() { + return new BlobServicePropertiesImpl(this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/CheckNameAvailabilityResultImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/CheckNameAvailabilityResultImpl.java new file mode 100644 index 0000000000000..9e86da286ab5d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/CheckNameAvailabilityResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.storage.generated.models.CheckNameAvailabilityResult; +import com.azure.resourcemanager.storage.generated.models.Reason; + +public final class CheckNameAvailabilityResultImpl implements CheckNameAvailabilityResult { + private CheckNameAvailabilityResultInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + CheckNameAvailabilityResultImpl(CheckNameAvailabilityResultInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public Reason reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public CheckNameAvailabilityResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/DeletedAccountImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/DeletedAccountImpl.java new file mode 100644 index 0000000000000..14aa5dd071691 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/DeletedAccountImpl.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.DeletedAccountInner; +import com.azure.resourcemanager.storage.generated.models.DeletedAccount; + +public final class DeletedAccountImpl implements DeletedAccount { + private DeletedAccountInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + DeletedAccountImpl(DeletedAccountInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String storageAccountResourceId() { + return this.innerModel().storageAccountResourceId(); + } + + public String location() { + return this.innerModel().location(); + } + + public String restoreReference() { + return this.innerModel().restoreReference(); + } + + public String creationTime() { + return this.innerModel().creationTime(); + } + + public String deletionTime() { + return this.innerModel().deletionTime(); + } + + public DeletedAccountInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/DeletedAccountsClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/DeletedAccountsClientImpl.java new file mode 100644 index 0000000000000..fec7dbaf0f18b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/DeletedAccountsClientImpl.java @@ -0,0 +1,369 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.DeletedAccountsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.DeletedAccountInner; +import com.azure.resourcemanager.storage.generated.models.DeletedAccountListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in DeletedAccountsClient. + */ +public final class DeletedAccountsClientImpl implements DeletedAccountsClient { + /** + * The proxy service used to perform REST calls. + */ + private final DeletedAccountsService service; + + /** + * The service client containing this operation class. + */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of DeletedAccountsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DeletedAccountsClientImpl(StorageManagementClientImpl client) { + this.service + = RestProxy.create(DeletedAccountsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientDeletedAccounts to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + public interface DeletedAccountsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/deletedAccounts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/deletedAccounts/{deletedAccountName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("deletedAccountName") String deletedAccountName, @PathParam("location") String location, + @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> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists deleted accounts under the subscription. + * + * @throws 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 from the List Deleted Accounts 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())); + } + + /** + * Lists deleted accounts under the subscription. + * + * @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 from the List Deleted Accounts 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)); + } + + /** + * Lists deleted accounts under the subscription. + * + * @throws 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 from the List Deleted Accounts operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists deleted accounts under the subscription. + * + * @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 from the List Deleted Accounts operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists deleted accounts under the subscription. + * + * @throws 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 from the List Deleted Accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists deleted accounts under the subscription. + * + * @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 from the List Deleted Accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get properties of specified deleted account resource. + * + * @param deletedAccountName Name of the deleted storage account. + * @param location The location of the deleted storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of specified deleted account resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String deletedAccountName, String location) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deletedAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter deletedAccountName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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.get(this.client.getEndpoint(), deletedAccountName, location, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get properties of specified deleted account resource. + * + * @param deletedAccountName Name of the deleted storage account. + * @param location The location of the deleted storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of specified deleted account resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String deletedAccountName, String location, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deletedAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter deletedAccountName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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.get(this.client.getEndpoint(), deletedAccountName, location, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + } + + /** + * Get properties of specified deleted account resource. + * + * @param deletedAccountName Name of the deleted storage account. + * @param location The location of the deleted storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of specified deleted account resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String deletedAccountName, String location) { + return getWithResponseAsync(deletedAccountName, location).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get properties of specified deleted account resource. + * + * @param deletedAccountName Name of the deleted storage account. + * @param location The location of the deleted storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of specified deleted account resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String deletedAccountName, String location, Context context) { + return getWithResponseAsync(deletedAccountName, location, context).block(); + } + + /** + * Get properties of specified deleted account resource. + * + * @param deletedAccountName Name of the deleted storage account. + * @param location The location of the deleted storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of specified deleted account resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeletedAccountInner get(String deletedAccountName, String location) { + return getWithResponse(deletedAccountName, location, Context.NONE).getValue(); + } + + /** + * 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 from the List Deleted Accounts operation 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 the response from the List Deleted Accounts operation 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/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/DeletedAccountsImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/DeletedAccountsImpl.java new file mode 100644 index 0000000000000..b3f33ce4601cf --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/DeletedAccountsImpl.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.DeletedAccountsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.DeletedAccountInner; +import com.azure.resourcemanager.storage.generated.models.DeletedAccount; +import com.azure.resourcemanager.storage.generated.models.DeletedAccounts; + +public final class DeletedAccountsImpl implements DeletedAccounts { + private static final ClientLogger LOGGER = new ClientLogger(DeletedAccountsImpl.class); + + private final DeletedAccountsClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public DeletedAccountsImpl(DeletedAccountsClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeletedAccountImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeletedAccountImpl(inner1, this.manager())); + } + + public Response getWithResponse(String deletedAccountName, String location, Context context) { + Response inner + = this.serviceClient().getWithResponse(deletedAccountName, location, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DeletedAccountImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeletedAccount get(String deletedAccountName, String location) { + DeletedAccountInner inner = this.serviceClient().get(deletedAccountName, location); + if (inner != null) { + return new DeletedAccountImpl(inner, this.manager()); + } else { + return null; + } + } + + private DeletedAccountsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/EncryptionScopeImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/EncryptionScopeImpl.java new file mode 100644 index 0000000000000..6fd2ca832a234 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/EncryptionScopeImpl.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.EncryptionScopeInner; +import com.azure.resourcemanager.storage.generated.models.EncryptionScope; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeKeyVaultProperties; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeSource; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeState; +import java.time.OffsetDateTime; + +public final class EncryptionScopeImpl implements EncryptionScope, EncryptionScope.Definition, EncryptionScope.Update { + private EncryptionScopeInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public EncryptionScopeSource source() { + return this.innerModel().source(); + } + + public EncryptionScopeState state() { + return this.innerModel().state(); + } + + public OffsetDateTime creationTime() { + return this.innerModel().creationTime(); + } + + public OffsetDateTime lastModifiedTime() { + return this.innerModel().lastModifiedTime(); + } + + public EncryptionScopeKeyVaultProperties keyVaultProperties() { + return this.innerModel().keyVaultProperties(); + } + + public Boolean requireInfrastructureEncryption() { + return this.innerModel().requireInfrastructureEncryption(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public EncryptionScopeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String encryptionScopeName; + + public EncryptionScopeImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public EncryptionScope create() { + this.innerObject = serviceManager.serviceClient() + .getEncryptionScopes() + .putWithResponse(resourceGroupName, accountName, encryptionScopeName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public EncryptionScope create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEncryptionScopes() + .putWithResponse(resourceGroupName, accountName, encryptionScopeName, this.innerModel(), context) + .getValue(); + return this; + } + + EncryptionScopeImpl(String name, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new EncryptionScopeInner(); + this.serviceManager = serviceManager; + this.encryptionScopeName = name; + } + + public EncryptionScopeImpl update() { + return this; + } + + public EncryptionScope apply() { + this.innerObject = serviceManager.serviceClient() + .getEncryptionScopes() + .patchWithResponse(resourceGroupName, accountName, encryptionScopeName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public EncryptionScope apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEncryptionScopes() + .patchWithResponse(resourceGroupName, accountName, encryptionScopeName, this.innerModel(), context) + .getValue(); + return this; + } + + EncryptionScopeImpl(EncryptionScopeInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.encryptionScopeName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "encryptionScopes"); + } + + public EncryptionScope refresh() { + this.innerObject = serviceManager.serviceClient() + .getEncryptionScopes() + .getWithResponse(resourceGroupName, accountName, encryptionScopeName, Context.NONE) + .getValue(); + return this; + } + + public EncryptionScope refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEncryptionScopes() + .getWithResponse(resourceGroupName, accountName, encryptionScopeName, context) + .getValue(); + return this; + } + + public EncryptionScopeImpl withSource(EncryptionScopeSource source) { + this.innerModel().withSource(source); + return this; + } + + public EncryptionScopeImpl withState(EncryptionScopeState state) { + this.innerModel().withState(state); + return this; + } + + public EncryptionScopeImpl withKeyVaultProperties(EncryptionScopeKeyVaultProperties keyVaultProperties) { + this.innerModel().withKeyVaultProperties(keyVaultProperties); + return this; + } + + public EncryptionScopeImpl withRequireInfrastructureEncryption(Boolean requireInfrastructureEncryption) { + this.innerModel().withRequireInfrastructureEncryption(requireInfrastructureEncryption); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/EncryptionScopesClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/EncryptionScopesClientImpl.java new file mode 100644 index 0000000000000..4d63a8a7982f4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/EncryptionScopesClientImpl.java @@ -0,0 +1,893 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.BodyParam; +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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.EncryptionScopesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.EncryptionScopeInner; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeListResult; +import com.azure.resourcemanager.storage.generated.models.ListEncryptionScopesInclude; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in EncryptionScopesClient. + */ +public final class EncryptionScopesClientImpl implements EncryptionScopesClient { + /** + * The proxy service used to perform REST calls. + */ + private final EncryptionScopesService service; + + /** + * The service client containing this operation class. + */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of EncryptionScopesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EncryptionScopesClientImpl(StorageManagementClientImpl client) { + this.service + = RestProxy.create(EncryptionScopesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientEncryptionScopes to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + public interface EncryptionScopesService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> put(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("encryptionScopeName") String encryptionScopeName, + @BodyParam("application/json") EncryptionScopeInner encryptionScope, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> patch(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("encryptionScopeName") String encryptionScopeName, + @BodyParam("application/json") EncryptionScopeInner encryptionScope, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("encryptionScopeName") String encryptionScopeName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$maxpagesize") Integer maxpagesize, @QueryParam("$filter") String filter, + @QueryParam("$include") ListEncryptionScopesInclude include, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope + * is already created and a subsequent request is issued with different properties, the encryption scope properties + * will be updated per the specified request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption + * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + * Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param encryptionScope Encryption scope properties to be used for the create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Encryption Scope resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync(String resourceGroupName, String accountName, + String encryptionScopeName, EncryptionScopeInner encryptionScope) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (encryptionScopeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionScopeName is required and cannot be null.")); + } + if (encryptionScope == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionScope is required and cannot be null.")); + } else { + encryptionScope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), encryptionScopeName, encryptionScope, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope + * is already created and a subsequent request is issued with different properties, the encryption scope properties + * will be updated per the specified request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption + * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + * Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param encryptionScope Encryption scope properties to be used for the create or update. + * @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 Encryption Scope resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync(String resourceGroupName, String accountName, + String encryptionScopeName, EncryptionScopeInner encryptionScope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (encryptionScopeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionScopeName is required and cannot be null.")); + } + if (encryptionScope == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionScope is required and cannot be null.")); + } else { + encryptionScope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.put(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), encryptionScopeName, encryptionScope, accept, context); + } + + /** + * Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope + * is already created and a subsequent request is issued with different properties, the encryption scope properties + * will be updated per the specified request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption + * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + * Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param encryptionScope Encryption scope properties to be used for the create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Encryption Scope resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync(String resourceGroupName, String accountName, + String encryptionScopeName, EncryptionScopeInner encryptionScope) { + return putWithResponseAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope + * is already created and a subsequent request is issued with different properties, the encryption scope properties + * will be updated per the specified request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption + * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + * Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param encryptionScope Encryption scope properties to be used for the create or update. + * @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 Encryption Scope resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(String resourceGroupName, String accountName, + String encryptionScopeName, EncryptionScopeInner encryptionScope, Context context) { + return putWithResponseAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope, context) + .block(); + } + + /** + * Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope + * is already created and a subsequent request is issued with different properties, the encryption scope properties + * will be updated per the specified request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption + * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + * Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param encryptionScope Encryption scope properties to be used for the create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Encryption Scope resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EncryptionScopeInner put(String resourceGroupName, String accountName, String encryptionScopeName, + EncryptionScopeInner encryptionScope) { + return putWithResponse(resourceGroupName, accountName, encryptionScopeName, encryptionScope, Context.NONE) + .getValue(); + } + + /** + * Update encryption scope properties as specified in the request body. Update fails if the specified encryption + * scope does not already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption + * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + * Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param encryptionScope Encryption scope properties to be used for the update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Encryption Scope resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> patchWithResponseAsync(String resourceGroupName, String accountName, + String encryptionScopeName, EncryptionScopeInner encryptionScope) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (encryptionScopeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionScopeName is required and cannot be null.")); + } + if (encryptionScope == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionScope is required and cannot be null.")); + } else { + encryptionScope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.patch(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), encryptionScopeName, encryptionScope, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update encryption scope properties as specified in the request body. Update fails if the specified encryption + * scope does not already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption + * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + * Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param encryptionScope Encryption scope properties to be used for the update. + * @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 Encryption Scope resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> patchWithResponseAsync(String resourceGroupName, String accountName, + String encryptionScopeName, EncryptionScopeInner encryptionScope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (encryptionScopeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionScopeName is required and cannot be null.")); + } + if (encryptionScope == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionScope is required and cannot be null.")); + } else { + encryptionScope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.patch(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), encryptionScopeName, encryptionScope, accept, context); + } + + /** + * Update encryption scope properties as specified in the request body. Update fails if the specified encryption + * scope does not already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption + * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + * Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param encryptionScope Encryption scope properties to be used for the update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Encryption Scope resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono patchAsync(String resourceGroupName, String accountName, + String encryptionScopeName, EncryptionScopeInner encryptionScope) { + return patchWithResponseAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update encryption scope properties as specified in the request body. Update fails if the specified encryption + * scope does not already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption + * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + * Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param encryptionScope Encryption scope properties to be used for the update. + * @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 Encryption Scope resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response patchWithResponse(String resourceGroupName, String accountName, + String encryptionScopeName, EncryptionScopeInner encryptionScope, Context context) { + return patchWithResponseAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope, context) + .block(); + } + + /** + * Update encryption scope properties as specified in the request body. Update fails if the specified encryption + * scope does not already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption + * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + * Every dash (-) character must be immediately preceded and followed by a letter or number. + * @param encryptionScope Encryption scope properties to be used for the update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Encryption Scope resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EncryptionScopeInner patch(String resourceGroupName, String accountName, String encryptionScopeName, + EncryptionScopeInner encryptionScope) { + return patchWithResponse(resourceGroupName, accountName, encryptionScopeName, encryptionScope, Context.NONE) + .getValue(); + } + + /** + * Returns the properties for the specified encryption scope. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption + * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + * Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Encryption Scope resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String encryptionScopeName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (encryptionScopeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionScopeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), encryptionScopeName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the properties for the specified encryption scope. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption + * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + * Every dash (-) character must be immediately preceded and followed by a letter or number. + * @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 Encryption Scope resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String encryptionScopeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (encryptionScopeName == null) { + return Mono + .error(new IllegalArgumentException("Parameter encryptionScopeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), encryptionScopeName, accept, context); + } + + /** + * Returns the properties for the specified encryption scope. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption + * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + * Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Encryption Scope resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, + String encryptionScopeName) { + return getWithResponseAsync(resourceGroupName, accountName, encryptionScopeName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns the properties for the specified encryption scope. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption + * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + * Every dash (-) character must be immediately preceded and followed by a letter or number. + * @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 Encryption Scope resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, + String encryptionScopeName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, encryptionScopeName, context).block(); + } + + /** + * Returns the properties for the specified encryption scope. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption + * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + * Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Encryption Scope resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EncryptionScopeInner get(String resourceGroupName, String accountName, String encryptionScopeName) { + return getWithResponse(resourceGroupName, accountName, encryptionScopeName, Context.NONE).getValue(); + } + + /** + * Lists all the encryption scopes available under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of encryption scopes that will be included in the list + * response. + * @param filter Optional. When specified, only encryption scope names starting with the filter will be listed. + * @param include Optional, when specified, will list encryption scopes with the specific state. Defaults to All. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName, + Integer maxpagesize, String filter, ListEncryptionScopesInclude include) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), maxpagesize, filter, include, 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())); + } + + /** + * Lists all the encryption scopes available under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of encryption scopes that will be included in the list + * response. + * @param filter Optional. When specified, only encryption scope names starting with the filter will be listed. + * @param include Optional, when specified, will list encryption scopes with the specific state. Defaults to All. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName, + Integer maxpagesize, String filter, ListEncryptionScopesInclude include, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), maxpagesize, filter, include, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all the encryption scopes available under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of encryption scopes that will be included in the list + * response. + * @param filter Optional. When specified, only encryption scope names starting with the filter will be listed. + * @param include Optional, when specified, will list encryption scopes with the specific state. Defaults to All. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, Integer maxpagesize, + String filter, ListEncryptionScopesInclude include) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, include), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the encryption scopes available under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + final Integer maxpagesize = null; + final String filter = null; + final ListEncryptionScopesInclude include = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, include), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the encryption scopes available under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of encryption scopes that will be included in the list + * response. + * @param filter Optional. When specified, only encryption scope names starting with the filter will be listed. + * @param include Optional, when specified, will list encryption scopes with the specific state. Defaults to All. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, Integer maxpagesize, + String filter, ListEncryptionScopesInclude include, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, include, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the encryption scopes available under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + final Integer maxpagesize = null; + final String filter = null; + final ListEncryptionScopesInclude include = null; + return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter, include)); + } + + /** + * Lists all the encryption scopes available under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of encryption scopes that will be included in the list + * response. + * @param filter Optional. When specified, only encryption scope names starting with the filter will be listed. + * @param include Optional, when specified, will list encryption scopes with the specific state. Defaults to All. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, Integer maxpagesize, + String filter, ListEncryptionScopesInclude include, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter, include, 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 list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes 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 list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes 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/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/EncryptionScopesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/EncryptionScopesImpl.java new file mode 100644 index 0000000000000..35a3a22e4a227 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/EncryptionScopesImpl.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.EncryptionScopesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.EncryptionScopeInner; +import com.azure.resourcemanager.storage.generated.models.EncryptionScope; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopes; +import com.azure.resourcemanager.storage.generated.models.ListEncryptionScopesInclude; + +public final class EncryptionScopesImpl implements EncryptionScopes { + private static final ClientLogger LOGGER = new ClientLogger(EncryptionScopesImpl.class); + + private final EncryptionScopesClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public EncryptionScopesImpl(EncryptionScopesClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String accountName, + String encryptionScopeName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, accountName, encryptionScopeName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EncryptionScopeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EncryptionScope get(String resourceGroupName, String accountName, String encryptionScopeName) { + EncryptionScopeInner inner = this.serviceClient().get(resourceGroupName, accountName, encryptionScopeName); + if (inner != null) { + return new EncryptionScopeImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EncryptionScopeImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Integer maxpagesize, + String filter, ListEncryptionScopesInclude include, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName, maxpagesize, filter, include, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EncryptionScopeImpl(inner1, this.manager())); + } + + public EncryptionScope 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String encryptionScopeName = ResourceManagerUtils.getValueFromIdByName(id, "encryptionScopes"); + if (encryptionScopeName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'encryptionScopes'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, encryptionScopeName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String encryptionScopeName = ResourceManagerUtils.getValueFromIdByName(id, "encryptionScopes"); + if (encryptionScopeName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'encryptionScopes'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, encryptionScopeName, context); + } + + private EncryptionScopesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public EncryptionScopeImpl define(String name) { + return new EncryptionScopeImpl(name, this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServiceItemsImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServiceItemsImpl.java new file mode 100644 index 0000000000000..5ca97d1a6393d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServiceItemsImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.FileServiceItemsInner; +import com.azure.resourcemanager.storage.generated.fluent.models.FileServicePropertiesInner; +import com.azure.resourcemanager.storage.generated.models.FileServiceItems; +import com.azure.resourcemanager.storage.generated.models.FileServiceProperties; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class FileServiceItemsImpl implements FileServiceItems { + private FileServiceItemsInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + FileServiceItemsImpl(FileServiceItemsInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new FileServicePropertiesImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public FileServiceItemsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServicePropertiesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServicePropertiesImpl.java new file mode 100644 index 0000000000000..56646ddd9cd2d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServicePropertiesImpl.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.FileServicePropertiesInner; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.azure.resourcemanager.storage.generated.models.DeleteRetentionPolicy; +import com.azure.resourcemanager.storage.generated.models.FileServiceProperties; +import com.azure.resourcemanager.storage.generated.models.ProtocolSettings; +import com.azure.resourcemanager.storage.generated.models.Sku; + +public final class FileServicePropertiesImpl + implements FileServiceProperties, FileServiceProperties.Definition, FileServiceProperties.Update { + private FileServicePropertiesInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public CorsRules cors() { + return this.innerModel().cors(); + } + + public DeleteRetentionPolicy shareDeleteRetentionPolicy() { + return this.innerModel().shareDeleteRetentionPolicy(); + } + + public ProtocolSettings protocolSettings() { + return this.innerModel().protocolSettings(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public FileServicePropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + public FileServicePropertiesImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public FileServiceProperties create() { + this.innerObject = serviceManager.serviceClient() + .getFileServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public FileServiceProperties create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFileServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), context) + .getValue(); + return this; + } + + FileServicePropertiesImpl(com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new FileServicePropertiesInner(); + this.serviceManager = serviceManager; + } + + public FileServicePropertiesImpl update() { + return this; + } + + public FileServiceProperties apply() { + this.innerObject = serviceManager.serviceClient() + .getFileServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public FileServiceProperties apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFileServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), context) + .getValue(); + return this; + } + + FileServicePropertiesImpl(FileServicePropertiesInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + } + + public FileServiceProperties refresh() { + this.innerObject = serviceManager.serviceClient() + .getFileServices() + .getServicePropertiesWithResponse(resourceGroupName, accountName, Context.NONE) + .getValue(); + return this; + } + + public FileServiceProperties refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFileServices() + .getServicePropertiesWithResponse(resourceGroupName, accountName, context) + .getValue(); + return this; + } + + public FileServicePropertiesImpl withCors(CorsRules cors) { + this.innerModel().withCors(cors); + return this; + } + + public FileServicePropertiesImpl withShareDeleteRetentionPolicy(DeleteRetentionPolicy shareDeleteRetentionPolicy) { + this.innerModel().withShareDeleteRetentionPolicy(shareDeleteRetentionPolicy); + return this; + } + + public FileServicePropertiesImpl withProtocolSettings(ProtocolSettings protocolSettings) { + this.innerModel().withProtocolSettings(protocolSettings); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServiceUsageImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServiceUsageImpl.java new file mode 100644 index 0000000000000..232e92e6cf520 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServiceUsageImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.FileServiceUsageInner; +import com.azure.resourcemanager.storage.generated.models.FileServiceUsage; +import com.azure.resourcemanager.storage.generated.models.FileServiceUsageProperties; + +public final class FileServiceUsageImpl implements FileServiceUsage { + private FileServiceUsageInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + FileServiceUsageImpl(FileServiceUsageInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public FileServiceUsageProperties properties() { + return this.innerModel().properties(); + } + + public FileServiceUsageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServicesClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServicesClientImpl.java new file mode 100644 index 0000000000000..9d2f835bdfcc7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServicesClientImpl.java @@ -0,0 +1,937 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.BodyParam; +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.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.FileServicesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.FileServiceItemsInner; +import com.azure.resourcemanager.storage.generated.fluent.models.FileServicePropertiesInner; +import com.azure.resourcemanager.storage.generated.fluent.models.FileServiceUsageInner; +import com.azure.resourcemanager.storage.generated.models.FileServiceUsages; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FileServicesClient. + */ +public final class FileServicesClientImpl implements FileServicesClient { + /** + * The proxy service used to perform REST calls. + */ + private final FileServicesService service; + + /** + * The service client containing this operation class. + */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of FileServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FileServicesClientImpl(StorageManagementClientImpl client) { + this.service + = RestProxy.create(FileServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientFileServices to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + public interface FileServicesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> setServiceProperties(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("FileServicesName") String fileServicesName, + @BodyParam("application/json") FileServicePropertiesInner parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getServiceProperties(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("FileServicesName") String fileServicesName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}/usages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listServiceUsages(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("FileServicesName") String fileServicesName, @QueryParam("$maxpagesize") Integer maxpagesize, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}/usages/{fileServiceUsagesName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getServiceUsage(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("FileServicesName") String fileServicesName, + @PathParam("fileServiceUsagesName") String fileServiceUsagesName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listServiceUsagesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List all file services in storage accounts. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all file services in storage accounts. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, String accountName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + } + + /** + * List all file services in storage accounts. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String accountName) { + return listWithResponseAsync(resourceGroupName, accountName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List all file services in storage accounts. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, String accountName, + Context context) { + return listWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * List all file services in storage accounts. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileServiceItemsInner list(String resourceGroupName, String accountName) { + return listWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } + + /** + * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of file services in storage accounts, including CORS (Cross-Origin Resource + * Sharing) rules. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of File services in storage account along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> setServicePropertiesWithResponseAsync(String resourceGroupName, + String accountName, FileServicePropertiesInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String fileServicesName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.setServiceProperties(this.client.getEndpoint(), resourceGroupName, + accountName, this.client.getApiVersion(), this.client.getSubscriptionId(), fileServicesName, parameters, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of file services in storage accounts, including CORS (Cross-Origin Resource + * Sharing) rules. + * @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 properties of File services in storage account along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> setServicePropertiesWithResponseAsync(String resourceGroupName, + String accountName, FileServicePropertiesInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String fileServicesName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.setServiceProperties(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), fileServicesName, parameters, accept, + context); + } + + /** + * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of file services in storage accounts, including CORS (Cross-Origin Resource + * Sharing) rules. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of File services in storage account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setServicePropertiesAsync(String resourceGroupName, String accountName, + FileServicePropertiesInner parameters) { + return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of file services in storage accounts, including CORS (Cross-Origin Resource + * Sharing) rules. + * @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 properties of File services in storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response setServicePropertiesWithResponse(String resourceGroupName, + String accountName, FileServicePropertiesInner parameters, Context context) { + return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of file services in storage accounts, including CORS (Cross-Origin Resource + * Sharing) rules. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of File services in storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileServicePropertiesInner setServiceProperties(String resourceGroupName, String accountName, + FileServicePropertiesInner parameters) { + return setServicePropertiesWithResponse(resourceGroupName, accountName, parameters, Context.NONE).getValue(); + } + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getServicePropertiesWithResponseAsync(String resourceGroupName, + String accountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String fileServicesName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getServiceProperties(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), fileServicesName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getServicePropertiesWithResponseAsync(String resourceGroupName, + String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String fileServicesName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getServiceProperties(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), fileServicesName, accept, context); + } + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getServicePropertiesAsync(String resourceGroupName, String accountName) { + return getServicePropertiesWithResponseAsync(resourceGroupName, accountName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getServicePropertiesWithResponse(String resourceGroupName, + String accountName, Context context) { + return getServicePropertiesWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) + * rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName) { + return getServicePropertiesWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } + + /** + * Gets the usages of file service in storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of file service usages to be included in the list + * response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 usages of file service in storage account along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listServiceUsagesSinglePageAsync(String resourceGroupName, + String accountName, Integer maxpagesize) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String fileServicesName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listServiceUsages(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), fileServicesName, maxpagesize, 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())); + } + + /** + * Gets the usages of file service in storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of file service usages to be included in the list + * response. + * @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 usages of file service in storage account along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listServiceUsagesSinglePageAsync(String resourceGroupName, + String accountName, Integer maxpagesize, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String fileServicesName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listServiceUsages(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), fileServicesName, maxpagesize, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Gets the usages of file service in storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of file service usages to be included in the list + * response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 usages of file service in storage account as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listServiceUsagesAsync(String resourceGroupName, String accountName, + Integer maxpagesize) { + return new PagedFlux<>(() -> listServiceUsagesSinglePageAsync(resourceGroupName, accountName, maxpagesize), + nextLink -> listServiceUsagesNextSinglePageAsync(nextLink)); + } + + /** + * Gets the usages of file service in storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 usages of file service in storage account as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listServiceUsagesAsync(String resourceGroupName, String accountName) { + final Integer maxpagesize = null; + return new PagedFlux<>(() -> listServiceUsagesSinglePageAsync(resourceGroupName, accountName, maxpagesize), + nextLink -> listServiceUsagesNextSinglePageAsync(nextLink)); + } + + /** + * Gets the usages of file service in storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of file service usages to be included in the list + * response. + * @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 usages of file service in storage account as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listServiceUsagesAsync(String resourceGroupName, String accountName, + Integer maxpagesize, Context context) { + return new PagedFlux<>( + () -> listServiceUsagesSinglePageAsync(resourceGroupName, accountName, maxpagesize, context), + nextLink -> listServiceUsagesNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the usages of file service in storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 usages of file service in storage account as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listServiceUsages(String resourceGroupName, String accountName) { + final Integer maxpagesize = null; + return new PagedIterable<>(listServiceUsagesAsync(resourceGroupName, accountName, maxpagesize)); + } + + /** + * Gets the usages of file service in storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of file service usages to be included in the list + * response. + * @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 usages of file service in storage account as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listServiceUsages(String resourceGroupName, String accountName, + Integer maxpagesize, Context context) { + return new PagedIterable<>(listServiceUsagesAsync(resourceGroupName, accountName, maxpagesize, context)); + } + + /** + * Gets the usage of file service in storage account including account limits, file share limits and constants used + * in recommendations and bursting formula. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 usage of file service in storage account including account limits, file share limits and constants + * used in recommendations and bursting formula along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getServiceUsageWithResponseAsync(String resourceGroupName, + String accountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String fileServicesName = "default"; + final String fileServiceUsagesName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getServiceUsage(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), fileServicesName, fileServiceUsagesName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the usage of file service in storage account including account limits, file share limits and constants used + * in recommendations and bursting formula. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 usage of file service in storage account including account limits, file share limits and constants + * used in recommendations and bursting formula along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getServiceUsageWithResponseAsync(String resourceGroupName, + String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String fileServicesName = "default"; + final String fileServiceUsagesName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getServiceUsage(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), fileServicesName, fileServiceUsagesName, + accept, context); + } + + /** + * Gets the usage of file service in storage account including account limits, file share limits and constants used + * in recommendations and bursting formula. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 usage of file service in storage account including account limits, file share limits and constants + * used in recommendations and bursting formula on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getServiceUsageAsync(String resourceGroupName, String accountName) { + return getServiceUsageWithResponseAsync(resourceGroupName, accountName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the usage of file service in storage account including account limits, file share limits and constants used + * in recommendations and bursting formula. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 usage of file service in storage account including account limits, file share limits and constants + * used in recommendations and bursting formula along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getServiceUsageWithResponse(String resourceGroupName, String accountName, + Context context) { + return getServiceUsageWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Gets the usage of file service in storage account including account limits, file share limits and constants used + * in recommendations and bursting formula. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 usage of file service in storage account including account limits, file share limits and constants + * used in recommendations and bursting formula. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileServiceUsageInner getServiceUsage(String resourceGroupName, String accountName) { + return getServiceUsageWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } + + /** + * 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 list file service usages schema along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listServiceUsagesNextSinglePageAsync(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.listServiceUsagesNext(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 list file service usages schema along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listServiceUsagesNextSinglePageAsync(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.listServiceUsagesNext(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/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServicesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServicesImpl.java new file mode 100644 index 0000000000000..5343f811a0873 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServicesImpl.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.FileServicesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.FileServiceItemsInner; +import com.azure.resourcemanager.storage.generated.fluent.models.FileServicePropertiesInner; +import com.azure.resourcemanager.storage.generated.fluent.models.FileServiceUsageInner; +import com.azure.resourcemanager.storage.generated.models.FileServiceItems; +import com.azure.resourcemanager.storage.generated.models.FileServiceProperties; +import com.azure.resourcemanager.storage.generated.models.FileServiceUsage; +import com.azure.resourcemanager.storage.generated.models.FileServices; + +public final class FileServicesImpl implements FileServices { + private static final ClientLogger LOGGER = new ClientLogger(FileServicesImpl.class); + + private final FileServicesClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public FileServicesImpl(FileServicesClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listWithResponse(String resourceGroupName, String accountName, Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FileServiceItemsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FileServiceItems list(String resourceGroupName, String accountName) { + FileServiceItemsInner inner = this.serviceClient().list(resourceGroupName, accountName); + if (inner != null) { + return new FileServiceItemsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getServicePropertiesWithResponse(String resourceGroupName, + String accountName, Context context) { + Response inner + = this.serviceClient().getServicePropertiesWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FileServicePropertiesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FileServiceProperties getServiceProperties(String resourceGroupName, String accountName) { + FileServicePropertiesInner inner = this.serviceClient().getServiceProperties(resourceGroupName, accountName); + if (inner != null) { + return new FileServicePropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listServiceUsages(String resourceGroupName, String accountName) { + PagedIterable inner + = this.serviceClient().listServiceUsages(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FileServiceUsageImpl(inner1, this.manager())); + } + + public PagedIterable listServiceUsages(String resourceGroupName, String accountName, + Integer maxpagesize, Context context) { + PagedIterable inner + = this.serviceClient().listServiceUsages(resourceGroupName, accountName, maxpagesize, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FileServiceUsageImpl(inner1, this.manager())); + } + + public Response getServiceUsageWithResponse(String resourceGroupName, String accountName, + Context context) { + Response inner + = this.serviceClient().getServiceUsageWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FileServiceUsageImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FileServiceUsage getServiceUsage(String resourceGroupName, String accountName) { + FileServiceUsageInner inner = this.serviceClient().getServiceUsage(resourceGroupName, accountName); + if (inner != null) { + return new FileServiceUsageImpl(inner, this.manager()); + } else { + return null; + } + } + + public FileServiceProperties getServicePropertiesById(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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + return this.getServicePropertiesWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } + + public Response getServicePropertiesByIdWithResponse(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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + return this.getServicePropertiesWithResponse(resourceGroupName, accountName, context); + } + + private FileServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public FileServicePropertiesImpl define() { + return new FileServicePropertiesImpl(this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileShareImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileShareImpl.java new file mode 100644 index 0000000000000..63134b06ee43a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileShareImpl.java @@ -0,0 +1,329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.FileShareInner; +import com.azure.resourcemanager.storage.generated.models.DeletedShare; +import com.azure.resourcemanager.storage.generated.models.EnabledProtocols; +import com.azure.resourcemanager.storage.generated.models.FileShare; +import com.azure.resourcemanager.storage.generated.models.FileSharePropertiesFileSharePaidBursting; +import com.azure.resourcemanager.storage.generated.models.LeaseDuration; +import com.azure.resourcemanager.storage.generated.models.LeaseShareRequest; +import com.azure.resourcemanager.storage.generated.models.LeaseShareResponse; +import com.azure.resourcemanager.storage.generated.models.LeaseState; +import com.azure.resourcemanager.storage.generated.models.LeaseStatus; +import com.azure.resourcemanager.storage.generated.models.RootSquashType; +import com.azure.resourcemanager.storage.generated.models.ShareAccessTier; +import com.azure.resourcemanager.storage.generated.models.SignedIdentifier; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class FileShareImpl implements FileShare, FileShare.Definition, FileShare.Update { + private FileShareInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public OffsetDateTime lastModifiedTime() { + return this.innerModel().lastModifiedTime(); + } + + public Map metadata() { + Map inner = this.innerModel().metadata(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Integer shareQuota() { + return this.innerModel().shareQuota(); + } + + public Integer provisionedIops() { + return this.innerModel().provisionedIops(); + } + + public Integer provisionedBandwidthMibps() { + return this.innerModel().provisionedBandwidthMibps(); + } + + public Integer includedBurstIops() { + return this.innerModel().includedBurstIops(); + } + + public Long maxBurstCreditsForIops() { + return this.innerModel().maxBurstCreditsForIops(); + } + + public OffsetDateTime nextAllowedQuotaDowngradeTime() { + return this.innerModel().nextAllowedQuotaDowngradeTime(); + } + + public OffsetDateTime nextAllowedProvisionedIopsDowngradeTime() { + return this.innerModel().nextAllowedProvisionedIopsDowngradeTime(); + } + + public OffsetDateTime nextAllowedProvisionedBandwidthDowngradeTime() { + return this.innerModel().nextAllowedProvisionedBandwidthDowngradeTime(); + } + + public EnabledProtocols enabledProtocols() { + return this.innerModel().enabledProtocols(); + } + + public RootSquashType rootSquash() { + return this.innerModel().rootSquash(); + } + + public String version() { + return this.innerModel().version(); + } + + public Boolean deleted() { + return this.innerModel().deleted(); + } + + public OffsetDateTime deletedTime() { + return this.innerModel().deletedTime(); + } + + public Integer remainingRetentionDays() { + return this.innerModel().remainingRetentionDays(); + } + + public ShareAccessTier accessTier() { + return this.innerModel().accessTier(); + } + + public OffsetDateTime accessTierChangeTime() { + return this.innerModel().accessTierChangeTime(); + } + + public String accessTierStatus() { + return this.innerModel().accessTierStatus(); + } + + public Long shareUsageBytes() { + return this.innerModel().shareUsageBytes(); + } + + public LeaseStatus leaseStatus() { + return this.innerModel().leaseStatus(); + } + + public LeaseState leaseState() { + return this.innerModel().leaseState(); + } + + public LeaseDuration leaseDuration() { + return this.innerModel().leaseDuration(); + } + + public List signedIdentifiers() { + List inner = this.innerModel().signedIdentifiers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OffsetDateTime snapshotTime() { + return this.innerModel().snapshotTime(); + } + + public FileSharePropertiesFileSharePaidBursting fileSharePaidBursting() { + return this.innerModel().fileSharePaidBursting(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public FileShareInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String shareName; + + private String createExpand; + + public FileShareImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public FileShare create() { + this.innerObject = serviceManager.serviceClient() + .getFileShares() + .createWithResponse(resourceGroupName, accountName, shareName, this.innerModel(), createExpand, + Context.NONE) + .getValue(); + return this; + } + + public FileShare create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFileShares() + .createWithResponse(resourceGroupName, accountName, shareName, this.innerModel(), createExpand, context) + .getValue(); + return this; + } + + FileShareImpl(String name, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new FileShareInner(); + this.serviceManager = serviceManager; + this.shareName = name; + this.createExpand = null; + } + + public FileShareImpl update() { + return this; + } + + public FileShare apply() { + this.innerObject = serviceManager.serviceClient() + .getFileShares() + .updateWithResponse(resourceGroupName, accountName, shareName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public FileShare apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFileShares() + .updateWithResponse(resourceGroupName, accountName, shareName, this.innerModel(), context) + .getValue(); + return this; + } + + FileShareImpl(FileShareInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.shareName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "shares"); + } + + public FileShare refresh() { + String localExpand = null; + String localXMsSnapshot = null; + this.innerObject = serviceManager.serviceClient() + .getFileShares() + .getWithResponse(resourceGroupName, accountName, shareName, localExpand, localXMsSnapshot, Context.NONE) + .getValue(); + return this; + } + + public FileShare refresh(Context context) { + String localExpand = null; + String localXMsSnapshot = null; + this.innerObject = serviceManager.serviceClient() + .getFileShares() + .getWithResponse(resourceGroupName, accountName, shareName, localExpand, localXMsSnapshot, context) + .getValue(); + return this; + } + + public Response restoreWithResponse(DeletedShare deletedShare, Context context) { + return serviceManager.fileShares() + .restoreWithResponse(resourceGroupName, accountName, shareName, deletedShare, context); + } + + public void restore(DeletedShare deletedShare) { + serviceManager.fileShares().restore(resourceGroupName, accountName, shareName, deletedShare); + } + + public Response leaseWithResponse(String xMsSnapshot, LeaseShareRequest parameters, + Context context) { + return serviceManager.fileShares() + .leaseWithResponse(resourceGroupName, accountName, shareName, xMsSnapshot, parameters, context); + } + + public LeaseShareResponse lease() { + return serviceManager.fileShares().lease(resourceGroupName, accountName, shareName); + } + + public FileShareImpl withMetadata(Map metadata) { + this.innerModel().withMetadata(metadata); + return this; + } + + public FileShareImpl withShareQuota(Integer shareQuota) { + this.innerModel().withShareQuota(shareQuota); + return this; + } + + public FileShareImpl withProvisionedIops(Integer provisionedIops) { + this.innerModel().withProvisionedIops(provisionedIops); + return this; + } + + public FileShareImpl withProvisionedBandwidthMibps(Integer provisionedBandwidthMibps) { + this.innerModel().withProvisionedBandwidthMibps(provisionedBandwidthMibps); + return this; + } + + public FileShareImpl withEnabledProtocols(EnabledProtocols enabledProtocols) { + this.innerModel().withEnabledProtocols(enabledProtocols); + return this; + } + + public FileShareImpl withRootSquash(RootSquashType rootSquash) { + this.innerModel().withRootSquash(rootSquash); + return this; + } + + public FileShareImpl withAccessTier(ShareAccessTier accessTier) { + this.innerModel().withAccessTier(accessTier); + return this; + } + + public FileShareImpl withSignedIdentifiers(List signedIdentifiers) { + this.innerModel().withSignedIdentifiers(signedIdentifiers); + return this; + } + + public FileShareImpl withFileSharePaidBursting(FileSharePropertiesFileSharePaidBursting fileSharePaidBursting) { + this.innerModel().withFileSharePaidBursting(fileSharePaidBursting); + return this; + } + + public FileShareImpl withExpand(String expand) { + this.createExpand = expand; + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileShareItemImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileShareItemImpl.java new file mode 100644 index 0000000000000..50e6e291af07c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileShareItemImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.FileShareItemInner; +import com.azure.resourcemanager.storage.generated.models.EnabledProtocols; +import com.azure.resourcemanager.storage.generated.models.FileShareItem; +import com.azure.resourcemanager.storage.generated.models.FileSharePropertiesFileSharePaidBursting; +import com.azure.resourcemanager.storage.generated.models.LeaseDuration; +import com.azure.resourcemanager.storage.generated.models.LeaseState; +import com.azure.resourcemanager.storage.generated.models.LeaseStatus; +import com.azure.resourcemanager.storage.generated.models.RootSquashType; +import com.azure.resourcemanager.storage.generated.models.ShareAccessTier; +import com.azure.resourcemanager.storage.generated.models.SignedIdentifier; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class FileShareItemImpl implements FileShareItem { + private FileShareItemInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + FileShareItemImpl(FileShareItemInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public OffsetDateTime lastModifiedTime() { + return this.innerModel().lastModifiedTime(); + } + + public Map metadata() { + Map inner = this.innerModel().metadata(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Integer shareQuota() { + return this.innerModel().shareQuota(); + } + + public Integer provisionedIops() { + return this.innerModel().provisionedIops(); + } + + public Integer provisionedBandwidthMibps() { + return this.innerModel().provisionedBandwidthMibps(); + } + + public Integer includedBurstIops() { + return this.innerModel().includedBurstIops(); + } + + public Long maxBurstCreditsForIops() { + return this.innerModel().maxBurstCreditsForIops(); + } + + public OffsetDateTime nextAllowedQuotaDowngradeTime() { + return this.innerModel().nextAllowedQuotaDowngradeTime(); + } + + public OffsetDateTime nextAllowedProvisionedIopsDowngradeTime() { + return this.innerModel().nextAllowedProvisionedIopsDowngradeTime(); + } + + public OffsetDateTime nextAllowedProvisionedBandwidthDowngradeTime() { + return this.innerModel().nextAllowedProvisionedBandwidthDowngradeTime(); + } + + public EnabledProtocols enabledProtocols() { + return this.innerModel().enabledProtocols(); + } + + public RootSquashType rootSquash() { + return this.innerModel().rootSquash(); + } + + public String version() { + return this.innerModel().version(); + } + + public Boolean deleted() { + return this.innerModel().deleted(); + } + + public OffsetDateTime deletedTime() { + return this.innerModel().deletedTime(); + } + + public Integer remainingRetentionDays() { + return this.innerModel().remainingRetentionDays(); + } + + public ShareAccessTier accessTier() { + return this.innerModel().accessTier(); + } + + public OffsetDateTime accessTierChangeTime() { + return this.innerModel().accessTierChangeTime(); + } + + public String accessTierStatus() { + return this.innerModel().accessTierStatus(); + } + + public Long shareUsageBytes() { + return this.innerModel().shareUsageBytes(); + } + + public LeaseStatus leaseStatus() { + return this.innerModel().leaseStatus(); + } + + public LeaseState leaseState() { + return this.innerModel().leaseState(); + } + + public LeaseDuration leaseDuration() { + return this.innerModel().leaseDuration(); + } + + public List signedIdentifiers() { + List inner = this.innerModel().signedIdentifiers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OffsetDateTime snapshotTime() { + return this.innerModel().snapshotTime(); + } + + public FileSharePropertiesFileSharePaidBursting fileSharePaidBursting() { + return this.innerModel().fileSharePaidBursting(); + } + + public FileShareItemInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileSharesClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileSharesClientImpl.java new file mode 100644 index 0000000000000..163882ff64bca --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileSharesClientImpl.java @@ -0,0 +1,1432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.FileSharesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.FileShareInner; +import com.azure.resourcemanager.storage.generated.fluent.models.FileShareItemInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LeaseShareResponseInner; +import com.azure.resourcemanager.storage.generated.models.DeletedShare; +import com.azure.resourcemanager.storage.generated.models.FileShareItems; +import com.azure.resourcemanager.storage.generated.models.FileSharesLeaseResponse; +import com.azure.resourcemanager.storage.generated.models.LeaseShareRequest; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FileSharesClient. + */ +public final class FileSharesClientImpl implements FileSharesClient { + /** + * The proxy service used to perform REST calls. + */ + private final FileSharesService service; + + /** + * The service client containing this operation class. + */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of FileSharesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FileSharesClientImpl(StorageManagementClientImpl client) { + this.service + = RestProxy.create(FileSharesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientFileShares to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + public interface FileSharesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$maxpagesize") String maxpagesize, @QueryParam("$filter") String filter, + @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("shareName") String shareName, @QueryParam("$expand") String expand, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") FileShareInner fileShare, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("shareName") String shareName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") FileShareInner fileShare, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("shareName") String shareName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("$expand") String expand, + @HeaderParam("x-ms-snapshot") String xMsSnapshot, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("shareName") String shareName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("x-ms-snapshot") String xMsSnapshot, + @QueryParam("$include") String include, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> restore(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("shareName") String shareName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DeletedShare deletedShare, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/lease") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono lease(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("shareName") String shareName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("x-ms-snapshot") String xMsSnapshot, + @BodyParam("application/json") LeaseShareRequest parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. + * @param filter Optional. When specified, only share names starting with the filter will be listed. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: deleted, + * snapshots. Should be passed as a string with delimiter ','. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName, + String maxpagesize, String filter, String expand) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), maxpagesize, filter, expand, 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())); + } + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. + * @param filter Optional. When specified, only share names starting with the filter will be listed. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: deleted, + * snapshots. Should be passed as a string with delimiter ','. + * @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 response schema along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName, + String maxpagesize, String filter, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), maxpagesize, filter, expand, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. + * @param filter Optional. When specified, only share names starting with the filter will be listed. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: deleted, + * snapshots. Should be passed as a string with delimiter ','. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, String maxpagesize, + String filter, String expand) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, expand), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + final String maxpagesize = null; + final String filter = null; + final String expand = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, expand), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. + * @param filter Optional. When specified, only share names starting with the filter will be listed. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: deleted, + * snapshots. Should be passed as a string with delimiter ','. + * @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 response schema as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, String maxpagesize, + String filter, String expand, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, expand, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response schema as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + final String maxpagesize = null; + final String filter = null; + final String expand = null; + return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter, expand)); + } + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. + * @param filter Optional. When specified, only share names starting with the filter will be listed. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: deleted, + * snapshots. Should be passed as a string with delimiter ','. + * @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 response schema as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, String maxpagesize, + String filter, String expand, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter, expand, context)); + } + + /** + * Creates a new share under the specified account as described by request body. The share resource includes + * metadata and properties for that share. It does not include a list of the files contained by the share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties of the file share to create. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: snapshots. + * Should be passed as a string with delimiter ','. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the file share, including Id, resource name, resource type, Etag along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, String accountName, + String shareName, FileShareInner fileShare, String expand) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (shareName == null) { + return Mono.error(new IllegalArgumentException("Parameter shareName 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 (fileShare == null) { + return Mono.error(new IllegalArgumentException("Parameter fileShare is required and cannot be null.")); + } else { + fileShare.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), resourceGroupName, accountName, shareName, + expand, this.client.getApiVersion(), this.client.getSubscriptionId(), fileShare, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new share under the specified account as described by request body. The share resource includes + * metadata and properties for that share. It does not include a list of the files contained by the share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties of the file share to create. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: snapshots. + * Should be passed as a string with delimiter ','. + * @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 properties of the file share, including Id, resource name, resource type, Etag along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, String accountName, + String shareName, FileShareInner fileShare, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (shareName == null) { + return Mono.error(new IllegalArgumentException("Parameter shareName 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 (fileShare == null) { + return Mono.error(new IllegalArgumentException("Parameter fileShare is required and cannot be null.")); + } else { + fileShare.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), resourceGroupName, accountName, shareName, expand, + this.client.getApiVersion(), this.client.getSubscriptionId(), fileShare, accept, context); + } + + /** + * Creates a new share under the specified account as described by request body. The share resource includes + * metadata and properties for that share. It does not include a list of the files contained by the share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties of the file share to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the file share, including Id, resource name, resource type, Etag on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String accountName, String shareName, + FileShareInner fileShare) { + final String expand = null; + return createWithResponseAsync(resourceGroupName, accountName, shareName, fileShare, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a new share under the specified account as described by request body. The share resource includes + * metadata and properties for that share. It does not include a list of the files contained by the share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties of the file share to create. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: snapshots. + * Should be passed as a string with delimiter ','. + * @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 properties of the file share, including Id, resource name, resource type, Etag along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse(String resourceGroupName, String accountName, String shareName, + FileShareInner fileShare, String expand, Context context) { + return createWithResponseAsync(resourceGroupName, accountName, shareName, fileShare, expand, context).block(); + } + + /** + * Creates a new share under the specified account as described by request body. The share resource includes + * metadata and properties for that share. It does not include a list of the files contained by the share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties of the file share to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the file share, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileShareInner create(String resourceGroupName, String accountName, String shareName, + FileShareInner fileShare) { + final String expand = null; + return createWithResponse(resourceGroupName, accountName, shareName, fileShare, expand, Context.NONE) + .getValue(); + } + + /** + * Updates share properties as specified in request body. Properties not mentioned in the request will not be + * changed. Update fails if the specified share does not already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties to update for the file share. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the file share, including Id, resource name, resource type, Etag along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String accountName, + String shareName, FileShareInner fileShare) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (shareName == null) { + return Mono.error(new IllegalArgumentException("Parameter shareName 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 (fileShare == null) { + return Mono.error(new IllegalArgumentException("Parameter fileShare is required and cannot be null.")); + } else { + fileShare.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, accountName, shareName, + this.client.getApiVersion(), this.client.getSubscriptionId(), fileShare, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates share properties as specified in request body. Properties not mentioned in the request will not be + * changed. Update fails if the specified share does not already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties to update for the file share. + * @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 properties of the file share, including Id, resource name, resource type, Etag along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String accountName, + String shareName, FileShareInner fileShare, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (shareName == null) { + return Mono.error(new IllegalArgumentException("Parameter shareName 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 (fileShare == null) { + return Mono.error(new IllegalArgumentException("Parameter fileShare is required and cannot be null.")); + } else { + fileShare.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), resourceGroupName, accountName, shareName, + this.client.getApiVersion(), this.client.getSubscriptionId(), fileShare, accept, context); + } + + /** + * Updates share properties as specified in request body. Properties not mentioned in the request will not be + * changed. Update fails if the specified share does not already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties to update for the file share. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the file share, including Id, resource name, resource type, Etag on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String accountName, String shareName, + FileShareInner fileShare) { + return updateWithResponseAsync(resourceGroupName, accountName, shareName, fileShare) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates share properties as specified in request body. Properties not mentioned in the request will not be + * changed. Update fails if the specified share does not already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties to update for the file share. + * @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 properties of the file share, including Id, resource name, resource type, Etag along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String accountName, String shareName, + FileShareInner fileShare, Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, shareName, fileShare, context).block(); + } + + /** + * Updates share properties as specified in request body. Properties not mentioned in the request will not be + * changed. Update fails if the specified share does not already exist. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param fileShare Properties to update for the file share. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the file share, including Id, resource name, resource type, Etag. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileShareInner update(String resourceGroupName, String accountName, String shareName, + FileShareInner fileShare) { + return updateWithResponse(resourceGroupName, accountName, shareName, fileShare, Context.NONE).getValue(); + } + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: stats. Should + * be passed as a string with delimiter ','. + * @param xMsSnapshot Optional, used to retrieve properties of a snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified share along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String shareName, String expand, String xMsSnapshot) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (shareName == null) { + return Mono.error(new IllegalArgumentException("Parameter shareName 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.get(this.client.getEndpoint(), resourceGroupName, accountName, shareName, + this.client.getApiVersion(), this.client.getSubscriptionId(), expand, xMsSnapshot, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: stats. Should + * be passed as a string with delimiter ','. + * @param xMsSnapshot Optional, used to retrieve properties of a snapshot. + * @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 properties of a specified share along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String shareName, String expand, String xMsSnapshot, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (shareName == null) { + return Mono.error(new IllegalArgumentException("Parameter shareName 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.get(this.client.getEndpoint(), resourceGroupName, accountName, shareName, + this.client.getApiVersion(), this.client.getSubscriptionId(), expand, xMsSnapshot, accept, context); + } + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified share on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String shareName) { + final String expand = null; + final String xMsSnapshot = null; + return getWithResponseAsync(resourceGroupName, accountName, shareName, expand, xMsSnapshot) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: stats. Should + * be passed as a string with delimiter ','. + * @param xMsSnapshot Optional, used to retrieve properties of a snapshot. + * @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 properties of a specified share along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, String shareName, + String expand, String xMsSnapshot, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, shareName, expand, xMsSnapshot, context).block(); + } + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a specified share. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileShareInner get(String resourceGroupName, String accountName, String shareName) { + final String expand = null; + final String xMsSnapshot = null; + return getWithResponse(resourceGroupName, accountName, shareName, expand, xMsSnapshot, Context.NONE).getValue(); + } + + /** + * Deletes specified share under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param xMsSnapshot Optional, used to delete a snapshot. + * @param include Optional. Valid values are: snapshots, leased-snapshots, none. The default value is snapshots. For + * 'snapshots', the file share is deleted including all of its file share snapshots. If the file share contains + * leased-snapshots, the deletion fails. For 'leased-snapshots', the file share is deleted included all of its file + * share snapshots (leased/unleased). For 'none', the file share is deleted if it has no share snapshots. If the + * file share contains any snapshots (leased or unleased), the deletion fails. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 accountName, String shareName, + String xMsSnapshot, String include) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (shareName == null) { + return Mono.error(new IllegalArgumentException("Parameter shareName 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.delete(this.client.getEndpoint(), resourceGroupName, accountName, shareName, + this.client.getApiVersion(), this.client.getSubscriptionId(), xMsSnapshot, include, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes specified share under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param xMsSnapshot Optional, used to delete a snapshot. + * @param include Optional. Valid values are: snapshots, leased-snapshots, none. The default value is snapshots. For + * 'snapshots', the file share is deleted including all of its file share snapshots. If the file share contains + * leased-snapshots, the deletion fails. For 'leased-snapshots', the file share is deleted included all of its file + * share snapshots (leased/unleased). For 'none', the file share is deleted if it has no share snapshots. If the + * file share contains any snapshots (leased or unleased), the deletion fails. + * @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 accountName, String shareName, + String xMsSnapshot, String include, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (shareName == null) { + return Mono.error(new IllegalArgumentException("Parameter shareName 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.delete(this.client.getEndpoint(), resourceGroupName, accountName, shareName, + this.client.getApiVersion(), this.client.getSubscriptionId(), xMsSnapshot, include, accept, context); + } + + /** + * Deletes specified share under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 accountName, String shareName) { + final String xMsSnapshot = null; + final String include = null; + return deleteWithResponseAsync(resourceGroupName, accountName, shareName, xMsSnapshot, include) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes specified share under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param xMsSnapshot Optional, used to delete a snapshot. + * @param include Optional. Valid values are: snapshots, leased-snapshots, none. The default value is snapshots. For + * 'snapshots', the file share is deleted including all of its file share snapshots. If the file share contains + * leased-snapshots, the deletion fails. For 'leased-snapshots', the file share is deleted included all of its file + * share snapshots (leased/unleased). For 'none', the file share is deleted if it has no share snapshots. If the + * file share contains any snapshots (leased or unleased), the deletion fails. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String accountName, String shareName, + String xMsSnapshot, String include, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, shareName, xMsSnapshot, include, context) + .block(); + } + + /** + * Deletes specified share under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String shareName) { + final String xMsSnapshot = null; + final String include = null; + deleteWithResponse(resourceGroupName, accountName, shareName, xMsSnapshot, include, Context.NONE); + } + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param deletedShare The deletedShare parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> restoreWithResponseAsync(String resourceGroupName, String accountName, + String shareName, DeletedShare deletedShare) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (shareName == null) { + return Mono.error(new IllegalArgumentException("Parameter shareName 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 (deletedShare == null) { + return Mono.error(new IllegalArgumentException("Parameter deletedShare is required and cannot be null.")); + } else { + deletedShare.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.restore(this.client.getEndpoint(), resourceGroupName, accountName, + shareName, this.client.getApiVersion(), this.client.getSubscriptionId(), deletedShare, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param deletedShare The deletedShare parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> restoreWithResponseAsync(String resourceGroupName, String accountName, + String shareName, DeletedShare deletedShare, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (shareName == null) { + return Mono.error(new IllegalArgumentException("Parameter shareName 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 (deletedShare == null) { + return Mono.error(new IllegalArgumentException("Parameter deletedShare is required and cannot be null.")); + } else { + deletedShare.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.restore(this.client.getEndpoint(), resourceGroupName, accountName, shareName, + this.client.getApiVersion(), this.client.getSubscriptionId(), deletedShare, accept, context); + } + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param deletedShare The deletedShare parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restoreAsync(String resourceGroupName, String accountName, String shareName, + DeletedShare deletedShare) { + return restoreWithResponseAsync(resourceGroupName, accountName, shareName, deletedShare) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param deletedShare The deletedShare parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response restoreWithResponse(String resourceGroupName, String accountName, String shareName, + DeletedShare deletedShare, Context context) { + return restoreWithResponseAsync(resourceGroupName, accountName, shareName, deletedShare, context).block(); + } + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param deletedShare The deletedShare parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restore(String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare) { + restoreWithResponse(resourceGroupName, accountName, shareName, deletedShare, Context.NONE); + } + + /** + * The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param xMsSnapshot Optional. Specify the snapshot time to lease a snapshot. + * @param parameters Lease Share request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Share response schema on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono leaseWithResponseAsync(String resourceGroupName, String accountName, + String shareName, String xMsSnapshot, LeaseShareRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (shareName == null) { + return Mono.error(new IllegalArgumentException("Parameter shareName 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 (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.lease(this.client.getEndpoint(), resourceGroupName, accountName, shareName, + this.client.getApiVersion(), this.client.getSubscriptionId(), xMsSnapshot, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param xMsSnapshot Optional. Specify the snapshot time to lease a snapshot. + * @param parameters Lease Share request body. + * @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 lease Share response schema on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono leaseWithResponseAsync(String resourceGroupName, String accountName, + String shareName, String xMsSnapshot, LeaseShareRequest parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (shareName == null) { + return Mono.error(new IllegalArgumentException("Parameter shareName 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 (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.lease(this.client.getEndpoint(), resourceGroupName, accountName, shareName, + this.client.getApiVersion(), this.client.getSubscriptionId(), xMsSnapshot, parameters, accept, context); + } + + /** + * The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Share response schema on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono leaseAsync(String resourceGroupName, String accountName, String shareName) { + final String xMsSnapshot = null; + final LeaseShareRequest parameters = null; + return leaseWithResponseAsync(resourceGroupName, accountName, shareName, xMsSnapshot, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param xMsSnapshot Optional. Specify the snapshot time to lease a snapshot. + * @param parameters Lease Share request body. + * @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 lease Share response schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileSharesLeaseResponse leaseWithResponse(String resourceGroupName, String accountName, String shareName, + String xMsSnapshot, LeaseShareRequest parameters, Context context) { + return leaseWithResponseAsync(resourceGroupName, accountName, shareName, xMsSnapshot, parameters, context) + .block(); + } + + /** + * The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return lease Share response schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LeaseShareResponseInner lease(String resourceGroupName, String accountName, String shareName) { + final String xMsSnapshot = null; + final LeaseShareRequest parameters = null; + return leaseWithResponse(resourceGroupName, accountName, shareName, xMsSnapshot, parameters, Context.NONE) + .getValue(); + } + + /** + * 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 response schema 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 response schema 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/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileSharesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileSharesImpl.java new file mode 100644 index 0000000000000..69c9d42f0e23b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileSharesImpl.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.FileSharesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.FileShareInner; +import com.azure.resourcemanager.storage.generated.fluent.models.FileShareItemInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LeaseShareResponseInner; +import com.azure.resourcemanager.storage.generated.models.DeletedShare; +import com.azure.resourcemanager.storage.generated.models.FileShare; +import com.azure.resourcemanager.storage.generated.models.FileShareItem; +import com.azure.resourcemanager.storage.generated.models.FileShares; +import com.azure.resourcemanager.storage.generated.models.FileSharesLeaseResponse; +import com.azure.resourcemanager.storage.generated.models.LeaseShareRequest; +import com.azure.resourcemanager.storage.generated.models.LeaseShareResponse; + +public final class FileSharesImpl implements FileShares { + private static final ClientLogger LOGGER = new ClientLogger(FileSharesImpl.class); + + private final FileSharesClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public FileSharesImpl(FileSharesClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FileShareItemImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, String maxpagesize, + String filter, String expand, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName, maxpagesize, filter, expand, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FileShareItemImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String accountName, String shareName, + String expand, String xMsSnapshot, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, accountName, shareName, expand, xMsSnapshot, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FileShareImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FileShare get(String resourceGroupName, String accountName, String shareName) { + FileShareInner inner = this.serviceClient().get(resourceGroupName, accountName, shareName); + if (inner != null) { + return new FileShareImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String accountName, String shareName, + String xMsSnapshot, String include, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, accountName, shareName, xMsSnapshot, include, context); + } + + public void delete(String resourceGroupName, String accountName, String shareName) { + this.serviceClient().delete(resourceGroupName, accountName, shareName); + } + + public Response restoreWithResponse(String resourceGroupName, String accountName, String shareName, + DeletedShare deletedShare, Context context) { + return this.serviceClient() + .restoreWithResponse(resourceGroupName, accountName, shareName, deletedShare, context); + } + + public void restore(String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare) { + this.serviceClient().restore(resourceGroupName, accountName, shareName, deletedShare); + } + + public Response leaseWithResponse(String resourceGroupName, String accountName, + String shareName, String xMsSnapshot, LeaseShareRequest parameters, Context context) { + FileSharesLeaseResponse inner = this.serviceClient() + .leaseWithResponse(resourceGroupName, accountName, shareName, xMsSnapshot, parameters, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LeaseShareResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LeaseShareResponse lease(String resourceGroupName, String accountName, String shareName) { + LeaseShareResponseInner inner = this.serviceClient().lease(resourceGroupName, accountName, shareName); + if (inner != null) { + return new LeaseShareResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public FileShare 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String shareName = ResourceManagerUtils.getValueFromIdByName(id, "shares"); + if (shareName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'shares'.", id))); + } + String localExpand = null; + String localXMsSnapshot = null; + return this + .getWithResponse(resourceGroupName, accountName, shareName, localExpand, localXMsSnapshot, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, String xMsSnapshot, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String shareName = ResourceManagerUtils.getValueFromIdByName(id, "shares"); + if (shareName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'shares'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, shareName, expand, xMsSnapshot, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String shareName = ResourceManagerUtils.getValueFromIdByName(id, "shares"); + if (shareName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'shares'.", id))); + } + String localXMsSnapshot = null; + String localInclude = null; + this.deleteWithResponse(resourceGroupName, accountName, shareName, localXMsSnapshot, localInclude, + Context.NONE); + } + + public Response deleteByIdWithResponse(String id, String xMsSnapshot, String include, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String shareName = ResourceManagerUtils.getValueFromIdByName(id, "shares"); + if (shareName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'shares'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, shareName, xMsSnapshot, include, context); + } + + private FileSharesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public FileShareImpl define(String name) { + return new FileShareImpl(name, this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ImmutabilityPolicyImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ImmutabilityPolicyImpl.java new file mode 100644 index 0000000000000..b1c70900cfcd0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ImmutabilityPolicyImpl.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner; +import com.azure.resourcemanager.storage.generated.models.ImmutabilityPolicy; +import com.azure.resourcemanager.storage.generated.models.ImmutabilityPolicyState; + +public final class ImmutabilityPolicyImpl + implements ImmutabilityPolicy, ImmutabilityPolicy.Definition, ImmutabilityPolicy.Update { + private ImmutabilityPolicyInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public Integer immutabilityPeriodSinceCreationInDays() { + return this.innerModel().immutabilityPeriodSinceCreationInDays(); + } + + public ImmutabilityPolicyState state() { + return this.innerModel().state(); + } + + public Boolean allowProtectedAppendWrites() { + return this.innerModel().allowProtectedAppendWrites(); + } + + public Boolean allowProtectedAppendWritesAll() { + return this.innerModel().allowProtectedAppendWritesAll(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ImmutabilityPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String containerName; + + private String createIfMatch; + + private String updateIfMatch; + + public ImmutabilityPolicyImpl withExistingContainer(String resourceGroupName, String accountName, + String containerName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.containerName = containerName; + return this; + } + + public ImmutabilityPolicy create() { + this.innerObject = serviceManager.serviceClient() + .getBlobContainers() + .createOrUpdateImmutabilityPolicyWithResponse(resourceGroupName, accountName, containerName, createIfMatch, + this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ImmutabilityPolicy create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBlobContainers() + .createOrUpdateImmutabilityPolicyWithResponse(resourceGroupName, accountName, containerName, createIfMatch, + this.innerModel(), context) + .getValue(); + return this; + } + + ImmutabilityPolicyImpl(com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new ImmutabilityPolicyInner(); + this.serviceManager = serviceManager; + this.createIfMatch = null; + } + + public ImmutabilityPolicyImpl update() { + this.updateIfMatch = null; + return this; + } + + public ImmutabilityPolicy apply() { + this.innerObject = serviceManager.serviceClient() + .getBlobContainers() + .createOrUpdateImmutabilityPolicyWithResponse(resourceGroupName, accountName, containerName, updateIfMatch, + this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ImmutabilityPolicy apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBlobContainers() + .createOrUpdateImmutabilityPolicyWithResponse(resourceGroupName, accountName, containerName, updateIfMatch, + this.innerModel(), context) + .getValue(); + return this; + } + + ImmutabilityPolicyImpl(ImmutabilityPolicyInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.containerName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "containers"); + } + + public ImmutabilityPolicy refresh() { + String localIfMatch = null; + this.innerObject = serviceManager.serviceClient() + .getBlobContainers() + .getImmutabilityPolicyWithResponse(resourceGroupName, accountName, containerName, localIfMatch, + Context.NONE) + .getValue(); + return this; + } + + public ImmutabilityPolicy refresh(Context context) { + String localIfMatch = null; + this.innerObject = serviceManager.serviceClient() + .getBlobContainers() + .getImmutabilityPolicyWithResponse(resourceGroupName, accountName, containerName, localIfMatch, context) + .getValue(); + return this; + } + + public ImmutabilityPolicyImpl + withImmutabilityPeriodSinceCreationInDays(Integer immutabilityPeriodSinceCreationInDays) { + this.innerModel().withImmutabilityPeriodSinceCreationInDays(immutabilityPeriodSinceCreationInDays); + return this; + } + + public ImmutabilityPolicyImpl withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites) { + this.innerModel().withAllowProtectedAppendWrites(allowProtectedAppendWrites); + return this; + } + + public ImmutabilityPolicyImpl withAllowProtectedAppendWritesAll(Boolean allowProtectedAppendWritesAll) { + this.innerModel().withAllowProtectedAppendWritesAll(allowProtectedAppendWritesAll); + return this; + } + + public ImmutabilityPolicyImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LeaseContainerResponseImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LeaseContainerResponseImpl.java new file mode 100644 index 0000000000000..7a8136d45c4a1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LeaseContainerResponseImpl.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.LeaseContainerResponseInner; +import com.azure.resourcemanager.storage.generated.models.LeaseContainerResponse; + +public final class LeaseContainerResponseImpl implements LeaseContainerResponse { + private LeaseContainerResponseInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + LeaseContainerResponseImpl(LeaseContainerResponseInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String leaseId() { + return this.innerModel().leaseId(); + } + + public String leaseTimeSeconds() { + return this.innerModel().leaseTimeSeconds(); + } + + public LeaseContainerResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LeaseShareResponseImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LeaseShareResponseImpl.java new file mode 100644 index 0000000000000..ffa066878830c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LeaseShareResponseImpl.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.LeaseShareResponseInner; +import com.azure.resourcemanager.storage.generated.models.LeaseShareResponse; + +public final class LeaseShareResponseImpl implements LeaseShareResponse { + private LeaseShareResponseInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + LeaseShareResponseImpl(LeaseShareResponseInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String leaseId() { + return this.innerModel().leaseId(); + } + + public String leaseTimeSeconds() { + return this.innerModel().leaseTimeSeconds(); + } + + public LeaseShareResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LegalHoldImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LegalHoldImpl.java new file mode 100644 index 0000000000000..bf7c40b732c25 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LegalHoldImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.LegalHoldInner; +import com.azure.resourcemanager.storage.generated.models.LegalHold; +import java.util.Collections; +import java.util.List; + +public final class LegalHoldImpl implements LegalHold { + private LegalHoldInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + LegalHoldImpl(LegalHoldInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean hasLegalHold() { + return this.innerModel().hasLegalHold(); + } + + public List tags() { + List inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean allowProtectedAppendWritesAll() { + return this.innerModel().allowProtectedAppendWritesAll(); + } + + public LegalHoldInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListAccountSasResponseImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListAccountSasResponseImpl.java new file mode 100644 index 0000000000000..cd9bb0f2f2211 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListAccountSasResponseImpl.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.ListAccountSasResponseInner; +import com.azure.resourcemanager.storage.generated.models.ListAccountSasResponse; + +public final class ListAccountSasResponseImpl implements ListAccountSasResponse { + private ListAccountSasResponseInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + ListAccountSasResponseImpl(ListAccountSasResponseInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String accountSasToken() { + return this.innerModel().accountSasToken(); + } + + public ListAccountSasResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListContainerItemImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListContainerItemImpl.java new file mode 100644 index 0000000000000..a09dd02b57df2 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListContainerItemImpl.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.ListContainerItemInner; +import com.azure.resourcemanager.storage.generated.models.ImmutabilityPolicyProperties; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageWithVersioning; +import com.azure.resourcemanager.storage.generated.models.LeaseDuration; +import com.azure.resourcemanager.storage.generated.models.LeaseState; +import com.azure.resourcemanager.storage.generated.models.LeaseStatus; +import com.azure.resourcemanager.storage.generated.models.LegalHoldProperties; +import com.azure.resourcemanager.storage.generated.models.ListContainerItem; +import com.azure.resourcemanager.storage.generated.models.PublicAccess; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Map; + +public final class ListContainerItemImpl implements ListContainerItem { + private ListContainerItemInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + ListContainerItemImpl(ListContainerItemInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String version() { + return this.innerModel().version(); + } + + public Boolean deleted() { + return this.innerModel().deleted(); + } + + public OffsetDateTime deletedTime() { + return this.innerModel().deletedTime(); + } + + public Integer remainingRetentionDays() { + return this.innerModel().remainingRetentionDays(); + } + + public String defaultEncryptionScope() { + return this.innerModel().defaultEncryptionScope(); + } + + public Boolean denyEncryptionScopeOverride() { + return this.innerModel().denyEncryptionScopeOverride(); + } + + public PublicAccess publicAccess() { + return this.innerModel().publicAccess(); + } + + public OffsetDateTime lastModifiedTime() { + return this.innerModel().lastModifiedTime(); + } + + public LeaseStatus leaseStatus() { + return this.innerModel().leaseStatus(); + } + + public LeaseState leaseState() { + return this.innerModel().leaseState(); + } + + public LeaseDuration leaseDuration() { + return this.innerModel().leaseDuration(); + } + + public Map metadata() { + Map inner = this.innerModel().metadata(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ImmutabilityPolicyProperties immutabilityPolicy() { + return this.innerModel().immutabilityPolicy(); + } + + public LegalHoldProperties legalHold() { + return this.innerModel().legalHold(); + } + + public Boolean hasLegalHold() { + return this.innerModel().hasLegalHold(); + } + + public Boolean hasImmutabilityPolicy() { + return this.innerModel().hasImmutabilityPolicy(); + } + + public ImmutableStorageWithVersioning immutableStorageWithVersioning() { + return this.innerModel().immutableStorageWithVersioning(); + } + + public Boolean enableNfsV3RootSquash() { + return this.innerModel().enableNfsV3RootSquash(); + } + + public Boolean enableNfsV3AllSquash() { + return this.innerModel().enableNfsV3AllSquash(); + } + + public ListContainerItemInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListQueueImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListQueueImpl.java new file mode 100644 index 0000000000000..34ef555539bac --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListQueueImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.ListQueueInner; +import com.azure.resourcemanager.storage.generated.models.ListQueue; +import java.util.Collections; +import java.util.Map; + +public final class ListQueueImpl implements ListQueue { + private ListQueueInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + ListQueueImpl(ListQueueInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public Map metadata() { + Map inner = this.innerModel().metadata(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ListQueueInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListQueueServicesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListQueueServicesImpl.java new file mode 100644 index 0000000000000..5cabc6a9d274a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListQueueServicesImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.ListQueueServicesInner; +import com.azure.resourcemanager.storage.generated.fluent.models.QueueServicePropertiesInner; +import com.azure.resourcemanager.storage.generated.models.ListQueueServices; +import com.azure.resourcemanager.storage.generated.models.QueueServiceProperties; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ListQueueServicesImpl implements ListQueueServices { + private ListQueueServicesInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + ListQueueServicesImpl(ListQueueServicesInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new QueueServicePropertiesImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ListQueueServicesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListServiceSasResponseImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListServiceSasResponseImpl.java new file mode 100644 index 0000000000000..dbe3ce38dd44d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListServiceSasResponseImpl.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.ListServiceSasResponseInner; +import com.azure.resourcemanager.storage.generated.models.ListServiceSasResponse; + +public final class ListServiceSasResponseImpl implements ListServiceSasResponse { + private ListServiceSasResponseInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + ListServiceSasResponseImpl(ListServiceSasResponseInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String serviceSasToken() { + return this.innerModel().serviceSasToken(); + } + + public ListServiceSasResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListTableServicesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListTableServicesImpl.java new file mode 100644 index 0000000000000..cfe01c84e5d71 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListTableServicesImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.ListTableServicesInner; +import com.azure.resourcemanager.storage.generated.fluent.models.TableServicePropertiesInner; +import com.azure.resourcemanager.storage.generated.models.ListTableServices; +import com.azure.resourcemanager.storage.generated.models.TableServiceProperties; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ListTableServicesImpl implements ListTableServices { + private ListTableServicesInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + ListTableServicesImpl(ListTableServicesInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new TableServicePropertiesImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ListTableServicesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUserImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUserImpl.java new file mode 100644 index 0000000000000..5c46f170e324f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUserImpl.java @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserInner; +import com.azure.resourcemanager.storage.generated.models.LocalUser; +import com.azure.resourcemanager.storage.generated.models.LocalUserKeys; +import com.azure.resourcemanager.storage.generated.models.LocalUserRegeneratePasswordResult; +import com.azure.resourcemanager.storage.generated.models.PermissionScope; +import com.azure.resourcemanager.storage.generated.models.SshPublicKey; +import java.util.Collections; +import java.util.List; + +public final class LocalUserImpl implements LocalUser, LocalUser.Definition, LocalUser.Update { + private LocalUserInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public List permissionScopes() { + List inner = this.innerModel().permissionScopes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String homeDirectory() { + return this.innerModel().homeDirectory(); + } + + public List sshAuthorizedKeys() { + List inner = this.innerModel().sshAuthorizedKeys(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String sid() { + return this.innerModel().sid(); + } + + public Boolean hasSharedKey() { + return this.innerModel().hasSharedKey(); + } + + public Boolean hasSshKey() { + return this.innerModel().hasSshKey(); + } + + public Boolean hasSshPassword() { + return this.innerModel().hasSshPassword(); + } + + public Integer userId() { + return this.innerModel().userId(); + } + + public Integer groupId() { + return this.innerModel().groupId(); + } + + public Boolean allowAclAuthorization() { + return this.innerModel().allowAclAuthorization(); + } + + public List extendedGroups() { + List inner = this.innerModel().extendedGroups(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean isNFSv3Enabled() { + return this.innerModel().isNFSv3Enabled(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public LocalUserInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String username; + + public LocalUserImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public LocalUser create() { + this.innerObject = serviceManager.serviceClient() + .getLocalUsersOperations() + .createOrUpdateWithResponse(resourceGroupName, accountName, username, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public LocalUser create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLocalUsersOperations() + .createOrUpdateWithResponse(resourceGroupName, accountName, username, this.innerModel(), context) + .getValue(); + return this; + } + + LocalUserImpl(String name, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new LocalUserInner(); + this.serviceManager = serviceManager; + this.username = name; + } + + public LocalUserImpl update() { + return this; + } + + public LocalUser apply() { + this.innerObject = serviceManager.serviceClient() + .getLocalUsersOperations() + .createOrUpdateWithResponse(resourceGroupName, accountName, username, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public LocalUser apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLocalUsersOperations() + .createOrUpdateWithResponse(resourceGroupName, accountName, username, this.innerModel(), context) + .getValue(); + return this; + } + + LocalUserImpl(LocalUserInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.username = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "localUsers"); + } + + public LocalUser refresh() { + this.innerObject = serviceManager.serviceClient() + .getLocalUsersOperations() + .getWithResponse(resourceGroupName, accountName, username, Context.NONE) + .getValue(); + return this; + } + + public LocalUser refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLocalUsersOperations() + .getWithResponse(resourceGroupName, accountName, username, context) + .getValue(); + return this; + } + + public Response listKeysWithResponse(Context context) { + return serviceManager.localUsersOperations() + .listKeysWithResponse(resourceGroupName, accountName, username, context); + } + + public LocalUserKeys listKeys() { + return serviceManager.localUsersOperations().listKeys(resourceGroupName, accountName, username); + } + + public Response regeneratePasswordWithResponse(Context context) { + return serviceManager.localUsersOperations() + .regeneratePasswordWithResponse(resourceGroupName, accountName, username, context); + } + + public LocalUserRegeneratePasswordResult regeneratePassword() { + return serviceManager.localUsersOperations().regeneratePassword(resourceGroupName, accountName, username); + } + + public LocalUserImpl withPermissionScopes(List permissionScopes) { + this.innerModel().withPermissionScopes(permissionScopes); + return this; + } + + public LocalUserImpl withHomeDirectory(String homeDirectory) { + this.innerModel().withHomeDirectory(homeDirectory); + return this; + } + + public LocalUserImpl withSshAuthorizedKeys(List sshAuthorizedKeys) { + this.innerModel().withSshAuthorizedKeys(sshAuthorizedKeys); + return this; + } + + public LocalUserImpl withHasSharedKey(Boolean hasSharedKey) { + this.innerModel().withHasSharedKey(hasSharedKey); + return this; + } + + public LocalUserImpl withHasSshKey(Boolean hasSshKey) { + this.innerModel().withHasSshKey(hasSshKey); + return this; + } + + public LocalUserImpl withHasSshPassword(Boolean hasSshPassword) { + this.innerModel().withHasSshPassword(hasSshPassword); + return this; + } + + public LocalUserImpl withGroupId(Integer groupId) { + this.innerModel().withGroupId(groupId); + return this; + } + + public LocalUserImpl withAllowAclAuthorization(Boolean allowAclAuthorization) { + this.innerModel().withAllowAclAuthorization(allowAclAuthorization); + return this; + } + + public LocalUserImpl withExtendedGroups(List extendedGroups) { + this.innerModel().withExtendedGroups(extendedGroups); + return this; + } + + public LocalUserImpl withIsNFSv3Enabled(Boolean isNFSv3Enabled) { + this.innerModel().withIsNFSv3Enabled(isNFSv3Enabled); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUserKeysImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUserKeysImpl.java new file mode 100644 index 0000000000000..7373ae9cfa81b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUserKeysImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserKeysInner; +import com.azure.resourcemanager.storage.generated.models.LocalUserKeys; +import com.azure.resourcemanager.storage.generated.models.SshPublicKey; +import java.util.Collections; +import java.util.List; + +public final class LocalUserKeysImpl implements LocalUserKeys { + private LocalUserKeysInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + LocalUserKeysImpl(LocalUserKeysInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List sshAuthorizedKeys() { + List inner = this.innerModel().sshAuthorizedKeys(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String sharedKey() { + return this.innerModel().sharedKey(); + } + + public LocalUserKeysInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUserRegeneratePasswordResultImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUserRegeneratePasswordResultImpl.java new file mode 100644 index 0000000000000..84c7994d6d6e3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUserRegeneratePasswordResultImpl.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserRegeneratePasswordResultInner; +import com.azure.resourcemanager.storage.generated.models.LocalUserRegeneratePasswordResult; + +public final class LocalUserRegeneratePasswordResultImpl implements LocalUserRegeneratePasswordResult { + private LocalUserRegeneratePasswordResultInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + LocalUserRegeneratePasswordResultImpl(LocalUserRegeneratePasswordResultInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String sshPassword() { + return this.innerModel().sshPassword(); + } + + public LocalUserRegeneratePasswordResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUsersOperationsClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUsersOperationsClientImpl.java new file mode 100644 index 0000000000000..b8da7b33ff9da --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUsersOperationsClientImpl.java @@ -0,0 +1,1087 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.LocalUsersOperationsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserKeysInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserRegeneratePasswordResultInner; +import com.azure.resourcemanager.storage.generated.models.ListLocalUserIncludeParam; +import com.azure.resourcemanager.storage.generated.models.LocalUsers; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in LocalUsersOperationsClient. + */ +public final class LocalUsersOperationsClientImpl implements LocalUsersOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final LocalUsersOperationsService service; + + /** + * The service client containing this operation class. + */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of LocalUsersOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LocalUsersOperationsClientImpl(StorageManagementClientImpl client) { + this.service = RestProxy.create(LocalUsersOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientLocalUsersOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + public interface LocalUsersOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$maxpagesize") Integer maxpagesize, @QueryParam("$filter") String filter, + @QueryParam("$include") ListLocalUserIncludeParam include, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("username") String username, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("username") String username, @BodyParam("application/json") LocalUserInner properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("username") String username, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}/listKeys") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listKeys(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("username") String username, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}/regeneratePassword") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regeneratePassword(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("username") String username, @HeaderParam("Accept") String accept, Context context); + } + + /** + * List the local users associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of local users that will be included in the list + * response. + * @param filter Optional. When specified, only local user names starting with the filter will be listed. + * @param include Optional, when specified, will list local users enabled for the specific protocol. Lists all users + * by default. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of local users requested, and if paging is required, a URL to the next page of local users along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName, + Integer maxpagesize, String filter, ListLocalUserIncludeParam include) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), maxpagesize, filter, include, accept, + context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the local users associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of local users that will be included in the list + * response. + * @param filter Optional. When specified, only local user names starting with the filter will be listed. + * @param include Optional, when specified, will list local users enabled for the specific protocol. Lists all users + * by default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of local users requested, and if paging is required, a URL to the next page of local users along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName, + Integer maxpagesize, String filter, ListLocalUserIncludeParam include, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), maxpagesize, filter, include, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), null, null)); + } + + /** + * List the local users associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of local users that will be included in the list + * response. + * @param filter Optional. When specified, only local user names starting with the filter will be listed. + * @param include Optional, when specified, will list local users enabled for the specific protocol. Lists all users + * by default. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of local users requested, and if paging is required, a URL to the next page of local users as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, Integer maxpagesize, + String filter, ListLocalUserIncludeParam include) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, include)); + } + + /** + * List the local users associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of local users requested, and if paging is required, a URL to the next page of local users as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + final Integer maxpagesize = null; + final String filter = null; + final ListLocalUserIncludeParam include = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, include)); + } + + /** + * List the local users associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of local users that will be included in the list + * response. + * @param filter Optional. When specified, only local user names starting with the filter will be listed. + * @param include Optional, when specified, will list local users enabled for the specific protocol. Lists all users + * by default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of local users requested, and if paging is required, a URL to the next page of local users as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, Integer maxpagesize, + String filter, ListLocalUserIncludeParam include, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, include, context)); + } + + /** + * List the local users associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of local users requested, and if paging is required, a URL to the next page of local users as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + final Integer maxpagesize = null; + final String filter = null; + final ListLocalUserIncludeParam include = null; + return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter, include)); + } + + /** + * List the local users associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of local users that will be included in the list + * response. + * @param filter Optional. When specified, only local user names starting with the filter will be listed. + * @param include Optional, when specified, will list local users enabled for the specific protocol. Lists all users + * by default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of local users requested, and if paging is required, a URL to the next page of local users as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, Integer maxpagesize, + String filter, ListLocalUserIncludeParam include, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter, include, context)); + } + + /** + * Get the local user of the storage account by username. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user of the storage account by username along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String username) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (username == null) { + return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), username, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the local user of the storage account by username. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user of the storage account by username along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String username, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (username == null) { + return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), username, accept, context); + } + + /** + * Get the local user of the storage account by username. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user of the storage account by username on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String username) { + return getWithResponseAsync(resourceGroupName, accountName, username) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the local user of the storage account by username. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user of the storage account by username along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, String username, + Context context) { + return getWithResponseAsync(resourceGroupName, accountName, username, context).block(); + } + + /** + * Get the local user of the storage account by username. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user of the storage account by username. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LocalUserInner get(String resourceGroupName, String accountName, String username) { + return getWithResponse(resourceGroupName, accountName, username, Context.NONE).getValue(); + } + + /** + * Create or update the properties of a local user associated with the storage account. Properties for NFSv3 + * enablement and extended groups cannot be set with other properties. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param properties The local user associated with a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user associated with the storage accounts along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String accountName, + String username, LocalUserInner properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (username == null) { + return Mono.error(new IllegalArgumentException("Parameter username 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 accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), username, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the properties of a local user associated with the storage account. Properties for NFSv3 + * enablement and extended groups cannot be set with other properties. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param properties The local user associated with a storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user associated with the storage accounts along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String accountName, + String username, LocalUserInner properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (username == null) { + return Mono.error(new IllegalArgumentException("Parameter username 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), username, properties, accept, context); + } + + /** + * Create or update the properties of a local user associated with the storage account. Properties for NFSv3 + * enablement and extended groups cannot be set with other properties. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param properties The local user associated with a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user associated with the storage accounts on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String accountName, String username, + LocalUserInner properties) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, username, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update the properties of a local user associated with the storage account. Properties for NFSv3 + * enablement and extended groups cannot be set with other properties. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param properties The local user associated with a storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user associated with the storage accounts along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String accountName, + String username, LocalUserInner properties, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, username, properties, context).block(); + } + + /** + * Create or update the properties of a local user associated with the storage account. Properties for NFSv3 + * enablement and extended groups cannot be set with other properties. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param properties The local user associated with a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user associated with the storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LocalUserInner createOrUpdate(String resourceGroupName, String accountName, String username, + LocalUserInner properties) { + return createOrUpdateWithResponse(resourceGroupName, accountName, username, properties, Context.NONE) + .getValue(); + } + + /** + * Deletes the local user associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String accountName, + String username) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (username == null) { + return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), username, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the local user associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String accountName, String username, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (username == null) { + return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), username, accept, context); + } + + /** + * Deletes the local user associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String username) { + return deleteWithResponseAsync(resourceGroupName, accountName, username).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the local user associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String accountName, String username, + Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, username, context).block(); + } + + /** + * Deletes the local user associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String username) { + deleteWithResponse(resourceGroupName, accountName, username, Context.NONE); + } + + /** + * List SSH authorized keys and shared key of the local user. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Storage Account Local User keys along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync(String resourceGroupName, String accountName, + String username) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (username == null) { + return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listKeys(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), username, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SSH authorized keys and shared key of the local user. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Storage Account Local User keys along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync(String resourceGroupName, String accountName, + String username, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (username == null) { + return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listKeys(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), username, accept, context); + } + + /** + * List SSH authorized keys and shared key of the local user. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Storage Account Local User keys on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listKeysAsync(String resourceGroupName, String accountName, String username) { + return listKeysWithResponseAsync(resourceGroupName, accountName, username) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List SSH authorized keys and shared key of the local user. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Storage Account Local User keys along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listKeysWithResponse(String resourceGroupName, String accountName, + String username, Context context) { + return listKeysWithResponseAsync(resourceGroupName, accountName, username, context).block(); + } + + /** + * List SSH authorized keys and shared key of the local user. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Storage Account Local User keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LocalUserKeysInner listKeys(String resourceGroupName, String accountName, String username) { + return listKeysWithResponse(resourceGroupName, accountName, username, Context.NONE).getValue(); + } + + /** + * Regenerate the local user SSH password. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secrets of Storage Account Local User along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + regeneratePasswordWithResponseAsync(String resourceGroupName, String accountName, String username) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (username == null) { + return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.regeneratePassword(this.client.getEndpoint(), resourceGroupName, + accountName, this.client.getApiVersion(), this.client.getSubscriptionId(), username, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Regenerate the local user SSH password. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secrets of Storage Account Local User along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regeneratePasswordWithResponseAsync( + String resourceGroupName, String accountName, String username, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (username == null) { + return Mono.error(new IllegalArgumentException("Parameter username is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.regeneratePassword(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), username, accept, context); + } + + /** + * Regenerate the local user SSH password. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secrets of Storage Account Local User on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regeneratePasswordAsync(String resourceGroupName, + String accountName, String username) { + return regeneratePasswordWithResponseAsync(resourceGroupName, accountName, username) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Regenerate the local user SSH password. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secrets of Storage Account Local User along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regeneratePasswordWithResponse(String resourceGroupName, + String accountName, String username, Context context) { + return regeneratePasswordWithResponseAsync(resourceGroupName, accountName, username, context).block(); + } + + /** + * Regenerate the local user SSH password. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secrets of Storage Account Local User. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LocalUserRegeneratePasswordResultInner regeneratePassword(String resourceGroupName, String accountName, + String username) { + return regeneratePasswordWithResponse(resourceGroupName, accountName, username, Context.NONE).getValue(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUsersOperationsImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUsersOperationsImpl.java new file mode 100644 index 0000000000000..4036ed41be0d0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LocalUsersOperationsImpl.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.LocalUsersOperationsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserKeysInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserRegeneratePasswordResultInner; +import com.azure.resourcemanager.storage.generated.models.ListLocalUserIncludeParam; +import com.azure.resourcemanager.storage.generated.models.LocalUser; +import com.azure.resourcemanager.storage.generated.models.LocalUserKeys; +import com.azure.resourcemanager.storage.generated.models.LocalUserRegeneratePasswordResult; +import com.azure.resourcemanager.storage.generated.models.LocalUsersOperations; + +public final class LocalUsersOperationsImpl implements LocalUsersOperations { + private static final ClientLogger LOGGER = new ClientLogger(LocalUsersOperationsImpl.class); + + private final LocalUsersOperationsClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public LocalUsersOperationsImpl(LocalUsersOperationsClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LocalUserImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Integer maxpagesize, + String filter, ListLocalUserIncludeParam include, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName, maxpagesize, filter, include, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LocalUserImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String accountName, String username, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, accountName, username, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LocalUserImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LocalUser get(String resourceGroupName, String accountName, String username) { + LocalUserInner inner = this.serviceClient().get(resourceGroupName, accountName, username); + if (inner != null) { + return new LocalUserImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String accountName, String username, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, username, context); + } + + public void delete(String resourceGroupName, String accountName, String username) { + this.serviceClient().delete(resourceGroupName, accountName, username); + } + + public Response listKeysWithResponse(String resourceGroupName, String accountName, String username, + Context context) { + Response inner + = this.serviceClient().listKeysWithResponse(resourceGroupName, accountName, username, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LocalUserKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LocalUserKeys listKeys(String resourceGroupName, String accountName, String username) { + LocalUserKeysInner inner = this.serviceClient().listKeys(resourceGroupName, accountName, username); + if (inner != null) { + return new LocalUserKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response regeneratePasswordWithResponse(String resourceGroupName, + String accountName, String username, Context context) { + Response inner + = this.serviceClient().regeneratePasswordWithResponse(resourceGroupName, accountName, username, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LocalUserRegeneratePasswordResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LocalUserRegeneratePasswordResult regeneratePassword(String resourceGroupName, String accountName, + String username) { + LocalUserRegeneratePasswordResultInner inner + = this.serviceClient().regeneratePassword(resourceGroupName, accountName, username); + if (inner != null) { + return new LocalUserRegeneratePasswordResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public LocalUser 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String username = ResourceManagerUtils.getValueFromIdByName(id, "localUsers"); + if (username == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'localUsers'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, username, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String username = ResourceManagerUtils.getValueFromIdByName(id, "localUsers"); + if (username == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'localUsers'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, username, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String username = ResourceManagerUtils.getValueFromIdByName(id, "localUsers"); + if (username == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'localUsers'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, username, Context.NONE); + } + + public Response 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String username = ResourceManagerUtils.getValueFromIdByName(id, "localUsers"); + if (username == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'localUsers'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, username, context); + } + + private LocalUsersOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public LocalUserImpl define(String name) { + return new LocalUserImpl(name, this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ManagementPoliciesClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ManagementPoliciesClientImpl.java new file mode 100644 index 0000000000000..3a897b4e3e0fc --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ManagementPoliciesClientImpl.java @@ -0,0 +1,544 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.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.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.storage.generated.fluent.ManagementPoliciesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.ManagementPolicyInner; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyName; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ManagementPoliciesClient. + */ +public final class ManagementPoliciesClientImpl implements ManagementPoliciesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ManagementPoliciesService service; + + /** + * The service client containing this operation class. + */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of ManagementPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagementPoliciesClientImpl(StorageManagementClientImpl client) { + this.service = RestProxy.create(ManagementPoliciesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientManagementPolicies to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + public interface ManagementPoliciesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("managementPolicyName") ManagementPolicyName managementPolicyName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("managementPolicyName") ManagementPolicyName managementPolicyName, + @BodyParam("application/json") ManagementPolicyInner properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("managementPolicyName") ManagementPolicyName managementPolicyName, Context context); + } + + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managementpolicy associated with the specified storage account along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + ManagementPolicyName managementPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (managementPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), managementPolicyName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @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 managementpolicy associated with the specified storage account along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + ManagementPolicyName managementPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (managementPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), managementPolicyName, accept, context); + } + + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managementpolicy associated with the specified storage account on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, + ManagementPolicyName managementPolicyName) { + return getWithResponseAsync(resourceGroupName, accountName, managementPolicyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @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 managementpolicy associated with the specified storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, + ManagementPolicyName managementPolicyName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, managementPolicyName, context).block(); + } + + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managementpolicy associated with the specified storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagementPolicyInner get(String resourceGroupName, String accountName, + ManagementPolicyName managementPolicyName) { + return getWithResponse(resourceGroupName, accountName, managementPolicyName, Context.NONE).getValue(); + } + + /** + * Sets the managementpolicy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @param properties The ManagementPolicy set to a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Get Storage Account ManagementPolicies operation response along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String accountName, ManagementPolicyName managementPolicyName, ManagementPolicyInner properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (managementPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementPolicyName 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 accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), managementPolicyName, properties, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Sets the managementpolicy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @param properties The ManagementPolicy set to a storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Get Storage Account ManagementPolicies operation response along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String accountName, ManagementPolicyName managementPolicyName, ManagementPolicyInner properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (managementPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementPolicyName 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), managementPolicyName, properties, accept, + context); + } + + /** + * Sets the managementpolicy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @param properties The ManagementPolicy set to a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Get Storage Account ManagementPolicies operation response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String accountName, + ManagementPolicyName managementPolicyName, ManagementPolicyInner properties) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, managementPolicyName, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Sets the managementpolicy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @param properties The ManagementPolicy set to a storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Get Storage Account ManagementPolicies operation response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String accountName, + ManagementPolicyName managementPolicyName, ManagementPolicyInner properties, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, managementPolicyName, properties, + context).block(); + } + + /** + * Sets the managementpolicy to the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @param properties The ManagementPolicy set to a storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Get Storage Account ManagementPolicies operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagementPolicyInner createOrUpdate(String resourceGroupName, String accountName, + ManagementPolicyName managementPolicyName, ManagementPolicyInner properties) { + return createOrUpdateWithResponse(resourceGroupName, accountName, managementPolicyName, properties, + Context.NONE).getValue(); + } + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 accountName, + ManagementPolicyName managementPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (managementPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementPolicyName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), managementPolicyName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @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 accountName, + ManagementPolicyName managementPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (managementPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementPolicyName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), managementPolicyName, context); + } + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 accountName, + ManagementPolicyName managementPolicyName) { + return deleteWithResponseAsync(resourceGroupName, accountName, managementPolicyName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String accountName, + ManagementPolicyName managementPolicyName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, managementPolicyName, context).block(); + } + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName) { + deleteWithResponse(resourceGroupName, accountName, managementPolicyName, Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ManagementPoliciesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ManagementPoliciesImpl.java new file mode 100644 index 0000000000000..470d2ed6dcc46 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ManagementPoliciesImpl.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.ManagementPoliciesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.ManagementPolicyInner; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicies; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicy; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyName; + +public final class ManagementPoliciesImpl implements ManagementPolicies { + private static final ClientLogger LOGGER = new ClientLogger(ManagementPoliciesImpl.class); + + private final ManagementPoliciesClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public ManagementPoliciesImpl(ManagementPoliciesClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String accountName, + ManagementPolicyName managementPolicyName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, accountName, managementPolicyName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ManagementPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ManagementPolicy get(String resourceGroupName, String accountName, + ManagementPolicyName managementPolicyName) { + ManagementPolicyInner inner = this.serviceClient().get(resourceGroupName, accountName, managementPolicyName); + if (inner != null) { + return new ManagementPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String accountName, + ManagementPolicyName managementPolicyName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, managementPolicyName, context); + } + + public void delete(String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName) { + this.serviceClient().delete(resourceGroupName, accountName, managementPolicyName); + } + + public ManagementPolicy 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String managementPolicyNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "managementPolicies"); + if (managementPolicyNameLocal == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managementPolicies'.", id))); + } + ManagementPolicyName managementPolicyName = ManagementPolicyName.fromString(managementPolicyNameLocal); + return this.getWithResponse(resourceGroupName, accountName, managementPolicyName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String managementPolicyNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "managementPolicies"); + if (managementPolicyNameLocal == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managementPolicies'.", id))); + } + ManagementPolicyName managementPolicyName = ManagementPolicyName.fromString(managementPolicyNameLocal); + return this.getWithResponse(resourceGroupName, accountName, managementPolicyName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String managementPolicyNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "managementPolicies"); + if (managementPolicyNameLocal == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managementPolicies'.", id))); + } + ManagementPolicyName managementPolicyName = ManagementPolicyName.fromString(managementPolicyNameLocal); + this.deleteWithResponse(resourceGroupName, accountName, managementPolicyName, Context.NONE); + } + + public Response 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String managementPolicyNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "managementPolicies"); + if (managementPolicyNameLocal == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managementPolicies'.", id))); + } + ManagementPolicyName managementPolicyName = ManagementPolicyName.fromString(managementPolicyNameLocal); + return this.deleteWithResponse(resourceGroupName, accountName, managementPolicyName, context); + } + + private ManagementPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public ManagementPolicyImpl define(ManagementPolicyName name) { + return new ManagementPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ManagementPolicyImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ManagementPolicyImpl.java new file mode 100644 index 0000000000000..b0eb22b65c119 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ManagementPolicyImpl.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.ManagementPolicyInner; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicy; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyName; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicySchema; +import java.time.OffsetDateTime; + +public final class ManagementPolicyImpl + implements ManagementPolicy, ManagementPolicy.Definition, ManagementPolicy.Update { + private ManagementPolicyInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public OffsetDateTime lastModifiedTime() { + return this.innerModel().lastModifiedTime(); + } + + public ManagementPolicySchema policy() { + return this.innerModel().policy(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ManagementPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private ManagementPolicyName managementPolicyName; + + public ManagementPolicyImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public ManagementPolicy create() { + this.innerObject = serviceManager.serviceClient() + .getManagementPolicies() + .createOrUpdateWithResponse(resourceGroupName, accountName, managementPolicyName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public ManagementPolicy create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getManagementPolicies() + .createOrUpdateWithResponse(resourceGroupName, accountName, managementPolicyName, this.innerModel(), + context) + .getValue(); + return this; + } + + ManagementPolicyImpl(ManagementPolicyName name, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new ManagementPolicyInner(); + this.serviceManager = serviceManager; + this.managementPolicyName = name; + } + + public ManagementPolicyImpl update() { + return this; + } + + public ManagementPolicy apply() { + this.innerObject = serviceManager.serviceClient() + .getManagementPolicies() + .createOrUpdateWithResponse(resourceGroupName, accountName, managementPolicyName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public ManagementPolicy apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getManagementPolicies() + .createOrUpdateWithResponse(resourceGroupName, accountName, managementPolicyName, this.innerModel(), + context) + .getValue(); + return this; + } + + ManagementPolicyImpl(ManagementPolicyInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.managementPolicyName = ManagementPolicyName + .fromString(ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "managementPolicies")); + } + + public ManagementPolicy refresh() { + this.innerObject = serviceManager.serviceClient() + .getManagementPolicies() + .getWithResponse(resourceGroupName, accountName, managementPolicyName, Context.NONE) + .getValue(); + return this; + } + + public ManagementPolicy refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getManagementPolicies() + .getWithResponse(resourceGroupName, accountName, managementPolicyName, context) + .getValue(); + return this; + } + + public ManagementPolicyImpl withPolicy(ManagementPolicySchema policy) { + this.innerModel().withPolicy(policy); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/NetworkSecurityPerimeterConfigurationImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/NetworkSecurityPerimeterConfigurationImpl.java new file mode 100644 index 0000000000000..4372ae3aa1890 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/NetworkSecurityPerimeterConfigurationImpl.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.storage.generated.fluent.models.NetworkSecurityPerimeterConfigurationInner; +import com.azure.resourcemanager.storage.generated.models.NetworkSecurityPerimeter; +import com.azure.resourcemanager.storage.generated.models.NetworkSecurityPerimeterConfiguration; +import com.azure.resourcemanager.storage.generated.models.NetworkSecurityPerimeterConfigurationPropertiesProfile; +import com.azure.resourcemanager.storage.generated.models.NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation; +import com.azure.resourcemanager.storage.generated.models.NetworkSecurityPerimeterConfigurationProvisioningState; +import com.azure.resourcemanager.storage.generated.models.ProvisioningIssue; +import java.util.Collections; +import java.util.List; + +public final class NetworkSecurityPerimeterConfigurationImpl implements NetworkSecurityPerimeterConfiguration { + private NetworkSecurityPerimeterConfigurationInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + NetworkSecurityPerimeterConfigurationImpl(NetworkSecurityPerimeterConfigurationInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public NetworkSecurityPerimeterConfigurationProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List provisioningIssues() { + List inner = this.innerModel().provisioningIssues(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public NetworkSecurityPerimeter networkSecurityPerimeter() { + return this.innerModel().networkSecurityPerimeter(); + } + + public NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation resourceAssociation() { + return this.innerModel().resourceAssociation(); + } + + public NetworkSecurityPerimeterConfigurationPropertiesProfile profile() { + return this.innerModel().profile(); + } + + public NetworkSecurityPerimeterConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/NetworkSecurityPerimeterConfigurationsClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/NetworkSecurityPerimeterConfigurationsClientImpl.java new file mode 100644 index 0000000000000..e6c0a45d88309 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/NetworkSecurityPerimeterConfigurationsClientImpl.java @@ -0,0 +1,661 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.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.storage.generated.fluent.NetworkSecurityPerimeterConfigurationsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.NetworkSecurityPerimeterConfigurationInner; +import com.azure.resourcemanager.storage.generated.models.NetworkSecurityPerimeterConfigurationList; +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 + * NetworkSecurityPerimeterConfigurationsClient. + */ +public final class NetworkSecurityPerimeterConfigurationsClientImpl + implements NetworkSecurityPerimeterConfigurationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final NetworkSecurityPerimeterConfigurationsService service; + + /** + * The service client containing this operation class. + */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of NetworkSecurityPerimeterConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkSecurityPerimeterConfigurationsClientImpl(StorageManagementClientImpl client) { + this.service = RestProxy.create(NetworkSecurityPerimeterConfigurationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientNetworkSecurityPerimeterConfigurations to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + public interface NetworkSecurityPerimeterConfigurationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/networkSecurityPerimeterConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("networkSecurityPerimeterConfigurationName") String networkSecurityPerimeterConfigurationName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reconcile(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("networkSecurityPerimeterConfigurationName") String networkSecurityPerimeterConfigurationName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets list of effective NetworkSecurityPerimeterConfiguration for storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of effective NetworkSecurityPerimeterConfiguration for storage account along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listSinglePageAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, accountName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets list of effective NetworkSecurityPerimeterConfiguration for storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of effective NetworkSecurityPerimeterConfiguration for storage account along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listSinglePageAsync(String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), null, null)); + } + + /** + * Gets list of effective NetworkSecurityPerimeterConfiguration for storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of effective NetworkSecurityPerimeterConfiguration for storage account as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, + String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName)); + } + + /** + * Gets list of effective NetworkSecurityPerimeterConfiguration for storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of effective NetworkSecurityPerimeterConfiguration for storage account as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, + String accountName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, context)); + } + + /** + * Gets list of effective NetworkSecurityPerimeterConfiguration for storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of effective NetworkSecurityPerimeterConfiguration for storage account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, + String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName)); + } + + /** + * Gets list of effective NetworkSecurityPerimeterConfiguration for storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of effective NetworkSecurityPerimeterConfiguration for storage account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); + } + + /** + * Gets effective NetworkSecurityPerimeterConfiguration for association. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return effective NetworkSecurityPerimeterConfiguration for association along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String networkSecurityPerimeterConfigurationName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (networkSecurityPerimeterConfigurationName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter networkSecurityPerimeterConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, accountName, networkSecurityPerimeterConfigurationName, this.client.getApiVersion(), + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets effective NetworkSecurityPerimeterConfiguration for association. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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 effective NetworkSecurityPerimeterConfiguration for association along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String networkSecurityPerimeterConfigurationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (networkSecurityPerimeterConfigurationName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter networkSecurityPerimeterConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, + networkSecurityPerimeterConfigurationName, this.client.getApiVersion(), accept, context); + } + + /** + * Gets effective NetworkSecurityPerimeterConfiguration for association. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return effective NetworkSecurityPerimeterConfiguration for association on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName) { + return getWithResponseAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets effective NetworkSecurityPerimeterConfiguration for association. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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 effective NetworkSecurityPerimeterConfiguration for association along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String accountName, String networkSecurityPerimeterConfigurationName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName, context) + .block(); + } + + /** + * Gets effective NetworkSecurityPerimeterConfiguration for association. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return effective NetworkSecurityPerimeterConfiguration for association. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkSecurityPerimeterConfigurationInner get(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName) { + return getWithResponse(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName, Context.NONE) + .getValue(); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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>> reconcileWithResponseAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (networkSecurityPerimeterConfigurationName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter networkSecurityPerimeterConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.reconcile(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, accountName, networkSecurityPerimeterConfigurationName, this.client.getApiVersion(), + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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>> reconcileWithResponseAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (networkSecurityPerimeterConfigurationName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter networkSecurityPerimeterConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.reconcile(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, networkSecurityPerimeterConfigurationName, this.client.getApiVersion(), accept, context); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> beginReconcileAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName) { + Mono>> mono + = reconcileWithResponseAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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> beginReconcileAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = reconcileWithResponseAsync(resourceGroupName, accountName, + networkSecurityPerimeterConfigurationName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> beginReconcile(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName) { + return this.beginReconcileAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName) + .getSyncPoller(); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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> beginReconcile(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName, Context context) { + return this + .beginReconcileAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName, context) + .getSyncPoller(); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 reconcileAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName) { + return beginReconcileAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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 reconcileAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName, Context context) { + return beginReconcileAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 reconcile(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName) { + reconcileAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName).block(); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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 reconcile(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName, Context context) { + reconcileAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName, context).block(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/NetworkSecurityPerimeterConfigurationsImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/NetworkSecurityPerimeterConfigurationsImpl.java new file mode 100644 index 0000000000000..885559c90946f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/NetworkSecurityPerimeterConfigurationsImpl.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.NetworkSecurityPerimeterConfigurationsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.NetworkSecurityPerimeterConfigurationInner; +import com.azure.resourcemanager.storage.generated.models.NetworkSecurityPerimeterConfiguration; +import com.azure.resourcemanager.storage.generated.models.NetworkSecurityPerimeterConfigurations; + +public final class NetworkSecurityPerimeterConfigurationsImpl implements NetworkSecurityPerimeterConfigurations { + private static final ClientLogger LOGGER = new ClientLogger(NetworkSecurityPerimeterConfigurationsImpl.class); + + private final NetworkSecurityPerimeterConfigurationsClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public NetworkSecurityPerimeterConfigurationsImpl(NetworkSecurityPerimeterConfigurationsClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new NetworkSecurityPerimeterConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new NetworkSecurityPerimeterConfigurationImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NetworkSecurityPerimeterConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkSecurityPerimeterConfiguration get(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName) { + NetworkSecurityPerimeterConfigurationInner inner + = this.serviceClient().get(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName); + if (inner != null) { + return new NetworkSecurityPerimeterConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public void reconcile(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName) { + this.serviceClient().reconcile(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName); + } + + public void reconcile(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName, Context context) { + this.serviceClient() + .reconcile(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName, context); + } + + private NetworkSecurityPerimeterConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ObjectReplicationPoliciesOperationsClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ObjectReplicationPoliciesOperationsClientImpl.java new file mode 100644 index 0000000000000..e0b1ea7bc79c6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ObjectReplicationPoliciesOperationsClientImpl.java @@ -0,0 +1,761 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.ObjectReplicationPoliciesOperationsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.ObjectReplicationPolicyInner; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicies; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ObjectReplicationPoliciesOperationsClient. + */ +public final class ObjectReplicationPoliciesOperationsClientImpl implements ObjectReplicationPoliciesOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ObjectReplicationPoliciesOperationsService service; + + /** + * The service client containing this operation class. + */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of ObjectReplicationPoliciesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ObjectReplicationPoliciesOperationsClientImpl(StorageManagementClientImpl client) { + this.service = RestProxy.create(ObjectReplicationPoliciesOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientObjectReplicationPoliciesOperations to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + public interface ObjectReplicationPoliciesOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("objectReplicationPolicyId") String objectReplicationPolicyId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("objectReplicationPolicyId") String objectReplicationPolicyId, + @BodyParam("application/json") ObjectReplicationPolicyInner properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("objectReplicationPolicyId") String objectReplicationPolicyId, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List the object replication policies associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account object replication policies along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the object replication policies associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account object replication policies along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), null, null)); + } + + /** + * List the object replication policies associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account object replication policies as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName)); + } + + /** + * List the object replication policies associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account object replication policies as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, context)); + } + + /** + * List the object replication policies associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account object replication policies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName)); + } + + /** + * List the object replication policies associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account object replication policies as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); + } + + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure the policy + * on the destination account first. For the source account, provide the value of the policy ID that is returned + * when you download the policy that was defined on the destination account. The policy is downloaded as a JSON + * file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 object replication policy of the storage account by policy ID along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String objectReplicationPolicyId) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (objectReplicationPolicyId == null) { + return Mono.error( + new IllegalArgumentException("Parameter objectReplicationPolicyId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), objectReplicationPolicyId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure the policy + * on the destination account first. For the source account, provide the value of the policy ID that is returned + * when you download the policy that was defined on the destination account. The policy is downloaded as a JSON + * file. + * @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 object replication policy of the storage account by policy ID along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String objectReplicationPolicyId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (objectReplicationPolicyId == null) { + return Mono.error( + new IllegalArgumentException("Parameter objectReplicationPolicyId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), objectReplicationPolicyId, accept, context); + } + + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure the policy + * on the destination account first. For the source account, provide the value of the policy ID that is returned + * when you download the policy that was defined on the destination account. The policy is downloaded as a JSON + * file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 object replication policy of the storage account by policy ID on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, + String objectReplicationPolicyId) { + return getWithResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure the policy + * on the destination account first. For the source account, provide the value of the policy ID that is returned + * when you download the policy that was defined on the destination account. The policy is downloaded as a JSON + * file. + * @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 object replication policy of the storage account by policy ID along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, + String objectReplicationPolicyId, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId, context).block(); + } + + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure the policy + * on the destination account first. For the source account, provide the value of the policy ID that is returned + * when you download the policy that was defined on the destination account. The policy is downloaded as a JSON + * file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 object replication policy of the storage account by policy ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ObjectReplicationPolicyInner get(String resourceGroupName, String accountName, + String objectReplicationPolicyId) { + return getWithResponse(resourceGroupName, accountName, objectReplicationPolicyId, Context.NONE).getValue(); + } + + /** + * Create or update the object replication policy of the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure the policy + * on the destination account first. For the source account, provide the value of the policy ID that is returned + * when you download the policy that was defined on the destination account. The policy is downloaded as a JSON + * file. + * @param properties The object replication policy set to a storage account. A unique policy ID will be created if + * absent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 replication policy between two storage accounts along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String accountName, String objectReplicationPolicyId, ObjectReplicationPolicyInner properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (objectReplicationPolicyId == null) { + return Mono.error( + new IllegalArgumentException("Parameter objectReplicationPolicyId 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 accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), objectReplicationPolicyId, properties, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the object replication policy of the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure the policy + * on the destination account first. For the source account, provide the value of the policy ID that is returned + * when you download the policy that was defined on the destination account. The policy is downloaded as a JSON + * file. + * @param properties The object replication policy set to a storage account. A unique policy ID will be created if + * absent. + * @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 replication policy between two storage accounts along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String accountName, String objectReplicationPolicyId, ObjectReplicationPolicyInner properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (objectReplicationPolicyId == null) { + return Mono.error( + new IllegalArgumentException("Parameter objectReplicationPolicyId 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), objectReplicationPolicyId, properties, accept, + context); + } + + /** + * Create or update the object replication policy of the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure the policy + * on the destination account first. For the source account, provide the value of the policy ID that is returned + * when you download the policy that was defined on the destination account. The policy is downloaded as a JSON + * file. + * @param properties The object replication policy set to a storage account. A unique policy ID will be created if + * absent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 replication policy between two storage accounts on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String accountName, + String objectReplicationPolicyId, ObjectReplicationPolicyInner properties) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update the object replication policy of the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure the policy + * on the destination account first. For the source account, provide the value of the policy ID that is returned + * when you download the policy that was defined on the destination account. The policy is downloaded as a JSON + * file. + * @param properties The object replication policy set to a storage account. A unique policy ID will be created if + * absent. + * @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 replication policy between two storage accounts along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String accountName, String objectReplicationPolicyId, ObjectReplicationPolicyInner properties, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId, properties, + context).block(); + } + + /** + * Create or update the object replication policy of the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure the policy + * on the destination account first. For the source account, provide the value of the policy ID that is returned + * when you download the policy that was defined on the destination account. The policy is downloaded as a JSON + * file. + * @param properties The object replication policy set to a storage account. A unique policy ID will be created if + * absent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 replication policy between two storage accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ObjectReplicationPolicyInner createOrUpdate(String resourceGroupName, String accountName, + String objectReplicationPolicyId, ObjectReplicationPolicyInner properties) { + return createOrUpdateWithResponse(resourceGroupName, accountName, objectReplicationPolicyId, properties, + Context.NONE).getValue(); + } + + /** + * Deletes the object replication policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure the policy + * on the destination account first. For the source account, provide the value of the policy ID that is returned + * when you download the policy that was defined on the destination account. The policy is downloaded as a JSON + * file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 accountName, + String objectReplicationPolicyId) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (objectReplicationPolicyId == null) { + return Mono.error( + new IllegalArgumentException("Parameter objectReplicationPolicyId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), objectReplicationPolicyId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the object replication policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure the policy + * on the destination account first. For the source account, provide the value of the policy ID that is returned + * when you download the policy that was defined on the destination account. The policy is downloaded as a JSON + * file. + * @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 accountName, + String objectReplicationPolicyId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (objectReplicationPolicyId == null) { + return Mono.error( + new IllegalArgumentException("Parameter objectReplicationPolicyId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), objectReplicationPolicyId, accept, context); + } + + /** + * Deletes the object replication policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure the policy + * on the destination account first. For the source account, provide the value of the policy ID that is returned + * when you download the policy that was defined on the destination account. The policy is downloaded as a JSON + * file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 accountName, String objectReplicationPolicyId) { + return deleteWithResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the object replication policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure the policy + * on the destination account first. For the source account, provide the value of the policy ID that is returned + * when you download the policy that was defined on the destination account. The policy is downloaded as a JSON + * file. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String accountName, + String objectReplicationPolicyId, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId, context).block(); + } + + /** + * Deletes the object replication policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure the policy + * on the destination account first. For the source account, provide the value of the policy ID that is returned + * when you download the policy that was defined on the destination account. The policy is downloaded as a JSON + * file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String objectReplicationPolicyId) { + deleteWithResponse(resourceGroupName, accountName, objectReplicationPolicyId, Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ObjectReplicationPoliciesOperationsImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ObjectReplicationPoliciesOperationsImpl.java new file mode 100644 index 0000000000000..667fd2f882f55 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ObjectReplicationPoliciesOperationsImpl.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.ObjectReplicationPoliciesOperationsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.ObjectReplicationPolicyInner; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPoliciesOperations; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicy; + +public final class ObjectReplicationPoliciesOperationsImpl implements ObjectReplicationPoliciesOperations { + private static final ClientLogger LOGGER = new ClientLogger(ObjectReplicationPoliciesOperationsImpl.class); + + private final ObjectReplicationPoliciesOperationsClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public ObjectReplicationPoliciesOperationsImpl(ObjectReplicationPoliciesOperationsClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ObjectReplicationPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ObjectReplicationPolicyImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String accountName, + String objectReplicationPolicyId, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, accountName, objectReplicationPolicyId, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ObjectReplicationPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ObjectReplicationPolicy get(String resourceGroupName, String accountName, String objectReplicationPolicyId) { + ObjectReplicationPolicyInner inner + = this.serviceClient().get(resourceGroupName, accountName, objectReplicationPolicyId); + if (inner != null) { + return new ObjectReplicationPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String accountName, + String objectReplicationPolicyId, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, accountName, objectReplicationPolicyId, context); + } + + public void delete(String resourceGroupName, String accountName, String objectReplicationPolicyId) { + this.serviceClient().delete(resourceGroupName, accountName, objectReplicationPolicyId); + } + + public ObjectReplicationPolicy 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String objectReplicationPolicyId = ResourceManagerUtils.getValueFromIdByName(id, "objectReplicationPolicies"); + if (objectReplicationPolicyId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'objectReplicationPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, objectReplicationPolicyId, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String objectReplicationPolicyId = ResourceManagerUtils.getValueFromIdByName(id, "objectReplicationPolicies"); + if (objectReplicationPolicyId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'objectReplicationPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, objectReplicationPolicyId, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String objectReplicationPolicyId = ResourceManagerUtils.getValueFromIdByName(id, "objectReplicationPolicies"); + if (objectReplicationPolicyId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'objectReplicationPolicies'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, objectReplicationPolicyId, Context.NONE); + } + + public Response 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String objectReplicationPolicyId = ResourceManagerUtils.getValueFromIdByName(id, "objectReplicationPolicies"); + if (objectReplicationPolicyId == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'objectReplicationPolicies'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, objectReplicationPolicyId, context); + } + + private ObjectReplicationPoliciesOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public ObjectReplicationPolicyImpl define(String name) { + return new ObjectReplicationPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ObjectReplicationPolicyImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ObjectReplicationPolicyImpl.java new file mode 100644 index 0000000000000..c75aedbf793d3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ObjectReplicationPolicyImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.ObjectReplicationPolicyInner; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicy; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicyPropertiesMetrics; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicyRule; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class ObjectReplicationPolicyImpl + implements ObjectReplicationPolicy, ObjectReplicationPolicy.Definition, ObjectReplicationPolicy.Update { + private ObjectReplicationPolicyInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String policyId() { + return this.innerModel().policyId(); + } + + public OffsetDateTime enabledTime() { + return this.innerModel().enabledTime(); + } + + public String sourceAccount() { + return this.innerModel().sourceAccount(); + } + + public String destinationAccount() { + return this.innerModel().destinationAccount(); + } + + public List rules() { + List inner = this.innerModel().rules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ObjectReplicationPolicyPropertiesMetrics metrics() { + return this.innerModel().metrics(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ObjectReplicationPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String objectReplicationPolicyId; + + public ObjectReplicationPolicyImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public ObjectReplicationPolicy create() { + this.innerObject = serviceManager.serviceClient() + .getObjectReplicationPoliciesOperations() + .createOrUpdateWithResponse(resourceGroupName, accountName, objectReplicationPolicyId, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public ObjectReplicationPolicy create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getObjectReplicationPoliciesOperations() + .createOrUpdateWithResponse(resourceGroupName, accountName, objectReplicationPolicyId, this.innerModel(), + context) + .getValue(); + return this; + } + + ObjectReplicationPolicyImpl(String name, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new ObjectReplicationPolicyInner(); + this.serviceManager = serviceManager; + this.objectReplicationPolicyId = name; + } + + public ObjectReplicationPolicyImpl update() { + return this; + } + + public ObjectReplicationPolicy apply() { + this.innerObject = serviceManager.serviceClient() + .getObjectReplicationPoliciesOperations() + .createOrUpdateWithResponse(resourceGroupName, accountName, objectReplicationPolicyId, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public ObjectReplicationPolicy apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getObjectReplicationPoliciesOperations() + .createOrUpdateWithResponse(resourceGroupName, accountName, objectReplicationPolicyId, this.innerModel(), + context) + .getValue(); + return this; + } + + ObjectReplicationPolicyImpl(ObjectReplicationPolicyInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.objectReplicationPolicyId + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "objectReplicationPolicies"); + } + + public ObjectReplicationPolicy refresh() { + this.innerObject = serviceManager.serviceClient() + .getObjectReplicationPoliciesOperations() + .getWithResponse(resourceGroupName, accountName, objectReplicationPolicyId, Context.NONE) + .getValue(); + return this; + } + + public ObjectReplicationPolicy refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getObjectReplicationPoliciesOperations() + .getWithResponse(resourceGroupName, accountName, objectReplicationPolicyId, context) + .getValue(); + return this; + } + + public ObjectReplicationPolicyImpl withSourceAccount(String sourceAccount) { + this.innerModel().withSourceAccount(sourceAccount); + return this; + } + + public ObjectReplicationPolicyImpl withDestinationAccount(String destinationAccount) { + this.innerModel().withDestinationAccount(destinationAccount); + return this; + } + + public ObjectReplicationPolicyImpl withRules(List rules) { + this.innerModel().withRules(rules); + return this; + } + + public ObjectReplicationPolicyImpl withMetrics(ObjectReplicationPolicyPropertiesMetrics metrics) { + this.innerModel().withMetrics(metrics); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/OperationImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/OperationImpl.java new file mode 100644 index 0000000000000..1a43cebeca41b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/OperationImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.storage.generated.models.Operation; +import com.azure.resourcemanager.storage.generated.models.OperationDisplay; +import com.azure.resourcemanager.storage.generated.models.ServiceSpecification; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + OperationImpl(OperationInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public ServiceSpecification serviceSpecification() { + return this.innerModel().serviceSpecification(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/OperationsClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..bf3385d44ef09 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/OperationsClientImpl.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.OperationsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.storage.generated.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 StorageManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(StorageManagementClientImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Storage/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all of the available Storage Rest API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations 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(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the available Storage Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations 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(), null, null)); + } + + /** + * Lists all of the available Storage Rest API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync()); + } + + /** + * Lists all of the available Storage Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context)); + } + + /** + * Lists all of the available Storage Rest API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available Storage Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/OperationsImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..40a51146b56b6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.OperationsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.storage.generated.models.Operation; +import com.azure.resourcemanager.storage.generated.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.storage.generated.StorageManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager 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.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateEndpointConnectionImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..3274ab6a8ea63 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.storage.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.storage.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.storage.generated.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.storage.generated.models.PrivateLinkServiceConnectionState; + +public final class PrivateEndpointConnectionImpl + implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String privateEndpointConnectionName; + + public PrivateEndpointConnectionImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public PrivateEndpointConnection create() { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .putWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .putWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, this.innerModel(), context) + .getValue(); + return this; + } + + PrivateEndpointConnectionImpl(String name, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new PrivateEndpointConnectionInner(); + this.serviceManager = serviceManager; + this.privateEndpointConnectionName = name; + } + + public PrivateEndpointConnectionImpl update() { + return this; + } + + public PrivateEndpointConnection apply() { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .putWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .putWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, this.innerModel(), context) + .getValue(); + return this; + } + + PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); + } + + public PrivateEndpointConnection refresh() { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.innerModel().withPrivateEndpoint(privateEndpoint); + return this; + } + + public PrivateEndpointConnectionImpl + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 0000000000000..2a5e0cfea8baa --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,733 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.storage.generated.models.PrivateEndpointConnectionListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. + */ +public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final PrivateEndpointConnectionsService service; + + /** + * The service client containing this operation class. + */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(StorageManagementClientImpl client) { + this.service = RestProxy.create(PrivateEndpointConnectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientPrivateEndpointConnections to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + public interface PrivateEndpointConnectionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> put(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @BodyParam("application/json") PrivateEndpointConnectionInner properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List all the private endpoint connections associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all the private endpoint connections associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), null, null)); + } + + /** + * List all the private endpoint connections associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName)); + } + + /** + * List all the private endpoint connections associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, context)); + } + + /** + * List all the private endpoint connections associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName)); + } + + /** + * List all the private endpoint connections associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); + } + + /** + * Gets the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 specified private endpoint connection associated with the storage account along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), privateEndpointConnectionName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 specified private endpoint connection associated with the storage account along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), privateEndpointConnectionName, accept, context); + } + + /** + * Gets the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 specified private endpoint connection associated with the storage account on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, + String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 specified private endpoint connection associated with the storage account along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, + String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName, context).block(); + } + + /** + * Gets the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 specified private endpoint connection associated with the storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get(String resourceGroupName, String accountName, + String privateEndpointConnectionName) { + return getWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, Context.NONE).getValue(); + } + + /** + * Update the state of specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Private Endpoint Connection resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync(String resourceGroupName, + String accountName, String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName 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 accept = "application/json"; + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), privateEndpointConnectionName, properties, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the state of specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @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 Private Endpoint Connection resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync(String resourceGroupName, + String accountName, String privateEndpointConnectionName, PrivateEndpointConnectionInner properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service.put(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), privateEndpointConnectionName, properties, accept, context); + } + + /** + * Update the state of specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Private Endpoint Connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync(String resourceGroupName, String accountName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { + return putWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update the state of specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @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 Private Endpoint Connection resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(String resourceGroupName, String accountName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner properties, Context context) { + return putWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName, properties, context) + .block(); + } + + /** + * Update the state of specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner put(String resourceGroupName, String accountName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { + return putWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, properties, Context.NONE) + .getValue(); + } + + /** + * Deletes the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 accountName, + String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), privateEndpointConnectionName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 accountName, + String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), privateEndpointConnectionName, accept, context); + } + + /** + * Deletes the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 accountName, String privateEndpointConnectionName) { + return deleteWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String accountName, + String privateEndpointConnectionName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName, context).block(); + } + + /** + * Deletes the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 accountName, String privateEndpointConnectionName) { + deleteWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateEndpointConnectionsImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 0000000000000..4b35ef4c25ebc --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.storage.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.storage.generated.models.PrivateEndpointConnections; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsImpl.class); + + private final PrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String accountName, + String privateEndpointConnectionName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateEndpointConnection get(String resourceGroupName, String accountName, + String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner + = this.serviceClient().get(resourceGroupName, accountName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String accountName, + String privateEndpointConnectionName, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, context); + } + + public void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, accountName, privateEndpointConnectionName); + } + + public PrivateEndpointConnection 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, Context.NONE); + } + + public Response 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, context); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public PrivateEndpointConnectionImpl define(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateLinkResourceListResultImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateLinkResourceListResultImpl.java new file mode 100644 index 0000000000000..923498723a1ff --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateLinkResourceListResultImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateLinkResourceListResultInner; +import com.azure.resourcemanager.storage.generated.models.PrivateLinkResource; +import com.azure.resourcemanager.storage.generated.models.PrivateLinkResourceListResult; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkResourceListResultImpl implements PrivateLinkResourceListResult { + private PrivateLinkResourceListResultInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + PrivateLinkResourceListResultImpl(PrivateLinkResourceListResultInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateLinkResourceListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateLinkResourcesClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateLinkResourcesClientImpl.java new file mode 100644 index 0000000000000..80b10c2671fc2 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.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.storage.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateLinkResourceListResultInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. + */ +public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { + /** + * The proxy service used to perform REST calls. + */ + private final PrivateLinkResourcesService service; + + /** + * The service client containing this operation class. + */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkResourcesClientImpl(StorageManagementClientImpl client) { + this.service = RestProxy.create(PrivateLinkResourcesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientPrivateLinkResources to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + public interface PrivateLinkResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByStorageAccount(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the private link resources that need to be created for a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 private link resources that need to be created for a storage account along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByStorageAccountWithResponseAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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.listByStorageAccount(this.client.getEndpoint(), resourceGroupName, + accountName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the private link resources that need to be created for a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 private link resources that need to be created for a storage account along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByStorageAccountWithResponseAsync(String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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.listByStorageAccount(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + } + + /** + * Gets the private link resources that need to be created for a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 private link resources that need to be created for a storage account on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByStorageAccountAsync(String resourceGroupName, + String accountName) { + return listByStorageAccountWithResponseAsync(resourceGroupName, accountName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the private link resources that need to be created for a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 private link resources that need to be created for a storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByStorageAccountWithResponse(String resourceGroupName, + String accountName, Context context) { + return listByStorageAccountWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Gets the private link resources that need to be created for a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 private link resources that need to be created for a storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceListResultInner listByStorageAccount(String resourceGroupName, String accountName) { + return listByStorageAccountWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateLinkResourcesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 0000000000000..8a525e0ec699b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateLinkResourceListResultInner; +import com.azure.resourcemanager.storage.generated.models.PrivateLinkResourceListResult; +import com.azure.resourcemanager.storage.generated.models.PrivateLinkResources; + +public final class PrivateLinkResourcesImpl implements PrivateLinkResources { + private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourcesImpl.class); + + private final PrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public PrivateLinkResourcesImpl(PrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listByStorageAccountWithResponse(String resourceGroupName, + String accountName, Context context) { + Response inner + = this.serviceClient().listByStorageAccountWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateLinkResourceListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateLinkResourceListResult listByStorageAccount(String resourceGroupName, String accountName) { + PrivateLinkResourceListResultInner inner + = this.serviceClient().listByStorageAccount(resourceGroupName, accountName); + if (inner != null) { + return new PrivateLinkResourceListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private PrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueueServicePropertiesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueueServicePropertiesImpl.java new file mode 100644 index 0000000000000..93de798a8f224 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueueServicePropertiesImpl.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.QueueServicePropertiesInner; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.azure.resourcemanager.storage.generated.models.QueueServiceProperties; + +public final class QueueServicePropertiesImpl + implements QueueServiceProperties, QueueServiceProperties.Definition, QueueServiceProperties.Update { + private QueueServicePropertiesInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public CorsRules cors() { + return this.innerModel().cors(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public QueueServicePropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + public QueueServicePropertiesImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public QueueServiceProperties create() { + this.innerObject = serviceManager.serviceClient() + .getQueueServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public QueueServiceProperties create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getQueueServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), context) + .getValue(); + return this; + } + + QueueServicePropertiesImpl(com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new QueueServicePropertiesInner(); + this.serviceManager = serviceManager; + } + + public QueueServicePropertiesImpl update() { + return this; + } + + public QueueServiceProperties apply() { + this.innerObject = serviceManager.serviceClient() + .getQueueServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public QueueServiceProperties apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getQueueServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), context) + .getValue(); + return this; + } + + QueueServicePropertiesImpl(QueueServicePropertiesInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + } + + public QueueServiceProperties refresh() { + this.innerObject = serviceManager.serviceClient() + .getQueueServices() + .getServicePropertiesWithResponse(resourceGroupName, accountName, Context.NONE) + .getValue(); + return this; + } + + public QueueServiceProperties refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getQueueServices() + .getServicePropertiesWithResponse(resourceGroupName, accountName, context) + .getValue(); + return this; + } + + public QueueServicePropertiesImpl withCors(CorsRules cors) { + this.innerModel().withCors(cors); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueueServicesClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueueServicesClientImpl.java new file mode 100644 index 0000000000000..b26a4ef2ee5b9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueueServicesClientImpl.java @@ -0,0 +1,521 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.BodyParam; +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.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.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.storage.generated.fluent.QueueServicesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.ListQueueServicesInner; +import com.azure.resourcemanager.storage.generated.fluent.models.QueueServicePropertiesInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in QueueServicesClient. + */ +public final class QueueServicesClientImpl implements QueueServicesClient { + /** + * The proxy service used to perform REST calls. + */ + private final QueueServicesService service; + + /** + * The service client containing this operation class. + */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of QueueServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + QueueServicesClientImpl(StorageManagementClientImpl client) { + this.service + = RestProxy.create(QueueServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientQueueServices to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + public interface QueueServicesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> setServiceProperties(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("queueServiceName") String queueServiceName, + @BodyParam("application/json") QueueServicePropertiesInner parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getServiceProperties(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("queueServiceName") String queueServiceName, @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List all queue services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all queue services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, String accountName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + } + + /** + * List all queue services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String accountName) { + return listWithResponseAsync(resourceGroupName, accountName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List all queue services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, String accountName, + Context context) { + return listWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * List all queue services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ListQueueServicesInner list(String resourceGroupName, String accountName) { + return listWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Queue service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of a storage account’s Queue service along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> setServicePropertiesWithResponseAsync(String resourceGroupName, + String accountName, QueueServicePropertiesInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String queueServiceName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.setServiceProperties(this.client.getEndpoint(), resourceGroupName, + accountName, this.client.getApiVersion(), this.client.getSubscriptionId(), queueServiceName, parameters, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Queue service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @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 properties of a storage account’s Queue service along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> setServicePropertiesWithResponseAsync(String resourceGroupName, + String accountName, QueueServicePropertiesInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String queueServiceName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.setServiceProperties(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), queueServiceName, parameters, accept, + context); + } + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Queue service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of a storage account’s Queue service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setServicePropertiesAsync(String resourceGroupName, String accountName, + QueueServicePropertiesInner parameters) { + return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Queue service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @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 properties of a storage account’s Queue service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response setServicePropertiesWithResponse(String resourceGroupName, + String accountName, QueueServicePropertiesInner parameters, Context context) { + return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Queue service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of a storage account’s Queue service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public QueueServicePropertiesInner setServiceProperties(String resourceGroupName, String accountName, + QueueServicePropertiesInner parameters) { + return setServicePropertiesWithResponse(resourceGroupName, accountName, parameters, Context.NONE).getValue(); + } + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getServicePropertiesWithResponseAsync(String resourceGroupName, + String accountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String queueServiceName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getServiceProperties(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), queueServiceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getServicePropertiesWithResponseAsync(String resourceGroupName, + String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String queueServiceName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getServiceProperties(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), queueServiceName, accept, context); + } + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getServicePropertiesAsync(String resourceGroupName, String accountName) { + return getServicePropertiesWithResponseAsync(resourceGroupName, accountName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getServicePropertiesWithResponse(String resourceGroupName, + String accountName, Context context) { + return getServicePropertiesWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public QueueServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName) { + return getServicePropertiesWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueueServicesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueueServicesImpl.java new file mode 100644 index 0000000000000..6a792b88b0cff --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueueServicesImpl.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.QueueServicesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.ListQueueServicesInner; +import com.azure.resourcemanager.storage.generated.fluent.models.QueueServicePropertiesInner; +import com.azure.resourcemanager.storage.generated.models.ListQueueServices; +import com.azure.resourcemanager.storage.generated.models.QueueServiceProperties; +import com.azure.resourcemanager.storage.generated.models.QueueServices; + +public final class QueueServicesImpl implements QueueServices { + private static final ClientLogger LOGGER = new ClientLogger(QueueServicesImpl.class); + + private final QueueServicesClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public QueueServicesImpl(QueueServicesClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listWithResponse(String resourceGroupName, String accountName, Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ListQueueServicesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ListQueueServices list(String resourceGroupName, String accountName) { + ListQueueServicesInner inner = this.serviceClient().list(resourceGroupName, accountName); + if (inner != null) { + return new ListQueueServicesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getServicePropertiesWithResponse(String resourceGroupName, + String accountName, Context context) { + Response inner + = this.serviceClient().getServicePropertiesWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new QueueServicePropertiesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public QueueServiceProperties getServiceProperties(String resourceGroupName, String accountName) { + QueueServicePropertiesInner inner = this.serviceClient().getServiceProperties(resourceGroupName, accountName); + if (inner != null) { + return new QueueServicePropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public QueueServiceProperties getServicePropertiesById(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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + return this.getServicePropertiesWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } + + public Response getServicePropertiesByIdWithResponse(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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + return this.getServicePropertiesWithResponse(resourceGroupName, accountName, context); + } + + private QueueServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public QueueServicePropertiesImpl define() { + return new QueueServicePropertiesImpl(this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueuesClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueuesClientImpl.java new file mode 100644 index 0000000000000..5a9304d1744db --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueuesClientImpl.java @@ -0,0 +1,1005 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.QueuesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.ListQueueInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageQueueInner; +import com.azure.resourcemanager.storage.generated.models.ListQueueResource; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in QueuesClient. + */ +public final class QueuesClientImpl implements QueuesClient { + /** + * The proxy service used to perform REST calls. + */ + private final QueuesService service; + + /** + * The service client containing this operation class. + */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of QueuesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + QueuesClientImpl(StorageManagementClientImpl client) { + this.service = RestProxy.create(QueuesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientQueues to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + public interface QueuesService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("queueName") String queueName, @BodyParam("application/json") StorageQueueInner queue, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("queueName") String queueName, @BodyParam("application/json") StorageQueueInner queue, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("queueName") String queueName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("queueName") String queueName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$maxpagesize") String maxpagesize, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param queue Queue properties and metadata to be created with. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, String accountName, + String queueName, StorageQueueInner queue) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (queue == null) { + return Mono.error(new IllegalArgumentException("Parameter queue is required and cannot be null.")); + } else { + queue.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), queueName, queue, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param queue Queue properties and metadata to be created with. + * @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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, String accountName, + String queueName, StorageQueueInner queue, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (queue == null) { + return Mono.error(new IllegalArgumentException("Parameter queue is required and cannot be null.")); + } else { + queue.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), queueName, queue, accept, context); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param queue Queue properties and metadata to be created with. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String accountName, String queueName, + StorageQueueInner queue) { + return createWithResponseAsync(resourceGroupName, accountName, queueName, queue) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param queue Queue properties and metadata to be created with. + * @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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse(String resourceGroupName, String accountName, + String queueName, StorageQueueInner queue, Context context) { + return createWithResponseAsync(resourceGroupName, accountName, queueName, queue, context).block(); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param queue Queue properties and metadata to be created with. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageQueueInner create(String resourceGroupName, String accountName, String queueName, + StorageQueueInner queue) { + return createWithResponse(resourceGroupName, accountName, queueName, queue, Context.NONE).getValue(); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param queue Queue properties and metadata to be created with. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String accountName, + String queueName, StorageQueueInner queue) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (queue == null) { + return Mono.error(new IllegalArgumentException("Parameter queue is required and cannot be null.")); + } else { + queue.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), queueName, queue, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param queue Queue properties and metadata to be created with. + * @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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String accountName, + String queueName, StorageQueueInner queue, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + if (queue == null) { + return Mono.error(new IllegalArgumentException("Parameter queue is required and cannot be null.")); + } else { + queue.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), queueName, queue, accept, context); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param queue Queue properties and metadata to be created with. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String accountName, String queueName, + StorageQueueInner queue) { + return updateWithResponseAsync(resourceGroupName, accountName, queueName, queue) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param queue Queue properties and metadata to be created with. + * @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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String accountName, + String queueName, StorageQueueInner queue, Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, queueName, queue, context).block(); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param queue Queue properties and metadata to be created with. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageQueueInner update(String resourceGroupName, String accountName, String queueName, + StorageQueueInner queue) { + return updateWithResponse(resourceGroupName, accountName, queueName, queue, Context.NONE).getValue(); + } + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 queue with the specified queue name, under the specified account if it exists along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String queueName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), queueName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @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 queue with the specified queue name, under the specified account if it exists along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String queueName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), queueName, accept, context); + } + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 queue with the specified queue name, under the specified account if it exists on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String queueName) { + return getWithResponseAsync(resourceGroupName, accountName, queueName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @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 queue with the specified queue name, under the specified account if it exists along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, String queueName, + Context context) { + return getWithResponseAsync(resourceGroupName, accountName, queueName, context).block(); + } + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 queue with the specified queue name, under the specified account if it exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageQueueInner get(String resourceGroupName, String accountName, String queueName) { + return getWithResponse(resourceGroupName, accountName, queueName, Context.NONE).getValue(); + } + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 accountName, + String queueName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), queueName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @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 accountName, String queueName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (queueName == null) { + return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), queueName, accept, context); + } + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 accountName, String queueName) { + return deleteWithResponseAsync(resourceGroupName, accountName, queueName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String accountName, String queueName, + Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, queueName, context).block(); + } + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String queueName) { + deleteWithResponse(resourceGroupName, accountName, queueName, Context.NONE); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response. + * @param filter Optional, When specified, only the queues with a name starting with the given filter will be + * listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 all the queues under the specified storage account along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName, + String maxpagesize, String filter) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), maxpagesize, filter, 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())); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response. + * @param filter Optional, When specified, only the queues with a name starting with the given filter will be + * listed. + * @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 all the queues under the specified storage account along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName, + String maxpagesize, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), maxpagesize, filter, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response. + * @param filter Optional, When specified, only the queues with a name starting with the given filter will be + * listed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 all the queues under the specified storage account as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, String maxpagesize, + String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 all the queues under the specified storage account as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + final String maxpagesize = null; + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response. + * @param filter Optional, When specified, only the queues with a name starting with the given filter will be + * listed. + * @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 all the queues under the specified storage account as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, String maxpagesize, + String filter, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 all the queues under the specified storage account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + final String maxpagesize = null; + final String filter = null; + return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter)); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response. + * @param filter Optional, When specified, only the queues with a name starting with the given filter will be + * listed. + * @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 all the queues under the specified storage account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, String maxpagesize, + String filter, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter, 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 response schema 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 response schema 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/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueuesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueuesImpl.java new file mode 100644 index 0000000000000..e5254fc6a4b6c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueuesImpl.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.QueuesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.ListQueueInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageQueueInner; +import com.azure.resourcemanager.storage.generated.models.ListQueue; +import com.azure.resourcemanager.storage.generated.models.Queues; +import com.azure.resourcemanager.storage.generated.models.StorageQueue; + +public final class QueuesImpl implements Queues { + private static final ClientLogger LOGGER = new ClientLogger(QueuesImpl.class); + + private final QueuesClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public QueuesImpl(QueuesClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String accountName, String queueName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, accountName, queueName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new StorageQueueImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public StorageQueue get(String resourceGroupName, String accountName, String queueName) { + StorageQueueInner inner = this.serviceClient().get(resourceGroupName, accountName, queueName); + if (inner != null) { + return new StorageQueueImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String accountName, String queueName, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, queueName, context); + } + + public void delete(String resourceGroupName, String accountName, String queueName) { + this.serviceClient().delete(resourceGroupName, accountName, queueName); + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ListQueueImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, String maxpagesize, + String filter, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName, maxpagesize, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ListQueueImpl(inner1, this.manager())); + } + + public StorageQueue 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String queueName = ResourceManagerUtils.getValueFromIdByName(id, "queues"); + if (queueName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'queues'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, queueName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String queueName = ResourceManagerUtils.getValueFromIdByName(id, "queues"); + if (queueName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'queues'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, queueName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String queueName = ResourceManagerUtils.getValueFromIdByName(id, "queues"); + if (queueName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'queues'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, queueName, Context.NONE); + } + + public Response 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String queueName = ResourceManagerUtils.getValueFromIdByName(id, "queues"); + if (queueName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'queues'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, queueName, context); + } + + private QueuesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public StorageQueueImpl define(String name) { + return new StorageQueueImpl(name, this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ResourceManagerUtils.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ResourceManagerUtils.java new file mode 100644 index 0000000000000..b7c33ae55a71f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ResourceManagerUtils.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/SkuInformationImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/SkuInformationImpl.java new file mode 100644 index 0000000000000..84e95263efd82 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/SkuInformationImpl.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.SkuInformationInner; +import com.azure.resourcemanager.storage.generated.models.Kind; +import com.azure.resourcemanager.storage.generated.models.Restriction; +import com.azure.resourcemanager.storage.generated.models.SkuCapability; +import com.azure.resourcemanager.storage.generated.models.SkuInformation; +import com.azure.resourcemanager.storage.generated.models.SkuName; +import com.azure.resourcemanager.storage.generated.models.SkuTier; +import java.util.Collections; +import java.util.List; + +public final class SkuInformationImpl implements SkuInformation { + private SkuInformationInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + SkuInformationImpl(SkuInformationInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public SkuName name() { + return this.innerModel().name(); + } + + public SkuTier tier() { + return this.innerModel().tier(); + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public Kind kind() { + return this.innerModel().kind(); + } + + public List locations() { + List inner = this.innerModel().locations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List capabilities() { + List inner = this.innerModel().capabilities(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List restrictions() { + List inner = this.innerModel().restrictions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SkuInformationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/SkusClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/SkusClientImpl.java new file mode 100644 index 0000000000000..35acd89a6b479 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/SkusClientImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.SkusClient; +import com.azure.resourcemanager.storage.generated.fluent.models.SkuInformationInner; +import com.azure.resourcemanager.storage.generated.models.StorageSkuListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SkusClient. + */ +public final class SkusClientImpl implements SkusClient { + /** + * The proxy service used to perform REST calls. + */ + private final SkusService service; + + /** + * The service client containing this operation class. + */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of SkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SkusClientImpl(StorageManagementClientImpl client) { + this.service = RestProxy.create(SkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientSkus to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + public interface SkusService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @throws 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 from the List Storage SKUs 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(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @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 from the List Storage SKUs 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(), null, null)); + } + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @throws 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 from the List Storage SKUs operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync()); + } + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @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 from the List Storage SKUs operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context)); + } + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @throws 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 from the List Storage SKUs operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @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 from the List Storage SKUs operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/SkusImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/SkusImpl.java new file mode 100644 index 0000000000000..321bcba081fc9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/SkusImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.SkusClient; +import com.azure.resourcemanager.storage.generated.fluent.models.SkuInformationInner; +import com.azure.resourcemanager.storage.generated.models.SkuInformation; +import com.azure.resourcemanager.storage.generated.models.Skus; + +public final class SkusImpl implements Skus { + private static final ClientLogger LOGGER = new ClientLogger(SkusImpl.class); + + private final SkusClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public SkusImpl(SkusClient innerClient, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SkuInformationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SkuInformationImpl(inner1, this.manager())); + } + + private SkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountImpl.java new file mode 100644 index 0000000000000..bc88a48e201bb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountImpl.java @@ -0,0 +1,744 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobRestoreStatusInner; +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountMigrationInner; +import com.azure.resourcemanager.storage.generated.models.AccessTier; +import com.azure.resourcemanager.storage.generated.models.AccountSasParameters; +import com.azure.resourcemanager.storage.generated.models.AccountStatus; +import com.azure.resourcemanager.storage.generated.models.AllowedCopyScope; +import com.azure.resourcemanager.storage.generated.models.AzureFilesIdentityBasedAuthentication; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreParameters; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreStatus; +import com.azure.resourcemanager.storage.generated.models.CustomDomain; +import com.azure.resourcemanager.storage.generated.models.DnsEndpointType; +import com.azure.resourcemanager.storage.generated.models.Encryption; +import com.azure.resourcemanager.storage.generated.models.Endpoints; +import com.azure.resourcemanager.storage.generated.models.ExtendedLocation; +import com.azure.resourcemanager.storage.generated.models.FailoverType; +import com.azure.resourcemanager.storage.generated.models.GeoReplicationStats; +import com.azure.resourcemanager.storage.generated.models.Identity; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageAccount; +import com.azure.resourcemanager.storage.generated.models.KeyCreationTime; +import com.azure.resourcemanager.storage.generated.models.KeyPolicy; +import com.azure.resourcemanager.storage.generated.models.Kind; +import com.azure.resourcemanager.storage.generated.models.LargeFileSharesState; +import com.azure.resourcemanager.storage.generated.models.ListAccountSasResponse; +import com.azure.resourcemanager.storage.generated.models.ListKeyExpand; +import com.azure.resourcemanager.storage.generated.models.ListServiceSasResponse; +import com.azure.resourcemanager.storage.generated.models.MinimumTlsVersion; +import com.azure.resourcemanager.storage.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.storage.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.storage.generated.models.ProvisioningState; +import com.azure.resourcemanager.storage.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.storage.generated.models.RoutingPreference; +import com.azure.resourcemanager.storage.generated.models.SasPolicy; +import com.azure.resourcemanager.storage.generated.models.ServiceSasParameters; +import com.azure.resourcemanager.storage.generated.models.Sku; +import com.azure.resourcemanager.storage.generated.models.StorageAccount; +import com.azure.resourcemanager.storage.generated.models.StorageAccountCreateParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccountExpand; +import com.azure.resourcemanager.storage.generated.models.StorageAccountListKeysResult; +import com.azure.resourcemanager.storage.generated.models.StorageAccountRegenerateKeyParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccountSkuConversionStatus; +import com.azure.resourcemanager.storage.generated.models.StorageAccountUpdateParameters; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class StorageAccountImpl implements StorageAccount, StorageAccount.Definition, StorageAccount.Update { + private StorageAccountInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager 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 Sku sku() { + return this.innerModel().sku(); + } + + public Kind kind() { + return this.innerModel().kind(); + } + + public Identity identity() { + return this.innerModel().identity(); + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Endpoints primaryEndpoints() { + return this.innerModel().primaryEndpoints(); + } + + public String primaryLocation() { + return this.innerModel().primaryLocation(); + } + + public AccountStatus statusOfPrimary() { + return this.innerModel().statusOfPrimary(); + } + + public OffsetDateTime lastGeoFailoverTime() { + return this.innerModel().lastGeoFailoverTime(); + } + + public String secondaryLocation() { + return this.innerModel().secondaryLocation(); + } + + public AccountStatus statusOfSecondary() { + return this.innerModel().statusOfSecondary(); + } + + public OffsetDateTime creationTime() { + return this.innerModel().creationTime(); + } + + public CustomDomain customDomain() { + return this.innerModel().customDomain(); + } + + public SasPolicy sasPolicy() { + return this.innerModel().sasPolicy(); + } + + public KeyPolicy keyPolicy() { + return this.innerModel().keyPolicy(); + } + + public KeyCreationTime keyCreationTime() { + return this.innerModel().keyCreationTime(); + } + + public Endpoints secondaryEndpoints() { + return this.innerModel().secondaryEndpoints(); + } + + public Encryption encryption() { + return this.innerModel().encryption(); + } + + public AccessTier accessTier() { + return this.innerModel().accessTier(); + } + + public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { + return this.innerModel().azureFilesIdentityBasedAuthentication(); + } + + public Boolean enableHttpsTrafficOnly() { + return this.innerModel().enableHttpsTrafficOnly(); + } + + public NetworkRuleSet networkRuleSet() { + return this.innerModel().networkRuleSet(); + } + + public Boolean isSftpEnabled() { + return this.innerModel().isSftpEnabled(); + } + + public Boolean isLocalUserEnabled() { + return this.innerModel().isLocalUserEnabled(); + } + + public Boolean enableExtendedGroups() { + return this.innerModel().enableExtendedGroups(); + } + + public Boolean isHnsEnabled() { + return this.innerModel().isHnsEnabled(); + } + + public GeoReplicationStats geoReplicationStats() { + return this.innerModel().geoReplicationStats(); + } + + public Boolean failoverInProgress() { + return this.innerModel().failoverInProgress(); + } + + public LargeFileSharesState largeFileSharesState() { + return this.innerModel().largeFileSharesState(); + } + + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public RoutingPreference routingPreference() { + return this.innerModel().routingPreference(); + } + + public BlobRestoreStatus blobRestoreStatus() { + BlobRestoreStatusInner inner = this.innerModel().blobRestoreStatus(); + if (inner != null) { + return new BlobRestoreStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public Boolean allowBlobPublicAccess() { + return this.innerModel().allowBlobPublicAccess(); + } + + public MinimumTlsVersion minimumTlsVersion() { + return this.innerModel().minimumTlsVersion(); + } + + public Boolean allowSharedKeyAccess() { + return this.innerModel().allowSharedKeyAccess(); + } + + public Boolean enableNfsV3() { + return this.innerModel().enableNfsV3(); + } + + public Boolean allowCrossTenantReplication() { + return this.innerModel().allowCrossTenantReplication(); + } + + public Boolean defaultToOAuthAuthentication() { + return this.innerModel().defaultToOAuthAuthentication(); + } + + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public ImmutableStorageAccount immutableStorageWithVersioning() { + return this.innerModel().immutableStorageWithVersioning(); + } + + public AllowedCopyScope allowedCopyScope() { + return this.innerModel().allowedCopyScope(); + } + + public StorageAccountSkuConversionStatus storageAccountSkuConversionStatus() { + return this.innerModel().storageAccountSkuConversionStatus(); + } + + public DnsEndpointType dnsEndpointType() { + return this.innerModel().dnsEndpointType(); + } + + public Boolean isSkuConversionBlocked() { + return this.innerModel().isSkuConversionBlocked(); + } + + public Boolean accountMigrationInProgress() { + return this.innerModel().accountMigrationInProgress(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public StorageAccountInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private StorageAccountCreateParameters createParameters; + + private StorageAccountUpdateParameters updateParameters; + + public StorageAccountImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public StorageAccount create() { + this.innerObject = serviceManager.serviceClient() + .getStorageAccounts() + .create(resourceGroupName, accountName, createParameters, Context.NONE); + return this; + } + + public StorageAccount create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getStorageAccounts() + .create(resourceGroupName, accountName, createParameters, context); + return this; + } + + StorageAccountImpl(String name, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new StorageAccountInner(); + this.serviceManager = serviceManager; + this.accountName = name; + this.createParameters = new StorageAccountCreateParameters(); + } + + public StorageAccountImpl update() { + this.updateParameters = new StorageAccountUpdateParameters(); + return this; + } + + public StorageAccount apply() { + this.innerObject = serviceManager.serviceClient() + .getStorageAccounts() + .updateWithResponse(resourceGroupName, accountName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public StorageAccount apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getStorageAccounts() + .updateWithResponse(resourceGroupName, accountName, updateParameters, context) + .getValue(); + return this; + } + + StorageAccountImpl(StorageAccountInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + } + + public StorageAccount refresh() { + StorageAccountExpand localExpand = null; + this.innerObject = serviceManager.serviceClient() + .getStorageAccounts() + .getByResourceGroupWithResponse(resourceGroupName, accountName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public StorageAccount refresh(Context context) { + StorageAccountExpand localExpand = null; + this.innerObject = serviceManager.serviceClient() + .getStorageAccounts() + .getByResourceGroupWithResponse(resourceGroupName, accountName, localExpand, context) + .getValue(); + return this; + } + + public Response listKeysWithResponse(ListKeyExpand expand, Context context) { + return serviceManager.storageAccounts().listKeysWithResponse(resourceGroupName, accountName, expand, context); + } + + public StorageAccountListKeysResult listKeys() { + return serviceManager.storageAccounts().listKeys(resourceGroupName, accountName); + } + + public Response + regenerateKeyWithResponse(StorageAccountRegenerateKeyParameters regenerateKey, Context context) { + return serviceManager.storageAccounts() + .regenerateKeyWithResponse(resourceGroupName, accountName, regenerateKey, context); + } + + public StorageAccountListKeysResult regenerateKey(StorageAccountRegenerateKeyParameters regenerateKey) { + return serviceManager.storageAccounts().regenerateKey(resourceGroupName, accountName, regenerateKey); + } + + public Response listAccountSasWithResponse(AccountSasParameters parameters, + Context context) { + return serviceManager.storageAccounts() + .listAccountSasWithResponse(resourceGroupName, accountName, parameters, context); + } + + public ListAccountSasResponse listAccountSas(AccountSasParameters parameters) { + return serviceManager.storageAccounts().listAccountSas(resourceGroupName, accountName, parameters); + } + + public Response listServiceSasWithResponse(ServiceSasParameters parameters, + Context context) { + return serviceManager.storageAccounts() + .listServiceSasWithResponse(resourceGroupName, accountName, parameters, context); + } + + public ListServiceSasResponse listServiceSas(ServiceSasParameters parameters) { + return serviceManager.storageAccounts().listServiceSas(resourceGroupName, accountName, parameters); + } + + public void failover() { + serviceManager.storageAccounts().failover(resourceGroupName, accountName); + } + + public void failover(FailoverType failoverType, Context context) { + serviceManager.storageAccounts().failover(resourceGroupName, accountName, failoverType, context); + } + + public void customerInitiatedMigration(StorageAccountMigrationInner parameters) { + serviceManager.storageAccounts().customerInitiatedMigration(resourceGroupName, accountName, parameters); + } + + public void customerInitiatedMigration(StorageAccountMigrationInner parameters, Context context) { + serviceManager.storageAccounts() + .customerInitiatedMigration(resourceGroupName, accountName, parameters, context); + } + + public BlobRestoreStatus restoreBlobRanges(BlobRestoreParameters parameters) { + return serviceManager.storageAccounts().restoreBlobRanges(resourceGroupName, accountName, parameters); + } + + public BlobRestoreStatus restoreBlobRanges(BlobRestoreParameters parameters, Context context) { + return serviceManager.storageAccounts().restoreBlobRanges(resourceGroupName, accountName, parameters, context); + } + + public Response revokeUserDelegationKeysWithResponse(Context context) { + return serviceManager.storageAccounts() + .revokeUserDelegationKeysWithResponse(resourceGroupName, accountName, context); + } + + public void revokeUserDelegationKeys() { + serviceManager.storageAccounts().revokeUserDelegationKeys(resourceGroupName, accountName); + } + + public StorageAccountImpl withRegion(Region location) { + this.createParameters.withLocation(location.toString()); + return this; + } + + public StorageAccountImpl withRegion(String location) { + this.createParameters.withLocation(location); + return this; + } + + public StorageAccountImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.createParameters.withSku(sku); + return this; + } else { + this.updateParameters.withSku(sku); + return this; + } + } + + public StorageAccountImpl withKind(Kind kind) { + if (isInCreateMode()) { + this.createParameters.withKind(kind); + return this; + } else { + this.updateParameters.withKind(kind); + return this; + } + } + + public StorageAccountImpl withTags(Map tags) { + if (isInCreateMode()) { + this.createParameters.withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public StorageAccountImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.createParameters.withExtendedLocation(extendedLocation); + return this; + } + + public StorageAccountImpl withIdentity(Identity identity) { + if (isInCreateMode()) { + this.createParameters.withIdentity(identity); + return this; + } else { + this.updateParameters.withIdentity(identity); + return this; + } + } + + public StorageAccountImpl withAllowedCopyScope(AllowedCopyScope allowedCopyScope) { + if (isInCreateMode()) { + this.createParameters.withAllowedCopyScope(allowedCopyScope); + return this; + } else { + this.updateParameters.withAllowedCopyScope(allowedCopyScope); + return this; + } + } + + public StorageAccountImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (isInCreateMode()) { + this.createParameters.withPublicNetworkAccess(publicNetworkAccess); + return this; + } else { + this.updateParameters.withPublicNetworkAccess(publicNetworkAccess); + return this; + } + } + + public StorageAccountImpl withSasPolicy(SasPolicy sasPolicy) { + if (isInCreateMode()) { + this.createParameters.withSasPolicy(sasPolicy); + return this; + } else { + this.updateParameters.withSasPolicy(sasPolicy); + return this; + } + } + + public StorageAccountImpl withKeyPolicy(KeyPolicy keyPolicy) { + if (isInCreateMode()) { + this.createParameters.withKeyPolicy(keyPolicy); + return this; + } else { + this.updateParameters.withKeyPolicy(keyPolicy); + return this; + } + } + + public StorageAccountImpl withCustomDomain(CustomDomain customDomain) { + if (isInCreateMode()) { + this.createParameters.withCustomDomain(customDomain); + return this; + } else { + this.updateParameters.withCustomDomain(customDomain); + return this; + } + } + + public StorageAccountImpl withEncryption(Encryption encryption) { + if (isInCreateMode()) { + this.createParameters.withEncryption(encryption); + return this; + } else { + this.updateParameters.withEncryption(encryption); + return this; + } + } + + public StorageAccountImpl withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + if (isInCreateMode()) { + this.createParameters.withNetworkRuleSet(networkRuleSet); + return this; + } else { + this.updateParameters.withNetworkRuleSet(networkRuleSet); + return this; + } + } + + public StorageAccountImpl withAccessTier(AccessTier accessTier) { + if (isInCreateMode()) { + this.createParameters.withAccessTier(accessTier); + return this; + } else { + this.updateParameters.withAccessTier(accessTier); + return this; + } + } + + public StorageAccountImpl withAzureFilesIdentityBasedAuthentication( + AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { + if (isInCreateMode()) { + this.createParameters.withAzureFilesIdentityBasedAuthentication(azureFilesIdentityBasedAuthentication); + return this; + } else { + this.updateParameters.withAzureFilesIdentityBasedAuthentication(azureFilesIdentityBasedAuthentication); + return this; + } + } + + public StorageAccountImpl withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + if (isInCreateMode()) { + this.createParameters.withEnableHttpsTrafficOnly(enableHttpsTrafficOnly); + return this; + } else { + this.updateParameters.withEnableHttpsTrafficOnly(enableHttpsTrafficOnly); + return this; + } + } + + public StorageAccountImpl withIsSftpEnabled(Boolean isSftpEnabled) { + if (isInCreateMode()) { + this.createParameters.withIsSftpEnabled(isSftpEnabled); + return this; + } else { + this.updateParameters.withIsSftpEnabled(isSftpEnabled); + return this; + } + } + + public StorageAccountImpl withIsLocalUserEnabled(Boolean isLocalUserEnabled) { + if (isInCreateMode()) { + this.createParameters.withIsLocalUserEnabled(isLocalUserEnabled); + return this; + } else { + this.updateParameters.withIsLocalUserEnabled(isLocalUserEnabled); + return this; + } + } + + public StorageAccountImpl withEnableExtendedGroups(Boolean enableExtendedGroups) { + if (isInCreateMode()) { + this.createParameters.withEnableExtendedGroups(enableExtendedGroups); + return this; + } else { + this.updateParameters.withEnableExtendedGroups(enableExtendedGroups); + return this; + } + } + + public StorageAccountImpl withIsHnsEnabled(Boolean isHnsEnabled) { + this.createParameters.withIsHnsEnabled(isHnsEnabled); + return this; + } + + public StorageAccountImpl withLargeFileSharesState(LargeFileSharesState largeFileSharesState) { + if (isInCreateMode()) { + this.createParameters.withLargeFileSharesState(largeFileSharesState); + return this; + } else { + this.updateParameters.withLargeFileSharesState(largeFileSharesState); + return this; + } + } + + public StorageAccountImpl withRoutingPreference(RoutingPreference routingPreference) { + if (isInCreateMode()) { + this.createParameters.withRoutingPreference(routingPreference); + return this; + } else { + this.updateParameters.withRoutingPreference(routingPreference); + return this; + } + } + + public StorageAccountImpl withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + if (isInCreateMode()) { + this.createParameters.withAllowBlobPublicAccess(allowBlobPublicAccess); + return this; + } else { + this.updateParameters.withAllowBlobPublicAccess(allowBlobPublicAccess); + return this; + } + } + + public StorageAccountImpl withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + if (isInCreateMode()) { + this.createParameters.withMinimumTlsVersion(minimumTlsVersion); + return this; + } else { + this.updateParameters.withMinimumTlsVersion(minimumTlsVersion); + return this; + } + } + + public StorageAccountImpl withAllowSharedKeyAccess(Boolean allowSharedKeyAccess) { + if (isInCreateMode()) { + this.createParameters.withAllowSharedKeyAccess(allowSharedKeyAccess); + return this; + } else { + this.updateParameters.withAllowSharedKeyAccess(allowSharedKeyAccess); + return this; + } + } + + public StorageAccountImpl withEnableNfsV3(Boolean enableNfsV3) { + this.createParameters.withEnableNfsV3(enableNfsV3); + return this; + } + + public StorageAccountImpl withAllowCrossTenantReplication(Boolean allowCrossTenantReplication) { + if (isInCreateMode()) { + this.createParameters.withAllowCrossTenantReplication(allowCrossTenantReplication); + return this; + } else { + this.updateParameters.withAllowCrossTenantReplication(allowCrossTenantReplication); + return this; + } + } + + public StorageAccountImpl withDefaultToOAuthAuthentication(Boolean defaultToOAuthAuthentication) { + if (isInCreateMode()) { + this.createParameters.withDefaultToOAuthAuthentication(defaultToOAuthAuthentication); + return this; + } else { + this.updateParameters.withDefaultToOAuthAuthentication(defaultToOAuthAuthentication); + return this; + } + } + + public StorageAccountImpl + withImmutableStorageWithVersioning(ImmutableStorageAccount immutableStorageWithVersioning) { + if (isInCreateMode()) { + this.createParameters.withImmutableStorageWithVersioning(immutableStorageWithVersioning); + return this; + } else { + this.updateParameters.withImmutableStorageWithVersioning(immutableStorageWithVersioning); + return this; + } + } + + public StorageAccountImpl withDnsEndpointType(DnsEndpointType dnsEndpointType) { + if (isInCreateMode()) { + this.createParameters.withDnsEndpointType(dnsEndpointType); + return this; + } else { + this.updateParameters.withDnsEndpointType(dnsEndpointType); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountListKeysResultImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountListKeysResultImpl.java new file mode 100644 index 0000000000000..7861c20e9ed90 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountListKeysResultImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountListKeysResultInner; +import com.azure.resourcemanager.storage.generated.models.StorageAccountKey; +import com.azure.resourcemanager.storage.generated.models.StorageAccountListKeysResult; +import java.util.Collections; +import java.util.List; + +public final class StorageAccountListKeysResultImpl implements StorageAccountListKeysResult { + private StorageAccountListKeysResultInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + StorageAccountListKeysResultImpl(StorageAccountListKeysResultInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List keys() { + List inner = this.innerModel().keys(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public StorageAccountListKeysResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountMigrationImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountMigrationImpl.java new file mode 100644 index 0000000000000..970bd3b7728e7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountMigrationImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountMigrationInner; +import com.azure.resourcemanager.storage.generated.models.MigrationStatus; +import com.azure.resourcemanager.storage.generated.models.SkuName; +import com.azure.resourcemanager.storage.generated.models.StorageAccountMigration; + +public final class StorageAccountMigrationImpl implements StorageAccountMigration { + private StorageAccountMigrationInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + StorageAccountMigrationImpl(StorageAccountMigrationInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SkuName targetSkuName() { + return this.innerModel().targetSkuName(); + } + + public MigrationStatus migrationStatus() { + return this.innerModel().migrationStatus(); + } + + public String migrationFailedReason() { + return this.innerModel().migrationFailedReason(); + } + + public String migrationFailedDetailedReason() { + return this.innerModel().migrationFailedDetailedReason(); + } + + public StorageAccountMigrationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountPropertiesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountPropertiesImpl.java new file mode 100644 index 0000000000000..e1b1b2133ee21 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountPropertiesImpl.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.BlobRestoreStatusInner; +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountPropertiesInner; +import com.azure.resourcemanager.storage.generated.models.AccessTier; +import com.azure.resourcemanager.storage.generated.models.AccountStatus; +import com.azure.resourcemanager.storage.generated.models.AllowedCopyScope; +import com.azure.resourcemanager.storage.generated.models.AzureFilesIdentityBasedAuthentication; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreStatus; +import com.azure.resourcemanager.storage.generated.models.CustomDomain; +import com.azure.resourcemanager.storage.generated.models.DnsEndpointType; +import com.azure.resourcemanager.storage.generated.models.Encryption; +import com.azure.resourcemanager.storage.generated.models.Endpoints; +import com.azure.resourcemanager.storage.generated.models.GeoReplicationStats; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageAccount; +import com.azure.resourcemanager.storage.generated.models.KeyCreationTime; +import com.azure.resourcemanager.storage.generated.models.KeyPolicy; +import com.azure.resourcemanager.storage.generated.models.LargeFileSharesState; +import com.azure.resourcemanager.storage.generated.models.MinimumTlsVersion; +import com.azure.resourcemanager.storage.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.storage.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.storage.generated.models.ProvisioningState; +import com.azure.resourcemanager.storage.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.storage.generated.models.RoutingPreference; +import com.azure.resourcemanager.storage.generated.models.SasPolicy; +import com.azure.resourcemanager.storage.generated.models.StorageAccountProperties; +import com.azure.resourcemanager.storage.generated.models.StorageAccountSkuConversionStatus; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class StorageAccountPropertiesImpl implements StorageAccountProperties { + private StorageAccountPropertiesInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + StorageAccountPropertiesImpl(StorageAccountPropertiesInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Endpoints primaryEndpoints() { + return this.innerModel().primaryEndpoints(); + } + + public String primaryLocation() { + return this.innerModel().primaryLocation(); + } + + public AccountStatus statusOfPrimary() { + return this.innerModel().statusOfPrimary(); + } + + public OffsetDateTime lastGeoFailoverTime() { + return this.innerModel().lastGeoFailoverTime(); + } + + public String secondaryLocation() { + return this.innerModel().secondaryLocation(); + } + + public AccountStatus statusOfSecondary() { + return this.innerModel().statusOfSecondary(); + } + + public OffsetDateTime creationTime() { + return this.innerModel().creationTime(); + } + + public CustomDomain customDomain() { + return this.innerModel().customDomain(); + } + + public SasPolicy sasPolicy() { + return this.innerModel().sasPolicy(); + } + + public KeyPolicy keyPolicy() { + return this.innerModel().keyPolicy(); + } + + public KeyCreationTime keyCreationTime() { + return this.innerModel().keyCreationTime(); + } + + public Endpoints secondaryEndpoints() { + return this.innerModel().secondaryEndpoints(); + } + + public Encryption encryption() { + return this.innerModel().encryption(); + } + + public AccessTier accessTier() { + return this.innerModel().accessTier(); + } + + public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { + return this.innerModel().azureFilesIdentityBasedAuthentication(); + } + + public Boolean enableHttpsTrafficOnly() { + return this.innerModel().enableHttpsTrafficOnly(); + } + + public NetworkRuleSet networkRuleSet() { + return this.innerModel().networkRuleSet(); + } + + public Boolean isSftpEnabled() { + return this.innerModel().isSftpEnabled(); + } + + public Boolean isLocalUserEnabled() { + return this.innerModel().isLocalUserEnabled(); + } + + public Boolean enableExtendedGroups() { + return this.innerModel().enableExtendedGroups(); + } + + public Boolean isHnsEnabled() { + return this.innerModel().isHnsEnabled(); + } + + public GeoReplicationStats geoReplicationStats() { + return this.innerModel().geoReplicationStats(); + } + + public Boolean failoverInProgress() { + return this.innerModel().failoverInProgress(); + } + + public LargeFileSharesState largeFileSharesState() { + return this.innerModel().largeFileSharesState(); + } + + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public RoutingPreference routingPreference() { + return this.innerModel().routingPreference(); + } + + public BlobRestoreStatus blobRestoreStatus() { + BlobRestoreStatusInner inner = this.innerModel().blobRestoreStatus(); + if (inner != null) { + return new BlobRestoreStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public Boolean allowBlobPublicAccess() { + return this.innerModel().allowBlobPublicAccess(); + } + + public MinimumTlsVersion minimumTlsVersion() { + return this.innerModel().minimumTlsVersion(); + } + + public Boolean allowSharedKeyAccess() { + return this.innerModel().allowSharedKeyAccess(); + } + + public Boolean enableNfsV3() { + return this.innerModel().enableNfsV3(); + } + + public Boolean allowCrossTenantReplication() { + return this.innerModel().allowCrossTenantReplication(); + } + + public Boolean defaultToOAuthAuthentication() { + return this.innerModel().defaultToOAuthAuthentication(); + } + + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public ImmutableStorageAccount immutableStorageWithVersioning() { + return this.innerModel().immutableStorageWithVersioning(); + } + + public AllowedCopyScope allowedCopyScope() { + return this.innerModel().allowedCopyScope(); + } + + public StorageAccountSkuConversionStatus storageAccountSkuConversionStatus() { + return this.innerModel().storageAccountSkuConversionStatus(); + } + + public DnsEndpointType dnsEndpointType() { + return this.innerModel().dnsEndpointType(); + } + + public Boolean isSkuConversionBlocked() { + return this.innerModel().isSkuConversionBlocked(); + } + + public Boolean accountMigrationInProgress() { + return this.innerModel().accountMigrationInProgress(); + } + + public StorageAccountPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountsClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountsClientImpl.java new file mode 100644 index 0000000000000..75a6c41e19d01 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountsClientImpl.java @@ -0,0 +1,3711 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.storage.generated.fluent.StorageAccountsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobRestoreStatusInner; +import com.azure.resourcemanager.storage.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.storage.generated.fluent.models.ListAccountSasResponseInner; +import com.azure.resourcemanager.storage.generated.fluent.models.ListServiceSasResponseInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountListKeysResultInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountMigrationInner; +import com.azure.resourcemanager.storage.generated.models.AccountSasParameters; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreParameters; +import com.azure.resourcemanager.storage.generated.models.FailoverType; +import com.azure.resourcemanager.storage.generated.models.ListKeyExpand; +import com.azure.resourcemanager.storage.generated.models.MigrationName; +import com.azure.resourcemanager.storage.generated.models.ServiceSasParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccountCheckNameAvailabilityParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccountCreateParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccountExpand; +import com.azure.resourcemanager.storage.generated.models.StorageAccountListResult; +import com.azure.resourcemanager.storage.generated.models.StorageAccountRegenerateKeyParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccountUpdateParameters; +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 StorageAccountsClient. + */ +public final class StorageAccountsClientImpl implements StorageAccountsClient { + /** + * The proxy service used to perform REST calls. + */ + private final StorageAccountsService service; + + /** + * The service client containing this operation class. + */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of StorageAccountsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + StorageAccountsClientImpl(StorageManagementClientImpl client) { + this.service + = RestProxy.create(StorageAccountsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientStorageAccounts to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + public interface StorageAccountsService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") StorageAccountCheckNameAvailabilityParameters accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") StorageAccountCreateParameters parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") StorageAccountExpand expand, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") StorageAccountUpdateParameters parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listKeys(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$expand") ListKeyExpand expand, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateKey(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") StorageAccountRegenerateKeyParameters regenerateKey, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAccountSas(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") AccountSasParameters parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listServiceSas(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ServiceSasParameters parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> failover(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("failoverType") FailoverType failoverType, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/hnsonmigration") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> hierarchicalNamespaceMigration(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("requestType") String requestType, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/aborthnsonmigration") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> abortHierarchicalNamespaceMigration(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/startAccountMigration") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> customerInitiatedMigration(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") StorageAccountMigrationInner parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/accountMigrations/{migrationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getCustomerInitiatedMigration(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("migrationName") MigrationName migrationName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restoreBlobRanges(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") BlobRestoreParameters parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> revokeUserDelegationKeys(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 CheckNameAvailability operation response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + checkNameAvailabilityWithResponseAsync(StorageAccountCheckNameAvailabilityParameters accountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } else { + accountName.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.checkNameAvailability(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accountName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 CheckNameAvailability operation response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + StorageAccountCheckNameAvailabilityParameters accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } else { + accountName.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accountName, accept, context); + } + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 CheckNameAvailability operation response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono + checkNameAvailabilityAsync(StorageAccountCheckNameAvailabilityParameters accountName) { + return checkNameAvailabilityWithResponseAsync(accountName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 CheckNameAvailability operation response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response + checkNameAvailabilityWithResponse(StorageAccountCheckNameAvailabilityParameters accountName, Context context) { + return checkNameAvailabilityWithResponseAsync(accountName, context).block(); + } + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 CheckNameAvailability operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityResultInner + checkNameAvailability(StorageAccountCheckNameAvailabilityParameters accountName) { + return checkNameAvailabilityWithResponse(accountName, Context.NONE).getValue(); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and + * a subsequent create request is issued with different properties, the account properties will be updated. If an + * account is already created and a subsequent create or update request is issued with the exact same set of + * properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String accountName, + StorageAccountCreateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and + * a subsequent create request is issued with different properties, the account properties will be updated. If an + * account is already created and a subsequent create or update request is issued with the exact same set of + * properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String accountName, + StorageAccountCreateParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), parameters, accept, context); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and + * a subsequent create request is issued with different properties, the account properties will be updated. If an + * account is already created and a subsequent create or update request is issued with the exact same set of + * properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the storage account. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StorageAccountInner> beginCreateAsync(String resourceGroupName, + String accountName, StorageAccountCreateParameters parameters) { + Mono>> mono = createWithResponseAsync(resourceGroupName, accountName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + StorageAccountInner.class, StorageAccountInner.class, this.client.getContext()); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and + * a subsequent create request is issued with different properties, the account properties will be updated. If an + * account is already created and a subsequent create or update request is issued with the exact same set of + * properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the storage account. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StorageAccountInner> beginCreateAsync(String resourceGroupName, + String accountName, StorageAccountCreateParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, accountName, parameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + StorageAccountInner.class, StorageAccountInner.class, context); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and + * a subsequent create request is issued with different properties, the account properties will be updated. If an + * account is already created and a subsequent create or update request is issued with the exact same set of + * properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the storage account. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageAccountInner> beginCreate(String resourceGroupName, + String accountName, StorageAccountCreateParameters parameters) { + return this.beginCreateAsync(resourceGroupName, accountName, parameters).getSyncPoller(); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and + * a subsequent create request is issued with different properties, the account properties will be updated. If an + * account is already created and a subsequent create or update request is issued with the exact same set of + * properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the storage account. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageAccountInner> beginCreate(String resourceGroupName, + String accountName, StorageAccountCreateParameters parameters, Context context) { + return this.beginCreateAsync(resourceGroupName, accountName, parameters, context).getSyncPoller(); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and + * a subsequent create request is issued with different properties, the account properties will be updated. If an + * account is already created and a subsequent create or update request is issued with the exact same set of + * properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String accountName, + StorageAccountCreateParameters parameters) { + return beginCreateAsync(resourceGroupName, accountName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and + * a subsequent create request is issued with different properties, the account properties will be updated. If an + * account is already created and a subsequent create or update request is issued with the exact same set of + * properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String accountName, + StorageAccountCreateParameters parameters, Context context) { + return beginCreateAsync(resourceGroupName, accountName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and + * a subsequent create request is issued with different properties, the account properties will be updated. If an + * account is already created and a subsequent create or update request is issued with the exact same set of + * properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageAccountInner create(String resourceGroupName, String accountName, + StorageAccountCreateParameters parameters) { + return createAsync(resourceGroupName, accountName, parameters).block(); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and + * a subsequent create request is issued with different properties, the account properties will be updated. If an + * account is already created and a subsequent create or update request is issued with the exact same set of + * properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageAccountInner create(String resourceGroupName, String accountName, + StorageAccountCreateParameters parameters, Context context) { + return createAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 accountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 accountName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), context); + } + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 accountName) { + return deleteWithResponseAsync(resourceGroupName, accountName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String accountName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName) { + deleteWithResponse(resourceGroupName, accountName, Context.NONE); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, + * and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand May be used to expand the properties within account's properties. By default, data is not included + * when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 storage account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String accountName, StorageAccountExpand expand) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, + accountName, this.client.getApiVersion(), this.client.getSubscriptionId(), expand, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, + * and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand May be used to expand the properties within account's properties. By default, data is not included + * when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. + * @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 storage account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String accountName, StorageAccountExpand expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), expand, accept, context); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, + * and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 storage account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String accountName) { + final StorageAccountExpand expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, accountName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, + * and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand May be used to expand the properties within account's properties. By default, data is not included + * when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. + * @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 storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, + StorageAccountExpand expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, accountName, expand, context).block(); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, + * and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageAccountInner getByResourceGroup(String resourceGroupName, String accountName) { + final StorageAccountExpand expand = null; + return getByResourceGroupWithResponse(resourceGroupName, accountName, expand, Context.NONE).getValue(); + } + + /** + * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It + * can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; + * the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value + * must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This + * call does not change the storage keys for the account. If you want to change the storage account keys, use the + * regenerate keys operation. The location and name of the storage account cannot be changed after creation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the updated account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String accountName, + StorageAccountUpdateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It + * can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; + * the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value + * must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This + * call does not change the storage keys for the account. If you want to change the storage account keys, use the + * regenerate keys operation. The location and name of the storage account cannot be changed after creation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the updated account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String accountName, + StorageAccountUpdateParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), parameters, accept, context); + } + + /** + * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It + * can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; + * the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value + * must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This + * call does not change the storage keys for the account. If you want to change the storage account keys, use the + * regenerate keys operation. The location and name of the storage account cannot be changed after creation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the updated account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String accountName, + StorageAccountUpdateParameters parameters) { + return updateWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It + * can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; + * the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value + * must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This + * call does not change the storage keys for the account. If you want to change the storage account keys, use the + * regenerate keys operation. The location and name of the storage account cannot be changed after creation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the updated account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String accountName, + StorageAccountUpdateParameters parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It + * can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; + * the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value + * must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This + * call does not change the storage keys for the account. If you want to change the storage account keys, use the + * regenerate keys operation. The location and name of the storage account cannot be changed after creation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the updated account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageAccountInner update(String resourceGroupName, String accountName, + StorageAccountUpdateParameters parameters) { + return updateWithResponse(resourceGroupName, accountName, parameters, Context.NONE).getValue(); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the + * ListKeys operation for this. + * + * @throws 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 from the List Storage Accounts 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())); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the + * ListKeys operation for this. + * + * @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 from the List Storage Accounts 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)); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the + * ListKeys operation for this. + * + * @throws 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 from the List Storage Accounts operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the + * ListKeys operation for this. + * + * @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 from the List Storage Accounts operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the + * ListKeys operation for this. + * + * @throws 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 from the List Storage Accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the + * ListKeys operation for this. + * + * @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 from the List Storage Accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; + * use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 from the List Storage Accounts 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, + 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())); + } + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; + * use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 from the List Storage Accounts 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 + .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, 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)); + } + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; + * use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 from the List Storage Accounts operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; + * use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 from the List Storage Accounts 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)); + } + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; + * use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 from the List Storage Accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; + * use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 from the List Storage Accounts operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand Specifies type of the key to be listed. Possible value is kerb. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 from the ListKeys operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync(String resourceGroupName, + String accountName, ListKeyExpand expand) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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.listKeys(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), expand, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand Specifies type of the key to be listed. Possible value is kerb. + * @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 from the ListKeys operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync(String resourceGroupName, + String accountName, ListKeyExpand expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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.listKeys(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), expand, accept, context); + } + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 from the ListKeys operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listKeysAsync(String resourceGroupName, String accountName) { + final ListKeyExpand expand = null; + return listKeysWithResponseAsync(resourceGroupName, accountName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand Specifies type of the key to be listed. Possible value is kerb. + * @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 from the ListKeys operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listKeysWithResponse(String resourceGroupName, + String accountName, ListKeyExpand expand, Context context) { + return listKeysWithResponseAsync(resourceGroupName, accountName, expand, context).block(); + } + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 from the ListKeys operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageAccountListKeysResultInner listKeys(String resourceGroupName, String accountName) { + final ListKeyExpand expand = null; + return listKeysWithResponse(resourceGroupName, accountName, expand, Context.NONE).getValue(); + } + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 from the ListKeys operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateKeyWithResponseAsync(String resourceGroupName, + String accountName, StorageAccountRegenerateKeyParameters regenerateKey) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (regenerateKey == null) { + return Mono.error(new IllegalArgumentException("Parameter regenerateKey is required and cannot be null.")); + } else { + regenerateKey.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.regenerateKey(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), regenerateKey, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. + * @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 from the ListKeys operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateKeyWithResponseAsync(String resourceGroupName, + String accountName, StorageAccountRegenerateKeyParameters regenerateKey, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (regenerateKey == null) { + return Mono.error(new IllegalArgumentException("Parameter regenerateKey is required and cannot be null.")); + } else { + regenerateKey.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.regenerateKey(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), regenerateKey, accept, context); + } + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 from the ListKeys operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateKeyAsync(String resourceGroupName, String accountName, + StorageAccountRegenerateKeyParameters regenerateKey) { + return regenerateKeyWithResponseAsync(resourceGroupName, accountName, regenerateKey) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. + * @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 from the ListKeys operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regenerateKeyWithResponse(String resourceGroupName, + String accountName, StorageAccountRegenerateKeyParameters regenerateKey, Context context) { + return regenerateKeyWithResponseAsync(resourceGroupName, accountName, regenerateKey, context).block(); + } + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 from the ListKeys operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageAccountListKeysResultInner regenerateKey(String resourceGroupName, String accountName, + StorageAccountRegenerateKeyParameters regenerateKey) { + return regenerateKeyWithResponse(resourceGroupName, accountName, regenerateKey, Context.NONE).getValue(); + } + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List SAS credentials operation response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAccountSasWithResponseAsync(String resourceGroupName, + String accountName, AccountSasParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAccountSas(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List SAS credentials operation response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAccountSasWithResponseAsync(String resourceGroupName, + String accountName, AccountSasParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listAccountSas(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + } + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List SAS credentials operation response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAccountSasAsync(String resourceGroupName, String accountName, + AccountSasParameters parameters) { + return listAccountSasWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List SAS credentials operation response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAccountSasWithResponse(String resourceGroupName, + String accountName, AccountSasParameters parameters, Context context) { + return listAccountSasWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List SAS credentials operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ListAccountSasResponseInner listAccountSas(String resourceGroupName, String accountName, + AccountSasParameters parameters) { + return listAccountSasWithResponse(resourceGroupName, accountName, parameters, Context.NONE).getValue(); + } + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List service SAS credentials operation response along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listServiceSasWithResponseAsync(String resourceGroupName, + String accountName, ServiceSasParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listServiceSas(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @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 List service SAS credentials operation response along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listServiceSasWithResponseAsync(String resourceGroupName, + String accountName, ServiceSasParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listServiceSas(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + } + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List service SAS credentials operation response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listServiceSasAsync(String resourceGroupName, String accountName, + ServiceSasParameters parameters) { + return listServiceSasWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @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 List service SAS credentials operation response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listServiceSasWithResponse(String resourceGroupName, + String accountName, ServiceSasParameters parameters, Context context) { + return listServiceSasWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List service SAS credentials operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ListServiceSasResponseInner listServiceSas(String resourceGroupName, String accountName, + ServiceSasParameters parameters) { + return listServiceSasWithResponse(resourceGroupName, accountName, parameters, Context.NONE).getValue(); + } + + /** + * A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable for + * any reason. The failover occurs from the storage account's primary cluster to the secondary cluster for RA-GRS + * accounts. The secondary cluster will become primary after failover and the account is converted to LRS. In the + * case of a Planned Failover, the primary and secondary clusters are swapped after failover and the account remains + * geo-replicated. Failover should continue to be used in the event of availability issues as Planned failover is + * only available while the primary and secondary endpoints are available. The primary use case of a Planned + * Failover is disaster recovery testing drills. This type of failover is invoked by setting FailoverType parameter + * to 'Planned'. Learn more about the failover options here- + * https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param failoverType The parameter is set to 'Planned' to indicate whether a Planned failover is requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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>> failoverWithResponseAsync(String resourceGroupName, String accountName, + FailoverType failoverType) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.failover(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), failoverType, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable for + * any reason. The failover occurs from the storage account's primary cluster to the secondary cluster for RA-GRS + * accounts. The secondary cluster will become primary after failover and the account is converted to LRS. In the + * case of a Planned Failover, the primary and secondary clusters are swapped after failover and the account remains + * geo-replicated. Failover should continue to be used in the event of availability issues as Planned failover is + * only available while the primary and secondary endpoints are available. The primary use case of a Planned + * Failover is disaster recovery testing drills. This type of failover is invoked by setting FailoverType parameter + * to 'Planned'. Learn more about the failover options here- + * https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param failoverType The parameter is set to 'Planned' to indicate whether a Planned failover is requested. + * @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>> failoverWithResponseAsync(String resourceGroupName, String accountName, + FailoverType failoverType, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.failover(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), failoverType, context); + } + + /** + * A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable for + * any reason. The failover occurs from the storage account's primary cluster to the secondary cluster for RA-GRS + * accounts. The secondary cluster will become primary after failover and the account is converted to LRS. In the + * case of a Planned Failover, the primary and secondary clusters are swapped after failover and the account remains + * geo-replicated. Failover should continue to be used in the event of availability issues as Planned failover is + * only available while the primary and secondary endpoints are available. The primary use case of a Planned + * Failover is disaster recovery testing drills. This type of failover is invoked by setting FailoverType parameter + * to 'Planned'. Learn more about the failover options here- + * https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param failoverType The parameter is set to 'Planned' to indicate whether a Planned failover is requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> beginFailoverAsync(String resourceGroupName, String accountName, + FailoverType failoverType) { + Mono>> mono = failoverWithResponseAsync(resourceGroupName, accountName, failoverType); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable for + * any reason. The failover occurs from the storage account's primary cluster to the secondary cluster for RA-GRS + * accounts. The secondary cluster will become primary after failover and the account is converted to LRS. In the + * case of a Planned Failover, the primary and secondary clusters are swapped after failover and the account remains + * geo-replicated. Failover should continue to be used in the event of availability issues as Planned failover is + * only available while the primary and secondary endpoints are available. The primary use case of a Planned + * Failover is disaster recovery testing drills. This type of failover is invoked by setting FailoverType parameter + * to 'Planned'. Learn more about the failover options here- + * https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> beginFailoverAsync(String resourceGroupName, String accountName) { + final FailoverType failoverType = null; + Mono>> mono = failoverWithResponseAsync(resourceGroupName, accountName, failoverType); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable for + * any reason. The failover occurs from the storage account's primary cluster to the secondary cluster for RA-GRS + * accounts. The secondary cluster will become primary after failover and the account is converted to LRS. In the + * case of a Planned Failover, the primary and secondary clusters are swapped after failover and the account remains + * geo-replicated. Failover should continue to be used in the event of availability issues as Planned failover is + * only available while the primary and secondary endpoints are available. The primary use case of a Planned + * Failover is disaster recovery testing drills. This type of failover is invoked by setting FailoverType parameter + * to 'Planned'. Learn more about the failover options here- + * https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param failoverType The parameter is set to 'Planned' to indicate whether a Planned failover is requested. + * @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> beginFailoverAsync(String resourceGroupName, String accountName, + FailoverType failoverType, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = failoverWithResponseAsync(resourceGroupName, accountName, failoverType, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable for + * any reason. The failover occurs from the storage account's primary cluster to the secondary cluster for RA-GRS + * accounts. The secondary cluster will become primary after failover and the account is converted to LRS. In the + * case of a Planned Failover, the primary and secondary clusters are swapped after failover and the account remains + * geo-replicated. Failover should continue to be used in the event of availability issues as Planned failover is + * only available while the primary and secondary endpoints are available. The primary use case of a Planned + * Failover is disaster recovery testing drills. This type of failover is invoked by setting FailoverType parameter + * to 'Planned'. Learn more about the failover options here- + * https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> beginFailover(String resourceGroupName, String accountName) { + final FailoverType failoverType = null; + return this.beginFailoverAsync(resourceGroupName, accountName, failoverType).getSyncPoller(); + } + + /** + * A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable for + * any reason. The failover occurs from the storage account's primary cluster to the secondary cluster for RA-GRS + * accounts. The secondary cluster will become primary after failover and the account is converted to LRS. In the + * case of a Planned Failover, the primary and secondary clusters are swapped after failover and the account remains + * geo-replicated. Failover should continue to be used in the event of availability issues as Planned failover is + * only available while the primary and secondary endpoints are available. The primary use case of a Planned + * Failover is disaster recovery testing drills. This type of failover is invoked by setting FailoverType parameter + * to 'Planned'. Learn more about the failover options here- + * https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param failoverType The parameter is set to 'Planned' to indicate whether a Planned failover is requested. + * @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> beginFailover(String resourceGroupName, String accountName, + FailoverType failoverType, Context context) { + return this.beginFailoverAsync(resourceGroupName, accountName, failoverType, context).getSyncPoller(); + } + + /** + * A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable for + * any reason. The failover occurs from the storage account's primary cluster to the secondary cluster for RA-GRS + * accounts. The secondary cluster will become primary after failover and the account is converted to LRS. In the + * case of a Planned Failover, the primary and secondary clusters are swapped after failover and the account remains + * geo-replicated. Failover should continue to be used in the event of availability issues as Planned failover is + * only available while the primary and secondary endpoints are available. The primary use case of a Planned + * Failover is disaster recovery testing drills. This type of failover is invoked by setting FailoverType parameter + * to 'Planned'. Learn more about the failover options here- + * https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param failoverType The parameter is set to 'Planned' to indicate whether a Planned failover is requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 failoverAsync(String resourceGroupName, String accountName, FailoverType failoverType) { + return beginFailoverAsync(resourceGroupName, accountName, failoverType).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable for + * any reason. The failover occurs from the storage account's primary cluster to the secondary cluster for RA-GRS + * accounts. The secondary cluster will become primary after failover and the account is converted to LRS. In the + * case of a Planned Failover, the primary and secondary clusters are swapped after failover and the account remains + * geo-replicated. Failover should continue to be used in the event of availability issues as Planned failover is + * only available while the primary and secondary endpoints are available. The primary use case of a Planned + * Failover is disaster recovery testing drills. This type of failover is invoked by setting FailoverType parameter + * to 'Planned'. Learn more about the failover options here- + * https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 failoverAsync(String resourceGroupName, String accountName) { + final FailoverType failoverType = null; + return beginFailoverAsync(resourceGroupName, accountName, failoverType).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable for + * any reason. The failover occurs from the storage account's primary cluster to the secondary cluster for RA-GRS + * accounts. The secondary cluster will become primary after failover and the account is converted to LRS. In the + * case of a Planned Failover, the primary and secondary clusters are swapped after failover and the account remains + * geo-replicated. Failover should continue to be used in the event of availability issues as Planned failover is + * only available while the primary and secondary endpoints are available. The primary use case of a Planned + * Failover is disaster recovery testing drills. This type of failover is invoked by setting FailoverType parameter + * to 'Planned'. Learn more about the failover options here- + * https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param failoverType The parameter is set to 'Planned' to indicate whether a Planned failover is requested. + * @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 failoverAsync(String resourceGroupName, String accountName, FailoverType failoverType, + Context context) { + return beginFailoverAsync(resourceGroupName, accountName, failoverType, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable for + * any reason. The failover occurs from the storage account's primary cluster to the secondary cluster for RA-GRS + * accounts. The secondary cluster will become primary after failover and the account is converted to LRS. In the + * case of a Planned Failover, the primary and secondary clusters are swapped after failover and the account remains + * geo-replicated. Failover should continue to be used in the event of availability issues as Planned failover is + * only available while the primary and secondary endpoints are available. The primary use case of a Planned + * Failover is disaster recovery testing drills. This type of failover is invoked by setting FailoverType parameter + * to 'Planned'. Learn more about the failover options here- + * https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 failover(String resourceGroupName, String accountName) { + final FailoverType failoverType = null; + failoverAsync(resourceGroupName, accountName, failoverType).block(); + } + + /** + * A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable for + * any reason. The failover occurs from the storage account's primary cluster to the secondary cluster for RA-GRS + * accounts. The secondary cluster will become primary after failover and the account is converted to LRS. In the + * case of a Planned Failover, the primary and secondary clusters are swapped after failover and the account remains + * geo-replicated. Failover should continue to be used in the event of availability issues as Planned failover is + * only available while the primary and secondary endpoints are available. The primary use case of a Planned + * Failover is disaster recovery testing drills. This type of failover is invoked by setting FailoverType parameter + * to 'Planned'. Learn more about the failover options here- + * https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param failoverType The parameter is set to 'Planned' to indicate whether a Planned failover is requested. + * @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 failover(String resourceGroupName, String accountName, FailoverType failoverType, Context context) { + failoverAsync(resourceGroupName, accountName, failoverType, context).block(); + } + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param requestType Required. Hierarchical namespace migration type can either be a hierarchical namespace + * validation request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation + * request will validate the migration whereas the hydration request will migrate the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> hierarchicalNamespaceMigrationWithResponseAsync(String resourceGroupName, + String accountName, String requestType) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (requestType == null) { + return Mono.error(new IllegalArgumentException("Parameter requestType is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.hierarchicalNamespaceMigration(this.client.getEndpoint(), resourceGroupName, + accountName, this.client.getApiVersion(), this.client.getSubscriptionId(), requestType, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param requestType Required. Hierarchical namespace migration type can either be a hierarchical namespace + * validation request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation + * request will validate the migration whereas the hydration request will migrate the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> hierarchicalNamespaceMigrationWithResponseAsync(String resourceGroupName, + String accountName, String requestType, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (requestType == null) { + return Mono.error(new IllegalArgumentException("Parameter requestType is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.hierarchicalNamespaceMigration(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), requestType, accept, context); + } + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param requestType Required. Hierarchical namespace migration type can either be a hierarchical namespace + * validation request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation + * request will validate the migration whereas the hydration request will migrate the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginHierarchicalNamespaceMigrationAsync(String resourceGroupName, + String accountName, String requestType) { + Mono>> mono + = hierarchicalNamespaceMigrationWithResponseAsync(resourceGroupName, accountName, requestType); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param requestType Required. Hierarchical namespace migration type can either be a hierarchical namespace + * validation request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation + * request will validate the migration whereas the hydration request will migrate the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginHierarchicalNamespaceMigrationAsync(String resourceGroupName, + String accountName, String requestType, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = hierarchicalNamespaceMigrationWithResponseAsync(resourceGroupName, accountName, requestType, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param requestType Required. Hierarchical namespace migration type can either be a hierarchical namespace + * validation request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation + * request will validate the migration whereas the hydration request will migrate the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginHierarchicalNamespaceMigration(String resourceGroupName, + String accountName, String requestType) { + return this.beginHierarchicalNamespaceMigrationAsync(resourceGroupName, accountName, requestType) + .getSyncPoller(); + } + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param requestType Required. Hierarchical namespace migration type can either be a hierarchical namespace + * validation request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation + * request will validate the migration whereas the hydration request will migrate the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginHierarchicalNamespaceMigration(String resourceGroupName, + String accountName, String requestType, Context context) { + return this.beginHierarchicalNamespaceMigrationAsync(resourceGroupName, accountName, requestType, context) + .getSyncPoller(); + } + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param requestType Required. Hierarchical namespace migration type can either be a hierarchical namespace + * validation request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation + * request will validate the migration whereas the hydration request will migrate the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono hierarchicalNamespaceMigrationAsync(String resourceGroupName, String accountName, + String requestType) { + return beginHierarchicalNamespaceMigrationAsync(resourceGroupName, accountName, requestType).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param requestType Required. Hierarchical namespace migration type can either be a hierarchical namespace + * validation request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation + * request will validate the migration whereas the hydration request will migrate the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono hierarchicalNamespaceMigrationAsync(String resourceGroupName, String accountName, + String requestType, Context context) { + return beginHierarchicalNamespaceMigrationAsync(resourceGroupName, accountName, requestType, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param requestType Required. Hierarchical namespace migration type can either be a hierarchical namespace + * validation request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation + * request will validate the migration whereas the hydration request will migrate the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void hierarchicalNamespaceMigration(String resourceGroupName, String accountName, String requestType) { + hierarchicalNamespaceMigrationAsync(resourceGroupName, accountName, requestType).block(); + } + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param requestType Required. Hierarchical namespace migration type can either be a hierarchical namespace + * validation request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation + * request will validate the migration whereas the hydration request will migrate the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void hierarchicalNamespaceMigration(String resourceGroupName, String accountName, String requestType, + Context context) { + hierarchicalNamespaceMigrationAsync(resourceGroupName, accountName, requestType, context).block(); + } + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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>> + abortHierarchicalNamespaceMigrationWithResponseAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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.abortHierarchicalNamespaceMigration(this.client.getEndpoint(), resourceGroupName, + accountName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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>> abortHierarchicalNamespaceMigrationWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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.abortHierarchicalNamespaceMigration(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + } + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> beginAbortHierarchicalNamespaceMigrationAsync(String resourceGroupName, + String accountName) { + Mono>> mono + = abortHierarchicalNamespaceMigrationWithResponseAsync(resourceGroupName, accountName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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> beginAbortHierarchicalNamespaceMigrationAsync(String resourceGroupName, + String accountName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = abortHierarchicalNamespaceMigrationWithResponseAsync(resourceGroupName, accountName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> beginAbortHierarchicalNamespaceMigration(String resourceGroupName, + String accountName) { + return this.beginAbortHierarchicalNamespaceMigrationAsync(resourceGroupName, accountName).getSyncPoller(); + } + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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> beginAbortHierarchicalNamespaceMigration(String resourceGroupName, + String accountName, Context context) { + return this.beginAbortHierarchicalNamespaceMigrationAsync(resourceGroupName, accountName, context) + .getSyncPoller(); + } + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 abortHierarchicalNamespaceMigrationAsync(String resourceGroupName, String accountName) { + return beginAbortHierarchicalNamespaceMigrationAsync(resourceGroupName, accountName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 abortHierarchicalNamespaceMigrationAsync(String resourceGroupName, String accountName, + Context context) { + return beginAbortHierarchicalNamespaceMigrationAsync(resourceGroupName, accountName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 abortHierarchicalNamespaceMigration(String resourceGroupName, String accountName) { + abortHierarchicalNamespaceMigrationAsync(resourceGroupName, accountName).block(); + } + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 abortHierarchicalNamespaceMigration(String resourceGroupName, String accountName, Context context) { + abortHierarchicalNamespaceMigrationAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Account Migration request can be triggered for a storage account to change its redundancy level. The migration + * updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have + * better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously + * across three Azure availability zones in the primary region. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The request parameters required to perform storage account migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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>> customerInitiatedMigrationWithResponseAsync(String resourceGroupName, + String accountName, StorageAccountMigrationInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.customerInitiatedMigration(this.client.getEndpoint(), resourceGroupName, + accountName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Account Migration request can be triggered for a storage account to change its redundancy level. The migration + * updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have + * better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously + * across three Azure availability zones in the primary region. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The request parameters required to perform storage account migration. + * @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>> customerInitiatedMigrationWithResponseAsync(String resourceGroupName, + String accountName, StorageAccountMigrationInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.customerInitiatedMigration(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + } + + /** + * Account Migration request can be triggered for a storage account to change its redundancy level. The migration + * updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have + * better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously + * across three Azure availability zones in the primary region. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The request parameters required to perform storage account migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> beginCustomerInitiatedMigrationAsync(String resourceGroupName, + String accountName, StorageAccountMigrationInner parameters) { + Mono>> mono + = customerInitiatedMigrationWithResponseAsync(resourceGroupName, accountName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Account Migration request can be triggered for a storage account to change its redundancy level. The migration + * updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have + * better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously + * across three Azure availability zones in the primary region. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The request parameters required to perform storage account migration. + * @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> beginCustomerInitiatedMigrationAsync(String resourceGroupName, + String accountName, StorageAccountMigrationInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = customerInitiatedMigrationWithResponseAsync(resourceGroupName, accountName, parameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Account Migration request can be triggered for a storage account to change its redundancy level. The migration + * updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have + * better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously + * across three Azure availability zones in the primary region. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The request parameters required to perform storage account migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> beginCustomerInitiatedMigration(String resourceGroupName, + String accountName, StorageAccountMigrationInner parameters) { + return this.beginCustomerInitiatedMigrationAsync(resourceGroupName, accountName, parameters).getSyncPoller(); + } + + /** + * Account Migration request can be triggered for a storage account to change its redundancy level. The migration + * updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have + * better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously + * across three Azure availability zones in the primary region. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The request parameters required to perform storage account migration. + * @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> beginCustomerInitiatedMigration(String resourceGroupName, + String accountName, StorageAccountMigrationInner parameters, Context context) { + return this.beginCustomerInitiatedMigrationAsync(resourceGroupName, accountName, parameters, context) + .getSyncPoller(); + } + + /** + * Account Migration request can be triggered for a storage account to change its redundancy level. The migration + * updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have + * better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously + * across three Azure availability zones in the primary region. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The request parameters required to perform storage account migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 customerInitiatedMigrationAsync(String resourceGroupName, String accountName, + StorageAccountMigrationInner parameters) { + return beginCustomerInitiatedMigrationAsync(resourceGroupName, accountName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Account Migration request can be triggered for a storage account to change its redundancy level. The migration + * updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have + * better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously + * across three Azure availability zones in the primary region. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The request parameters required to perform storage account migration. + * @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 customerInitiatedMigrationAsync(String resourceGroupName, String accountName, + StorageAccountMigrationInner parameters, Context context) { + return beginCustomerInitiatedMigrationAsync(resourceGroupName, accountName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Account Migration request can be triggered for a storage account to change its redundancy level. The migration + * updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have + * better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously + * across three Azure availability zones in the primary region. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The request parameters required to perform storage account migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 customerInitiatedMigration(String resourceGroupName, String accountName, + StorageAccountMigrationInner parameters) { + customerInitiatedMigrationAsync(resourceGroupName, accountName, parameters).block(); + } + + /** + * Account Migration request can be triggered for a storage account to change its redundancy level. The migration + * updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have + * better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously + * across three Azure availability zones in the primary region. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The request parameters required to perform storage account migration. + * @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 customerInitiatedMigration(String resourceGroupName, String accountName, + StorageAccountMigrationInner parameters, Context context) { + customerInitiatedMigrationAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * Gets the status of the ongoing migration for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param migrationName The name of the Storage Account Migration. It should always be 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the ongoing migration for the specified storage account along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getCustomerInitiatedMigrationWithResponseAsync( + String resourceGroupName, String accountName, MigrationName migrationName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (migrationName == null) { + return Mono.error(new IllegalArgumentException("Parameter migrationName 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.getCustomerInitiatedMigration(this.client.getEndpoint(), resourceGroupName, + accountName, migrationName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the status of the ongoing migration for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param migrationName The name of the Storage Account Migration. It should always be 'default'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the ongoing migration for the specified storage account along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getCustomerInitiatedMigrationWithResponseAsync( + String resourceGroupName, String accountName, MigrationName migrationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (migrationName == null) { + return Mono.error(new IllegalArgumentException("Parameter migrationName 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.getCustomerInitiatedMigration(this.client.getEndpoint(), resourceGroupName, accountName, + migrationName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + } + + /** + * Gets the status of the ongoing migration for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param migrationName The name of the Storage Account Migration. It should always be 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the ongoing migration for the specified storage account on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getCustomerInitiatedMigrationAsync(String resourceGroupName, + String accountName, MigrationName migrationName) { + return getCustomerInitiatedMigrationWithResponseAsync(resourceGroupName, accountName, migrationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the status of the ongoing migration for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param migrationName The name of the Storage Account Migration. It should always be 'default'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the ongoing migration for the specified storage account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getCustomerInitiatedMigrationWithResponse(String resourceGroupName, + String accountName, MigrationName migrationName, Context context) { + return getCustomerInitiatedMigrationWithResponseAsync(resourceGroupName, accountName, migrationName, context) + .block(); + } + + /** + * Gets the status of the ongoing migration for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param migrationName The name of the Storage Account Migration. It should always be 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the ongoing migration for the specified storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageAccountMigrationInner getCustomerInitiatedMigration(String resourceGroupName, String accountName, + MigrationName migrationName) { + return getCustomerInitiatedMigrationWithResponse(resourceGroupName, accountName, migrationName, Context.NONE) + .getValue(); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return blob restore status along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restoreBlobRangesWithResponseAsync(String resourceGroupName, + String accountName, BlobRestoreParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.restoreBlobRanges(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @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 blob restore status along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restoreBlobRangesWithResponseAsync(String resourceGroupName, + String accountName, BlobRestoreParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.restoreBlobRanges(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 blob restore status. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BlobRestoreStatusInner> + beginRestoreBlobRangesAsync(String resourceGroupName, String accountName, BlobRestoreParameters parameters) { + Mono>> mono + = restoreBlobRangesWithResponseAsync(resourceGroupName, accountName, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), BlobRestoreStatusInner.class, BlobRestoreStatusInner.class, + this.client.getContext()); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @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 blob restore status. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BlobRestoreStatusInner> beginRestoreBlobRangesAsync( + String resourceGroupName, String accountName, BlobRestoreParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = restoreBlobRangesWithResponseAsync(resourceGroupName, accountName, parameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), BlobRestoreStatusInner.class, BlobRestoreStatusInner.class, context); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 blob restore status. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BlobRestoreStatusInner> + beginRestoreBlobRanges(String resourceGroupName, String accountName, BlobRestoreParameters parameters) { + return this.beginRestoreBlobRangesAsync(resourceGroupName, accountName, parameters).getSyncPoller(); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @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 blob restore status. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BlobRestoreStatusInner> beginRestoreBlobRanges( + String resourceGroupName, String accountName, BlobRestoreParameters parameters, Context context) { + return this.beginRestoreBlobRangesAsync(resourceGroupName, accountName, parameters, context).getSyncPoller(); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return blob restore status on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restoreBlobRangesAsync(String resourceGroupName, String accountName, + BlobRestoreParameters parameters) { + return beginRestoreBlobRangesAsync(resourceGroupName, accountName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @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 blob restore status on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restoreBlobRangesAsync(String resourceGroupName, String accountName, + BlobRestoreParameters parameters, Context context) { + return beginRestoreBlobRangesAsync(resourceGroupName, accountName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return blob restore status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobRestoreStatusInner restoreBlobRanges(String resourceGroupName, String accountName, + BlobRestoreParameters parameters) { + return restoreBlobRangesAsync(resourceGroupName, accountName, parameters).block(); + } + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @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 blob restore status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BlobRestoreStatusInner restoreBlobRanges(String resourceGroupName, String accountName, + BlobRestoreParameters parameters, Context context) { + return restoreBlobRangesAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * Revoke user delegation keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> revokeUserDelegationKeysWithResponseAsync(String resourceGroupName, + String accountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.revokeUserDelegationKeys(this.client.getEndpoint(), resourceGroupName, + accountName, this.client.getApiVersion(), this.client.getSubscriptionId(), context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Revoke user delegation keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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> revokeUserDelegationKeysWithResponseAsync(String resourceGroupName, String accountName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.revokeUserDelegationKeys(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), context); + } + + /** + * Revoke user delegation keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 revokeUserDelegationKeysAsync(String resourceGroupName, String accountName) { + return revokeUserDelegationKeysWithResponseAsync(resourceGroupName, accountName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Revoke user delegation keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response revokeUserDelegationKeysWithResponse(String resourceGroupName, String accountName, + Context context) { + return revokeUserDelegationKeysWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Revoke user delegation keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 revokeUserDelegationKeys(String resourceGroupName, String accountName) { + revokeUserDelegationKeysWithResponse(resourceGroupName, accountName, Context.NONE); + } + + /** + * 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 from the List Storage Accounts operation 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 the response from the List Storage Accounts operation 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)); + } + + /** + * 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 from the List Storage Accounts 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 from the List Storage Accounts 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)); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountsImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountsImpl.java new file mode 100644 index 0000000000000..44380c7aa8caf --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountsImpl.java @@ -0,0 +1,371 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.StorageAccountsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobRestoreStatusInner; +import com.azure.resourcemanager.storage.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.storage.generated.fluent.models.ListAccountSasResponseInner; +import com.azure.resourcemanager.storage.generated.fluent.models.ListServiceSasResponseInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountListKeysResultInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountMigrationInner; +import com.azure.resourcemanager.storage.generated.models.AccountSasParameters; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreParameters; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreStatus; +import com.azure.resourcemanager.storage.generated.models.CheckNameAvailabilityResult; +import com.azure.resourcemanager.storage.generated.models.FailoverType; +import com.azure.resourcemanager.storage.generated.models.ListAccountSasResponse; +import com.azure.resourcemanager.storage.generated.models.ListKeyExpand; +import com.azure.resourcemanager.storage.generated.models.ListServiceSasResponse; +import com.azure.resourcemanager.storage.generated.models.MigrationName; +import com.azure.resourcemanager.storage.generated.models.ServiceSasParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccount; +import com.azure.resourcemanager.storage.generated.models.StorageAccountCheckNameAvailabilityParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccountExpand; +import com.azure.resourcemanager.storage.generated.models.StorageAccountListKeysResult; +import com.azure.resourcemanager.storage.generated.models.StorageAccountMigration; +import com.azure.resourcemanager.storage.generated.models.StorageAccountRegenerateKeyParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccounts; + +public final class StorageAccountsImpl implements StorageAccounts { + private static final ClientLogger LOGGER = new ClientLogger(StorageAccountsImpl.class); + + private final StorageAccountsClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public StorageAccountsImpl(StorageAccountsClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response + checkNameAvailabilityWithResponse(StorageAccountCheckNameAvailabilityParameters accountName, Context context) { + Response inner + = this.serviceClient().checkNameAvailabilityWithResponse(accountName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CheckNameAvailabilityResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CheckNameAvailabilityResult + checkNameAvailability(StorageAccountCheckNameAvailabilityParameters accountName) { + CheckNameAvailabilityResultInner inner = this.serviceClient().checkNameAvailability(accountName); + if (inner != null) { + return new CheckNameAvailabilityResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse(String resourceGroupName, String accountName, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String accountName) { + this.serviceClient().delete(resourceGroupName, accountName); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, + StorageAccountExpand expand, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, accountName, expand, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new StorageAccountImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public StorageAccount getByResourceGroup(String resourceGroupName, String accountName) { + StorageAccountInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, accountName); + if (inner != null) { + return new StorageAccountImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageAccountImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageAccountImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageAccountImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageAccountImpl(inner1, this.manager())); + } + + public Response listKeysWithResponse(String resourceGroupName, String accountName, + ListKeyExpand expand, Context context) { + Response inner + = this.serviceClient().listKeysWithResponse(resourceGroupName, accountName, expand, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new StorageAccountListKeysResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public StorageAccountListKeysResult listKeys(String resourceGroupName, String accountName) { + StorageAccountListKeysResultInner inner = this.serviceClient().listKeys(resourceGroupName, accountName); + if (inner != null) { + return new StorageAccountListKeysResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response regenerateKeyWithResponse(String resourceGroupName, + String accountName, StorageAccountRegenerateKeyParameters regenerateKey, Context context) { + Response inner + = this.serviceClient().regenerateKeyWithResponse(resourceGroupName, accountName, regenerateKey, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new StorageAccountListKeysResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public StorageAccountListKeysResult regenerateKey(String resourceGroupName, String accountName, + StorageAccountRegenerateKeyParameters regenerateKey) { + StorageAccountListKeysResultInner inner + = this.serviceClient().regenerateKey(resourceGroupName, accountName, regenerateKey); + if (inner != null) { + return new StorageAccountListKeysResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listAccountSasWithResponse(String resourceGroupName, String accountName, + AccountSasParameters parameters, Context context) { + Response inner + = this.serviceClient().listAccountSasWithResponse(resourceGroupName, accountName, parameters, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ListAccountSasResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ListAccountSasResponse listAccountSas(String resourceGroupName, String accountName, + AccountSasParameters parameters) { + ListAccountSasResponseInner inner + = this.serviceClient().listAccountSas(resourceGroupName, accountName, parameters); + if (inner != null) { + return new ListAccountSasResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listServiceSasWithResponse(String resourceGroupName, String accountName, + ServiceSasParameters parameters, Context context) { + Response inner + = this.serviceClient().listServiceSasWithResponse(resourceGroupName, accountName, parameters, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ListServiceSasResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ListServiceSasResponse listServiceSas(String resourceGroupName, String accountName, + ServiceSasParameters parameters) { + ListServiceSasResponseInner inner + = this.serviceClient().listServiceSas(resourceGroupName, accountName, parameters); + if (inner != null) { + return new ListServiceSasResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public void failover(String resourceGroupName, String accountName) { + this.serviceClient().failover(resourceGroupName, accountName); + } + + public void failover(String resourceGroupName, String accountName, FailoverType failoverType, Context context) { + this.serviceClient().failover(resourceGroupName, accountName, failoverType, context); + } + + public void hierarchicalNamespaceMigration(String resourceGroupName, String accountName, String requestType) { + this.serviceClient().hierarchicalNamespaceMigration(resourceGroupName, accountName, requestType); + } + + public void hierarchicalNamespaceMigration(String resourceGroupName, String accountName, String requestType, + Context context) { + this.serviceClient().hierarchicalNamespaceMigration(resourceGroupName, accountName, requestType, context); + } + + public void abortHierarchicalNamespaceMigration(String resourceGroupName, String accountName) { + this.serviceClient().abortHierarchicalNamespaceMigration(resourceGroupName, accountName); + } + + public void abortHierarchicalNamespaceMigration(String resourceGroupName, String accountName, Context context) { + this.serviceClient().abortHierarchicalNamespaceMigration(resourceGroupName, accountName, context); + } + + public void customerInitiatedMigration(String resourceGroupName, String accountName, + StorageAccountMigrationInner parameters) { + this.serviceClient().customerInitiatedMigration(resourceGroupName, accountName, parameters); + } + + public void customerInitiatedMigration(String resourceGroupName, String accountName, + StorageAccountMigrationInner parameters, Context context) { + this.serviceClient().customerInitiatedMigration(resourceGroupName, accountName, parameters, context); + } + + public Response getCustomerInitiatedMigrationWithResponse(String resourceGroupName, + String accountName, MigrationName migrationName, Context context) { + Response inner = this.serviceClient() + .getCustomerInitiatedMigrationWithResponse(resourceGroupName, accountName, migrationName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new StorageAccountMigrationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public StorageAccountMigration getCustomerInitiatedMigration(String resourceGroupName, String accountName, + MigrationName migrationName) { + StorageAccountMigrationInner inner + = this.serviceClient().getCustomerInitiatedMigration(resourceGroupName, accountName, migrationName); + if (inner != null) { + return new StorageAccountMigrationImpl(inner, this.manager()); + } else { + return null; + } + } + + public BlobRestoreStatus restoreBlobRanges(String resourceGroupName, String accountName, + BlobRestoreParameters parameters) { + BlobRestoreStatusInner inner + = this.serviceClient().restoreBlobRanges(resourceGroupName, accountName, parameters); + if (inner != null) { + return new BlobRestoreStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public BlobRestoreStatus restoreBlobRanges(String resourceGroupName, String accountName, + BlobRestoreParameters parameters, Context context) { + BlobRestoreStatusInner inner + = this.serviceClient().restoreBlobRanges(resourceGroupName, accountName, parameters, context); + if (inner != null) { + return new BlobRestoreStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response revokeUserDelegationKeysWithResponse(String resourceGroupName, String accountName, + Context context) { + return this.serviceClient().revokeUserDelegationKeysWithResponse(resourceGroupName, accountName, context); + } + + public void revokeUserDelegationKeys(String resourceGroupName, String accountName) { + this.serviceClient().revokeUserDelegationKeys(resourceGroupName, accountName); + } + + public StorageAccount 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + StorageAccountExpand localExpand = null; + return this.getByResourceGroupWithResponse(resourceGroupName, accountName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, StorageAccountExpand expand, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, accountName, expand, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + this.deleteByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE); + } + + public Response 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + return this.deleteByResourceGroupWithResponse(resourceGroupName, accountName, context); + } + + private StorageAccountsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public StorageAccountImpl define(String name) { + return new StorageAccountImpl(name, this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageManagementClientBuilder.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageManagementClientBuilder.java new file mode 100644 index 0000000000000..e4249bace3355 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageManagementClientBuilder.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 StorageManagementClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { StorageManagementClientImpl.class }) +public final class StorageManagementClientBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the StorageManagementClientBuilder. + */ + public StorageManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the StorageManagementClientBuilder. + */ + public StorageManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the StorageManagementClientBuilder. + */ + public StorageManagementClientBuilder 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 StorageManagementClientBuilder. + */ + public StorageManagementClientBuilder 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 StorageManagementClientBuilder. + */ + public StorageManagementClientBuilder 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 StorageManagementClientBuilder. + */ + public StorageManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of StorageManagementClientImpl with the provided parameters. + * + * @return an instance of StorageManagementClientImpl. + */ + public StorageManagementClientImpl 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(); + StorageManagementClientImpl client = new StorageManagementClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + return client; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageManagementClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageManagementClientImpl.java new file mode 100644 index 0000000000000..7b3581cb0e75a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageManagementClientImpl.java @@ -0,0 +1,656 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.BlobContainersClient; +import com.azure.resourcemanager.storage.generated.fluent.BlobInventoryPoliciesClient; +import com.azure.resourcemanager.storage.generated.fluent.BlobServicesClient; +import com.azure.resourcemanager.storage.generated.fluent.DeletedAccountsClient; +import com.azure.resourcemanager.storage.generated.fluent.EncryptionScopesClient; +import com.azure.resourcemanager.storage.generated.fluent.FileServicesClient; +import com.azure.resourcemanager.storage.generated.fluent.FileSharesClient; +import com.azure.resourcemanager.storage.generated.fluent.LocalUsersOperationsClient; +import com.azure.resourcemanager.storage.generated.fluent.ManagementPoliciesClient; +import com.azure.resourcemanager.storage.generated.fluent.NetworkSecurityPerimeterConfigurationsClient; +import com.azure.resourcemanager.storage.generated.fluent.ObjectReplicationPoliciesOperationsClient; +import com.azure.resourcemanager.storage.generated.fluent.OperationsClient; +import com.azure.resourcemanager.storage.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.storage.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.storage.generated.fluent.QueueServicesClient; +import com.azure.resourcemanager.storage.generated.fluent.QueuesClient; +import com.azure.resourcemanager.storage.generated.fluent.SkusClient; +import com.azure.resourcemanager.storage.generated.fluent.StorageAccountsClient; +import com.azure.resourcemanager.storage.generated.fluent.StorageManagementClient; +import com.azure.resourcemanager.storage.generated.fluent.StorageTaskAssignmentInstancesReportsClient; +import com.azure.resourcemanager.storage.generated.fluent.StorageTaskAssignmentsClient; +import com.azure.resourcemanager.storage.generated.fluent.StorageTaskAssignmentsInstancesReportsClient; +import com.azure.resourcemanager.storage.generated.fluent.TableServicesClient; +import com.azure.resourcemanager.storage.generated.fluent.TablesClient; +import com.azure.resourcemanager.storage.generated.fluent.UsagesClient; +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 StorageManagementClientImpl type. + */ +@ServiceClient(builder = StorageManagementClientBuilder.class) +public final class StorageManagementClientImpl implements StorageManagementClient { + /** + * The ID of the target subscription. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * server parameter. + */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Api Version. + */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The default poll interval for long-running operation. + */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** + * The BlobServicesClient object to access its operations. + */ + private final BlobServicesClient blobServices; + + /** + * Gets the BlobServicesClient object to access its operations. + * + * @return the BlobServicesClient object. + */ + public BlobServicesClient getBlobServices() { + return this.blobServices; + } + + /** + * The BlobContainersClient object to access its operations. + */ + private final BlobContainersClient blobContainers; + + /** + * Gets the BlobContainersClient object to access its operations. + * + * @return the BlobContainersClient object. + */ + public BlobContainersClient getBlobContainers() { + return this.blobContainers; + } + + /** + * The FileServicesClient object to access its operations. + */ + private final FileServicesClient fileServices; + + /** + * Gets the FileServicesClient object to access its operations. + * + * @return the FileServicesClient object. + */ + public FileServicesClient getFileServices() { + return this.fileServices; + } + + /** + * The FileSharesClient object to access its operations. + */ + private final FileSharesClient fileShares; + + /** + * Gets the FileSharesClient object to access its operations. + * + * @return the FileSharesClient object. + */ + public FileSharesClient getFileShares() { + return this.fileShares; + } + + /** + * The QueueServicesClient object to access its operations. + */ + private final QueueServicesClient queueServices; + + /** + * Gets the QueueServicesClient object to access its operations. + * + * @return the QueueServicesClient object. + */ + public QueueServicesClient getQueueServices() { + return this.queueServices; + } + + /** + * The QueuesClient object to access its operations. + */ + private final QueuesClient queues; + + /** + * Gets the QueuesClient object to access its operations. + * + * @return the QueuesClient object. + */ + public QueuesClient getQueues() { + return this.queues; + } + + /** + * 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 SkusClient object to access its operations. + */ + private final SkusClient skus; + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + public SkusClient getSkus() { + return this.skus; + } + + /** + * The StorageAccountsClient object to access its operations. + */ + private final StorageAccountsClient storageAccounts; + + /** + * Gets the StorageAccountsClient object to access its operations. + * + * @return the StorageAccountsClient object. + */ + public StorageAccountsClient getStorageAccounts() { + return this.storageAccounts; + } + + /** + * The DeletedAccountsClient object to access its operations. + */ + private final DeletedAccountsClient deletedAccounts; + + /** + * Gets the DeletedAccountsClient object to access its operations. + * + * @return the DeletedAccountsClient object. + */ + public DeletedAccountsClient getDeletedAccounts() { + return this.deletedAccounts; + } + + /** + * The UsagesClient object to access its operations. + */ + private final UsagesClient usages; + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + public UsagesClient getUsages() { + return this.usages; + } + + /** + * The ManagementPoliciesClient object to access its operations. + */ + private final ManagementPoliciesClient managementPolicies; + + /** + * Gets the ManagementPoliciesClient object to access its operations. + * + * @return the ManagementPoliciesClient object. + */ + public ManagementPoliciesClient getManagementPolicies() { + return this.managementPolicies; + } + + /** + * The BlobInventoryPoliciesClient object to access its operations. + */ + private final BlobInventoryPoliciesClient blobInventoryPolicies; + + /** + * Gets the BlobInventoryPoliciesClient object to access its operations. + * + * @return the BlobInventoryPoliciesClient object. + */ + public BlobInventoryPoliciesClient getBlobInventoryPolicies() { + return this.blobInventoryPolicies; + } + + /** + * The PrivateEndpointConnectionsClient object to access its operations. + */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * The PrivateLinkResourcesClient object to access its operations. + */ + private final PrivateLinkResourcesClient privateLinkResources; + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; + } + + /** + * The ObjectReplicationPoliciesOperationsClient object to access its operations. + */ + private final ObjectReplicationPoliciesOperationsClient objectReplicationPoliciesOperations; + + /** + * Gets the ObjectReplicationPoliciesOperationsClient object to access its operations. + * + * @return the ObjectReplicationPoliciesOperationsClient object. + */ + public ObjectReplicationPoliciesOperationsClient getObjectReplicationPoliciesOperations() { + return this.objectReplicationPoliciesOperations; + } + + /** + * The LocalUsersOperationsClient object to access its operations. + */ + private final LocalUsersOperationsClient localUsersOperations; + + /** + * Gets the LocalUsersOperationsClient object to access its operations. + * + * @return the LocalUsersOperationsClient object. + */ + public LocalUsersOperationsClient getLocalUsersOperations() { + return this.localUsersOperations; + } + + /** + * The EncryptionScopesClient object to access its operations. + */ + private final EncryptionScopesClient encryptionScopes; + + /** + * Gets the EncryptionScopesClient object to access its operations. + * + * @return the EncryptionScopesClient object. + */ + public EncryptionScopesClient getEncryptionScopes() { + return this.encryptionScopes; + } + + /** + * The TableServicesClient object to access its operations. + */ + private final TableServicesClient tableServices; + + /** + * Gets the TableServicesClient object to access its operations. + * + * @return the TableServicesClient object. + */ + public TableServicesClient getTableServices() { + return this.tableServices; + } + + /** + * The TablesClient object to access its operations. + */ + private final TablesClient tables; + + /** + * Gets the TablesClient object to access its operations. + * + * @return the TablesClient object. + */ + public TablesClient getTables() { + return this.tables; + } + + /** + * The NetworkSecurityPerimeterConfigurationsClient object to access its operations. + */ + private final NetworkSecurityPerimeterConfigurationsClient networkSecurityPerimeterConfigurations; + + /** + * Gets the NetworkSecurityPerimeterConfigurationsClient object to access its operations. + * + * @return the NetworkSecurityPerimeterConfigurationsClient object. + */ + public NetworkSecurityPerimeterConfigurationsClient getNetworkSecurityPerimeterConfigurations() { + return this.networkSecurityPerimeterConfigurations; + } + + /** + * The StorageTaskAssignmentsClient object to access its operations. + */ + private final StorageTaskAssignmentsClient storageTaskAssignments; + + /** + * Gets the StorageTaskAssignmentsClient object to access its operations. + * + * @return the StorageTaskAssignmentsClient object. + */ + public StorageTaskAssignmentsClient getStorageTaskAssignments() { + return this.storageTaskAssignments; + } + + /** + * The StorageTaskAssignmentsInstancesReportsClient object to access its operations. + */ + private final StorageTaskAssignmentsInstancesReportsClient storageTaskAssignmentsInstancesReports; + + /** + * Gets the StorageTaskAssignmentsInstancesReportsClient object to access its operations. + * + * @return the StorageTaskAssignmentsInstancesReportsClient object. + */ + public StorageTaskAssignmentsInstancesReportsClient getStorageTaskAssignmentsInstancesReports() { + return this.storageTaskAssignmentsInstancesReports; + } + + /** + * The StorageTaskAssignmentInstancesReportsClient object to access its operations. + */ + private final StorageTaskAssignmentInstancesReportsClient storageTaskAssignmentInstancesReports; + + /** + * Gets the StorageTaskAssignmentInstancesReportsClient object to access its operations. + * + * @return the StorageTaskAssignmentInstancesReportsClient object. + */ + public StorageTaskAssignmentInstancesReportsClient getStorageTaskAssignmentInstancesReports() { + return this.storageTaskAssignmentInstancesReports; + } + + /** + * Initializes an instance of StorageManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. + * @param endpoint server parameter. + */ + StorageManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2024-01-01"; + this.blobServices = new BlobServicesClientImpl(this); + this.blobContainers = new BlobContainersClientImpl(this); + this.fileServices = new FileServicesClientImpl(this); + this.fileShares = new FileSharesClientImpl(this); + this.queueServices = new QueueServicesClientImpl(this); + this.queues = new QueuesClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.skus = new SkusClientImpl(this); + this.storageAccounts = new StorageAccountsClientImpl(this); + this.deletedAccounts = new DeletedAccountsClientImpl(this); + this.usages = new UsagesClientImpl(this); + this.managementPolicies = new ManagementPoliciesClientImpl(this); + this.blobInventoryPolicies = new BlobInventoryPoliciesClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.objectReplicationPoliciesOperations = new ObjectReplicationPoliciesOperationsClientImpl(this); + this.localUsersOperations = new LocalUsersOperationsClientImpl(this); + this.encryptionScopes = new EncryptionScopesClientImpl(this); + this.tableServices = new TableServicesClientImpl(this); + this.tables = new TablesClientImpl(this); + this.networkSecurityPerimeterConfigurations = new NetworkSecurityPerimeterConfigurationsClientImpl(this); + this.storageTaskAssignments = new StorageTaskAssignmentsClientImpl(this); + this.storageTaskAssignmentsInstancesReports = new StorageTaskAssignmentsInstancesReportsClientImpl(this); + this.storageTaskAssignmentInstancesReports = new StorageTaskAssignmentInstancesReportsClientImpl(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(StorageManagementClientImpl.class); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageQueueImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageQueueImpl.java new file mode 100644 index 0000000000000..56b7b5204038d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageQueueImpl.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageQueueInner; +import com.azure.resourcemanager.storage.generated.models.StorageQueue; +import java.util.Collections; +import java.util.Map; + +public final class StorageQueueImpl implements StorageQueue, StorageQueue.Definition, StorageQueue.Update { + private StorageQueueInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public Map metadata() { + Map inner = this.innerModel().metadata(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Integer approximateMessageCount() { + return this.innerModel().approximateMessageCount(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public StorageQueueInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String queueName; + + public StorageQueueImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public StorageQueue create() { + this.innerObject = serviceManager.serviceClient() + .getQueues() + .createWithResponse(resourceGroupName, accountName, queueName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public StorageQueue create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getQueues() + .createWithResponse(resourceGroupName, accountName, queueName, this.innerModel(), context) + .getValue(); + return this; + } + + StorageQueueImpl(String name, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new StorageQueueInner(); + this.serviceManager = serviceManager; + this.queueName = name; + } + + public StorageQueueImpl update() { + return this; + } + + public StorageQueue apply() { + this.innerObject = serviceManager.serviceClient() + .getQueues() + .updateWithResponse(resourceGroupName, accountName, queueName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public StorageQueue apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getQueues() + .updateWithResponse(resourceGroupName, accountName, queueName, this.innerModel(), context) + .getValue(); + return this; + } + + StorageQueueImpl(StorageQueueInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.queueName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "queues"); + } + + public StorageQueue refresh() { + this.innerObject = serviceManager.serviceClient() + .getQueues() + .getWithResponse(resourceGroupName, accountName, queueName, Context.NONE) + .getValue(); + return this; + } + + public StorageQueue refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getQueues() + .getWithResponse(resourceGroupName, accountName, queueName, context) + .getValue(); + return this; + } + + public StorageQueueImpl withMetadata(Map metadata) { + this.innerModel().withMetadata(metadata); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageTaskAssignmentImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageTaskAssignmentImpl.java new file mode 100644 index 0000000000000..e9d02bedfa680 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageTaskAssignmentImpl.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageTaskAssignmentInner; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignment; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignmentProperties; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignmentUpdateParameters; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignmentUpdateProperties; + +public final class StorageTaskAssignmentImpl + implements StorageTaskAssignment, StorageTaskAssignment.Definition, StorageTaskAssignment.Update { + private StorageTaskAssignmentInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public StorageTaskAssignmentProperties properties() { + return this.innerModel().properties(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public StorageTaskAssignmentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String storageTaskAssignmentName; + + private StorageTaskAssignmentUpdateParameters updateParameters; + + public StorageTaskAssignmentImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public StorageTaskAssignment create() { + this.innerObject = serviceManager.serviceClient() + .getStorageTaskAssignments() + .create(resourceGroupName, accountName, storageTaskAssignmentName, this.innerModel(), Context.NONE); + return this; + } + + public StorageTaskAssignment create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getStorageTaskAssignments() + .create(resourceGroupName, accountName, storageTaskAssignmentName, this.innerModel(), context); + return this; + } + + StorageTaskAssignmentImpl(String name, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new StorageTaskAssignmentInner(); + this.serviceManager = serviceManager; + this.storageTaskAssignmentName = name; + } + + public StorageTaskAssignmentImpl update() { + this.updateParameters = new StorageTaskAssignmentUpdateParameters(); + return this; + } + + public StorageTaskAssignment apply() { + this.innerObject = serviceManager.serviceClient() + .getStorageTaskAssignments() + .update(resourceGroupName, accountName, storageTaskAssignmentName, updateParameters, Context.NONE); + return this; + } + + public StorageTaskAssignment apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getStorageTaskAssignments() + .update(resourceGroupName, accountName, storageTaskAssignmentName, updateParameters, context); + return this; + } + + StorageTaskAssignmentImpl(StorageTaskAssignmentInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.storageTaskAssignmentName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "storageTaskAssignments"); + } + + public StorageTaskAssignment refresh() { + this.innerObject = serviceManager.serviceClient() + .getStorageTaskAssignments() + .getWithResponse(resourceGroupName, accountName, storageTaskAssignmentName, Context.NONE) + .getValue(); + return this; + } + + public StorageTaskAssignment refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getStorageTaskAssignments() + .getWithResponse(resourceGroupName, accountName, storageTaskAssignmentName, context) + .getValue(); + return this; + } + + public StorageTaskAssignmentImpl withProperties(StorageTaskAssignmentProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public StorageTaskAssignmentImpl withProperties(StorageTaskAssignmentUpdateProperties properties) { + this.updateParameters.withProperties(properties); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageTaskAssignmentInstancesReportsClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageTaskAssignmentInstancesReportsClientImpl.java new file mode 100644 index 0000000000000..edec2fb52294f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageTaskAssignmentInstancesReportsClientImpl.java @@ -0,0 +1,377 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.StorageTaskAssignmentInstancesReportsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageTaskReportInstanceInner; +import com.azure.resourcemanager.storage.generated.models.StorageTaskReportSummary; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * StorageTaskAssignmentInstancesReportsClient. + */ +public final class StorageTaskAssignmentInstancesReportsClientImpl + implements StorageTaskAssignmentInstancesReportsClient { + /** + * The proxy service used to perform REST calls. + */ + private final StorageTaskAssignmentInstancesReportsService service; + + /** + * The service client containing this operation class. + */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of StorageTaskAssignmentInstancesReportsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + StorageTaskAssignmentInstancesReportsClientImpl(StorageManagementClientImpl client) { + this.service = RestProxy.create(StorageTaskAssignmentInstancesReportsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientStorageTaskAssignmentInstancesReports to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + public interface StorageTaskAssignmentInstancesReportsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}/reports") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("storageTaskAssignmentName") String storageTaskAssignmentName, + @QueryParam("$maxpagesize") Integer maxpagesize, @QueryParam("$filter") String filter, + @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Fetch the report summary of a single storage task assignment's instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment instances to be included in + * the list response. + * @param filter Optional. When specified, it can be used to query using reporting properties. See [Constructing + * Filter + * Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) + * for details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return fetch Storage Tasks Run Summary along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName, String storageTaskAssignmentName, Integer maxpagesize, String filter) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (storageTaskAssignmentName == null) { + return Mono.error( + new IllegalArgumentException("Parameter storageTaskAssignmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, accountName, storageTaskAssignmentName, maxpagesize, filter, + 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())); + } + + /** + * Fetch the report summary of a single storage task assignment's instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment instances to be included in + * the list response. + * @param filter Optional. When specified, it can be used to query using reporting properties. See [Constructing + * Filter + * Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) + * for details. + * @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 fetch Storage Tasks Run Summary along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName, String storageTaskAssignmentName, Integer maxpagesize, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (storageTaskAssignmentName == null) { + return Mono.error( + new IllegalArgumentException("Parameter storageTaskAssignmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, + storageTaskAssignmentName, maxpagesize, filter, this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Fetch the report summary of a single storage task assignment's instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment instances to be included in + * the list response. + * @param filter Optional. When specified, it can be used to query using reporting properties. See [Constructing + * Filter + * Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) + * for details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return fetch Storage Tasks Run Summary as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, + String storageTaskAssignmentName, Integer maxpagesize, String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, storageTaskAssignmentName, maxpagesize, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Fetch the report summary of a single storage task assignment's instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return fetch Storage Tasks Run Summary as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, + String storageTaskAssignmentName) { + final Integer maxpagesize = null; + final String filter = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, storageTaskAssignmentName, maxpagesize, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Fetch the report summary of a single storage task assignment's instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment instances to be included in + * the list response. + * @param filter Optional. When specified, it can be used to query using reporting properties. See [Constructing + * Filter + * Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) + * for details. + * @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 fetch Storage Tasks Run Summary as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, + String storageTaskAssignmentName, Integer maxpagesize, String filter, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, storageTaskAssignmentName, + maxpagesize, filter, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Fetch the report summary of a single storage task assignment's instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, + String storageTaskAssignmentName) { + final Integer maxpagesize = null; + final String filter = null; + return new PagedIterable<>( + listAsync(resourceGroupName, accountName, storageTaskAssignmentName, maxpagesize, filter)); + } + + /** + * Fetch the report summary of a single storage task assignment's instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment instances to be included in + * the list response. + * @param filter Optional. When specified, it can be used to query using reporting properties. See [Constructing + * Filter + * Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) + * for details. + * @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 fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, + String storageTaskAssignmentName, Integer maxpagesize, String filter, Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, accountName, storageTaskAssignmentName, maxpagesize, filter, 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 fetch Storage Tasks Run Summary 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 fetch Storage Tasks Run Summary 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/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageTaskAssignmentInstancesReportsImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageTaskAssignmentInstancesReportsImpl.java new file mode 100644 index 0000000000000..16686e8be1143 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageTaskAssignmentInstancesReportsImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.StorageTaskAssignmentInstancesReportsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageTaskReportInstanceInner; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignmentInstancesReports; +import com.azure.resourcemanager.storage.generated.models.StorageTaskReportInstance; + +public final class StorageTaskAssignmentInstancesReportsImpl implements StorageTaskAssignmentInstancesReports { + private static final ClientLogger LOGGER = new ClientLogger(StorageTaskAssignmentInstancesReportsImpl.class); + + private final StorageTaskAssignmentInstancesReportsClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public StorageTaskAssignmentInstancesReportsImpl(StorageTaskAssignmentInstancesReportsClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName, + String storageTaskAssignmentName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName, storageTaskAssignmentName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskReportInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, + String storageTaskAssignmentName, Integer maxpagesize, String filter, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, accountName, storageTaskAssignmentName, maxpagesize, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskReportInstanceImpl(inner1, this.manager())); + } + + private StorageTaskAssignmentInstancesReportsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageTaskAssignmentsClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageTaskAssignmentsClientImpl.java new file mode 100644 index 0000000000000..9dd0c257d80da --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageTaskAssignmentsClientImpl.java @@ -0,0 +1,1383 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.StorageTaskAssignmentsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageTaskAssignmentInner; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignmentUpdateParameters; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignmentsList; +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 StorageTaskAssignmentsClient. + */ +public final class StorageTaskAssignmentsClientImpl implements StorageTaskAssignmentsClient { + /** + * The proxy service used to perform REST calls. + */ + private final StorageTaskAssignmentsService service; + + /** + * The service client containing this operation class. + */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of StorageTaskAssignmentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + StorageTaskAssignmentsClientImpl(StorageManagementClientImpl client) { + this.service = RestProxy.create(StorageTaskAssignmentsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientStorageTaskAssignments to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + public interface StorageTaskAssignmentsService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("storageTaskAssignmentName") String storageTaskAssignmentName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StorageTaskAssignmentInner parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("storageTaskAssignmentName") String storageTaskAssignmentName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StorageTaskAssignmentUpdateParameters parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("storageTaskAssignmentName") String storageTaskAssignmentName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("storageTaskAssignmentName") String storageTaskAssignmentName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("$maxpagesize") Integer maxpagesize, @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Asynchronously creates a new storage task assignment sub-resource with the specified parameters. If a storage + * task assignment is already created and a subsequent create request is issued with different properties, the + * storage task assignment properties will be updated. If a storage task assignment is already created and a + * subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to create a Storage Task Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 storage task assignment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String accountName, + String storageTaskAssignmentName, StorageTaskAssignmentInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (storageTaskAssignmentName == null) { + return Mono.error( + new IllegalArgumentException("Parameter storageTaskAssignmentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, storageTaskAssignmentName, this.client.getApiVersion(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Asynchronously creates a new storage task assignment sub-resource with the specified parameters. If a storage + * task assignment is already created and a subsequent create request is issued with different properties, the + * storage task assignment properties will be updated. If a storage task assignment is already created and a + * subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to create a Storage Task Assignment. + * @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 storage task assignment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String accountName, + String storageTaskAssignmentName, StorageTaskAssignmentInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (storageTaskAssignmentName == null) { + return Mono.error( + new IllegalArgumentException("Parameter storageTaskAssignmentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, storageTaskAssignmentName, this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Asynchronously creates a new storage task assignment sub-resource with the specified parameters. If a storage + * task assignment is already created and a subsequent create request is issued with different properties, the + * storage task assignment properties will be updated. If a storage task assignment is already created and a + * subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to create a Storage Task Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the storage task assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StorageTaskAssignmentInner> beginCreateAsync( + String resourceGroupName, String accountName, String storageTaskAssignmentName, + StorageTaskAssignmentInner parameters) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, accountName, storageTaskAssignmentName, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), StorageTaskAssignmentInner.class, StorageTaskAssignmentInner.class, + this.client.getContext()); + } + + /** + * Asynchronously creates a new storage task assignment sub-resource with the specified parameters. If a storage + * task assignment is already created and a subsequent create request is issued with different properties, the + * storage task assignment properties will be updated. If a storage task assignment is already created and a + * subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to create a Storage Task Assignment. + * @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 the storage task assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StorageTaskAssignmentInner> beginCreateAsync( + String resourceGroupName, String accountName, String storageTaskAssignmentName, + StorageTaskAssignmentInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, accountName, storageTaskAssignmentName, parameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), StorageTaskAssignmentInner.class, StorageTaskAssignmentInner.class, context); + } + + /** + * Asynchronously creates a new storage task assignment sub-resource with the specified parameters. If a storage + * task assignment is already created and a subsequent create request is issued with different properties, the + * storage task assignment properties will be updated. If a storage task assignment is already created and a + * subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to create a Storage Task Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the storage task assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageTaskAssignmentInner> beginCreate( + String resourceGroupName, String accountName, String storageTaskAssignmentName, + StorageTaskAssignmentInner parameters) { + return this.beginCreateAsync(resourceGroupName, accountName, storageTaskAssignmentName, parameters) + .getSyncPoller(); + } + + /** + * Asynchronously creates a new storage task assignment sub-resource with the specified parameters. If a storage + * task assignment is already created and a subsequent create request is issued with different properties, the + * storage task assignment properties will be updated. If a storage task assignment is already created and a + * subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to create a Storage Task Assignment. + * @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 the storage task assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageTaskAssignmentInner> beginCreate( + String resourceGroupName, String accountName, String storageTaskAssignmentName, + StorageTaskAssignmentInner parameters, Context context) { + return this.beginCreateAsync(resourceGroupName, accountName, storageTaskAssignmentName, parameters, context) + .getSyncPoller(); + } + + /** + * Asynchronously creates a new storage task assignment sub-resource with the specified parameters. If a storage + * task assignment is already created and a subsequent create request is issued with different properties, the + * storage task assignment properties will be updated. If a storage task assignment is already created and a + * subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to create a Storage Task Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 storage task assignment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String accountName, + String storageTaskAssignmentName, StorageTaskAssignmentInner parameters) { + return beginCreateAsync(resourceGroupName, accountName, storageTaskAssignmentName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Asynchronously creates a new storage task assignment sub-resource with the specified parameters. If a storage + * task assignment is already created and a subsequent create request is issued with different properties, the + * storage task assignment properties will be updated. If a storage task assignment is already created and a + * subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to create a Storage Task Assignment. + * @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 storage task assignment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String accountName, + String storageTaskAssignmentName, StorageTaskAssignmentInner parameters, Context context) { + return beginCreateAsync(resourceGroupName, accountName, storageTaskAssignmentName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Asynchronously creates a new storage task assignment sub-resource with the specified parameters. If a storage + * task assignment is already created and a subsequent create request is issued with different properties, the + * storage task assignment properties will be updated. If a storage task assignment is already created and a + * subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to create a Storage Task Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 storage task assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageTaskAssignmentInner create(String resourceGroupName, String accountName, + String storageTaskAssignmentName, StorageTaskAssignmentInner parameters) { + return createAsync(resourceGroupName, accountName, storageTaskAssignmentName, parameters).block(); + } + + /** + * Asynchronously creates a new storage task assignment sub-resource with the specified parameters. If a storage + * task assignment is already created and a subsequent create request is issued with different properties, the + * storage task assignment properties will be updated. If a storage task assignment is already created and a + * subsequent create or update request is issued with the exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to create a Storage Task Assignment. + * @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 storage task assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageTaskAssignmentInner create(String resourceGroupName, String accountName, + String storageTaskAssignmentName, StorageTaskAssignmentInner parameters, Context context) { + return createAsync(resourceGroupName, accountName, storageTaskAssignmentName, parameters, context).block(); + } + + /** + * Update storage task assignment properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to update a Storage Task Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 storage task assignment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String accountName, + String storageTaskAssignmentName, StorageTaskAssignmentUpdateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (storageTaskAssignmentName == null) { + return Mono.error( + new IllegalArgumentException("Parameter storageTaskAssignmentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, storageTaskAssignmentName, this.client.getApiVersion(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update storage task assignment properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to update a Storage Task Assignment. + * @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 storage task assignment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String accountName, + String storageTaskAssignmentName, StorageTaskAssignmentUpdateParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (storageTaskAssignmentName == null) { + return Mono.error( + new IllegalArgumentException("Parameter storageTaskAssignmentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, storageTaskAssignmentName, this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Update storage task assignment properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to update a Storage Task Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the storage task assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StorageTaskAssignmentInner> beginUpdateAsync( + String resourceGroupName, String accountName, String storageTaskAssignmentName, + StorageTaskAssignmentUpdateParameters parameters) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, accountName, storageTaskAssignmentName, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), StorageTaskAssignmentInner.class, StorageTaskAssignmentInner.class, + this.client.getContext()); + } + + /** + * Update storage task assignment properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to update a Storage Task Assignment. + * @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 the storage task assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StorageTaskAssignmentInner> beginUpdateAsync( + String resourceGroupName, String accountName, String storageTaskAssignmentName, + StorageTaskAssignmentUpdateParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, accountName, storageTaskAssignmentName, parameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), StorageTaskAssignmentInner.class, StorageTaskAssignmentInner.class, context); + } + + /** + * Update storage task assignment properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to update a Storage Task Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the storage task assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageTaskAssignmentInner> beginUpdate( + String resourceGroupName, String accountName, String storageTaskAssignmentName, + StorageTaskAssignmentUpdateParameters parameters) { + return this.beginUpdateAsync(resourceGroupName, accountName, storageTaskAssignmentName, parameters) + .getSyncPoller(); + } + + /** + * Update storage task assignment properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to update a Storage Task Assignment. + * @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 the storage task assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageTaskAssignmentInner> beginUpdate( + String resourceGroupName, String accountName, String storageTaskAssignmentName, + StorageTaskAssignmentUpdateParameters parameters, Context context) { + return this.beginUpdateAsync(resourceGroupName, accountName, storageTaskAssignmentName, parameters, context) + .getSyncPoller(); + } + + /** + * Update storage task assignment properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to update a Storage Task Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 storage task assignment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String accountName, + String storageTaskAssignmentName, StorageTaskAssignmentUpdateParameters parameters) { + return beginUpdateAsync(resourceGroupName, accountName, storageTaskAssignmentName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update storage task assignment properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to update a Storage Task Assignment. + * @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 storage task assignment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String accountName, + String storageTaskAssignmentName, StorageTaskAssignmentUpdateParameters parameters, Context context) { + return beginUpdateAsync(resourceGroupName, accountName, storageTaskAssignmentName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update storage task assignment properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to update a Storage Task Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 storage task assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageTaskAssignmentInner update(String resourceGroupName, String accountName, + String storageTaskAssignmentName, StorageTaskAssignmentUpdateParameters parameters) { + return updateAsync(resourceGroupName, accountName, storageTaskAssignmentName, parameters).block(); + } + + /** + * Update storage task assignment properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param parameters The parameters to update a Storage Task Assignment. + * @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 storage task assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageTaskAssignmentInner update(String resourceGroupName, String accountName, + String storageTaskAssignmentName, StorageTaskAssignmentUpdateParameters parameters, Context context) { + return updateAsync(resourceGroupName, accountName, storageTaskAssignmentName, parameters, context).block(); + } + + /** + * Get the storage task assignment properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 storage task assignment properties along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String storageTaskAssignmentName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (storageTaskAssignmentName == null) { + return Mono.error( + new IllegalArgumentException("Parameter storageTaskAssignmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, storageTaskAssignmentName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the storage task assignment properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @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 storage task assignment properties along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String storageTaskAssignmentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (storageTaskAssignmentName == null) { + return Mono.error( + new IllegalArgumentException("Parameter storageTaskAssignmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, + storageTaskAssignmentName, this.client.getApiVersion(), accept, context); + } + + /** + * Get the storage task assignment properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 storage task assignment properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, + String storageTaskAssignmentName) { + return getWithResponseAsync(resourceGroupName, accountName, storageTaskAssignmentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the storage task assignment properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @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 storage task assignment properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, + String storageTaskAssignmentName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, storageTaskAssignmentName, context).block(); + } + + /** + * Get the storage task assignment properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 storage task assignment properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageTaskAssignmentInner get(String resourceGroupName, String accountName, + String storageTaskAssignmentName) { + return getWithResponse(resourceGroupName, accountName, storageTaskAssignmentName, Context.NONE).getValue(); + } + + /** + * Delete the storage task assignment sub-resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 accountName, + String storageTaskAssignmentName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (storageTaskAssignmentName == null) { + return Mono.error( + new IllegalArgumentException("Parameter storageTaskAssignmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, storageTaskAssignmentName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the storage task assignment sub-resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @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 accountName, + String storageTaskAssignmentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (storageTaskAssignmentName == null) { + return Mono.error( + new IllegalArgumentException("Parameter storageTaskAssignmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, storageTaskAssignmentName, this.client.getApiVersion(), accept, context); + } + + /** + * Delete the storage task assignment sub-resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 accountName, + String storageTaskAssignmentName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, accountName, storageTaskAssignmentName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete the storage task assignment sub-resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @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 accountName, + String storageTaskAssignmentName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, accountName, storageTaskAssignmentName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete the storage task assignment sub-resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 accountName, + String storageTaskAssignmentName) { + return this.beginDeleteAsync(resourceGroupName, accountName, storageTaskAssignmentName).getSyncPoller(); + } + + /** + * Delete the storage task assignment sub-resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @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 accountName, + String storageTaskAssignmentName, Context context) { + return this.beginDeleteAsync(resourceGroupName, accountName, storageTaskAssignmentName, context) + .getSyncPoller(); + } + + /** + * Delete the storage task assignment sub-resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 accountName, String storageTaskAssignmentName) { + return beginDeleteAsync(resourceGroupName, accountName, storageTaskAssignmentName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the storage task assignment sub-resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @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 accountName, String storageTaskAssignmentName, + Context context) { + return beginDeleteAsync(resourceGroupName, accountName, storageTaskAssignmentName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the storage task assignment sub-resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String storageTaskAssignmentName) { + deleteAsync(resourceGroupName, accountName, storageTaskAssignmentName).block(); + } + + /** + * Delete the storage task assignment sub-resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String storageTaskAssignmentName, + Context context) { + deleteAsync(resourceGroupName, accountName, storageTaskAssignmentName, context).block(); + } + + /** + * List all the storage task assignments in an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the + * list response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of storage task assignments for the storage account along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName, Integer maxpagesize) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, accountName, maxpagesize, 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 all the storage task assignments in an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the + * list response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of storage task assignments for the storage account along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName, Integer maxpagesize, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, + maxpagesize, this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List all the storage task assignments in an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the + * list response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of storage task assignments for the storage account as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, + Integer maxpagesize) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all the storage task assignments in an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of storage task assignments for the storage account as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + final Integer maxpagesize = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all the storage task assignments in an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the + * list response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of storage task assignments for the storage account as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, + Integer maxpagesize, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all the storage task assignments in an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of storage task assignments for the storage account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + final Integer maxpagesize = null; + return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize)); + } + + /** + * List all the storage task assignments in an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the + * list response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of storage task assignments for the storage account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, + Integer maxpagesize, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, 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 list of storage task assignments for the storage account 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 list of storage task assignments for the storage account 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/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageTaskAssignmentsImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageTaskAssignmentsImpl.java new file mode 100644 index 0000000000000..59d98de0a8b0d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageTaskAssignmentsImpl.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.StorageTaskAssignmentsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageTaskAssignmentInner; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignment; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignments; + +public final class StorageTaskAssignmentsImpl implements StorageTaskAssignments { + private static final ClientLogger LOGGER = new ClientLogger(StorageTaskAssignmentsImpl.class); + + private final StorageTaskAssignmentsClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public StorageTaskAssignmentsImpl(StorageTaskAssignmentsClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String accountName, + String storageTaskAssignmentName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, accountName, storageTaskAssignmentName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new StorageTaskAssignmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public StorageTaskAssignment get(String resourceGroupName, String accountName, String storageTaskAssignmentName) { + StorageTaskAssignmentInner inner + = this.serviceClient().get(resourceGroupName, accountName, storageTaskAssignmentName); + if (inner != null) { + return new StorageTaskAssignmentImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String storageTaskAssignmentName) { + this.serviceClient().delete(resourceGroupName, accountName, storageTaskAssignmentName); + } + + public void delete(String resourceGroupName, String accountName, String storageTaskAssignmentName, + Context context) { + this.serviceClient().delete(resourceGroupName, accountName, storageTaskAssignmentName, context); + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Integer maxpagesize, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName, maxpagesize, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskAssignmentImpl(inner1, this.manager())); + } + + public StorageTaskAssignment 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String storageTaskAssignmentName = ResourceManagerUtils.getValueFromIdByName(id, "storageTaskAssignments"); + if (storageTaskAssignmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'storageTaskAssignments'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, storageTaskAssignmentName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String storageTaskAssignmentName = ResourceManagerUtils.getValueFromIdByName(id, "storageTaskAssignments"); + if (storageTaskAssignmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'storageTaskAssignments'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, storageTaskAssignmentName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String storageTaskAssignmentName = ResourceManagerUtils.getValueFromIdByName(id, "storageTaskAssignments"); + if (storageTaskAssignmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'storageTaskAssignments'.", id))); + } + this.delete(resourceGroupName, accountName, storageTaskAssignmentName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String storageTaskAssignmentName = ResourceManagerUtils.getValueFromIdByName(id, "storageTaskAssignments"); + if (storageTaskAssignmentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'storageTaskAssignments'.", id))); + } + this.delete(resourceGroupName, accountName, storageTaskAssignmentName, context); + } + + private StorageTaskAssignmentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public StorageTaskAssignmentImpl define(String name) { + return new StorageTaskAssignmentImpl(name, this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageTaskAssignmentsInstancesReportsClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageTaskAssignmentsInstancesReportsClientImpl.java new file mode 100644 index 0000000000000..3a111d978f20f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageTaskAssignmentsInstancesReportsClientImpl.java @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.StorageTaskAssignmentsInstancesReportsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageTaskReportInstanceInner; +import com.azure.resourcemanager.storage.generated.models.StorageTaskReportSummary; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * StorageTaskAssignmentsInstancesReportsClient. + */ +public final class StorageTaskAssignmentsInstancesReportsClientImpl + implements StorageTaskAssignmentsInstancesReportsClient { + /** + * The proxy service used to perform REST calls. + */ + private final StorageTaskAssignmentsInstancesReportsService service; + + /** + * The service client containing this operation class. + */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of StorageTaskAssignmentsInstancesReportsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + StorageTaskAssignmentsInstancesReportsClientImpl(StorageManagementClientImpl client) { + this.service = RestProxy.create(StorageTaskAssignmentsInstancesReportsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientStorageTaskAssignmentsInstancesReports to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + public interface StorageTaskAssignmentsInstancesReportsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/reports") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("$maxpagesize") Integer maxpagesize, @QueryParam("$filter") String filter, + @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Fetch the report summary of all the storage task assignments and instances in an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment instances to be included in + * the list response. + * @param filter Optional. When specified, it can be used to query using reporting properties. See [Constructing + * Filter + * Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) + * for details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return fetch Storage Tasks Run Summary along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName, Integer maxpagesize, String filter) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, accountName, maxpagesize, filter, 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())); + } + + /** + * Fetch the report summary of all the storage task assignments and instances in an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment instances to be included in + * the list response. + * @param filter Optional. When specified, it can be used to query using reporting properties. See [Constructing + * Filter + * Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) + * for details. + * @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 fetch Storage Tasks Run Summary along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName, Integer maxpagesize, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, + maxpagesize, filter, this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Fetch the report summary of all the storage task assignments and instances in an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment instances to be included in + * the list response. + * @param filter Optional. When specified, it can be used to query using reporting properties. See [Constructing + * Filter + * Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) + * for details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return fetch Storage Tasks Run Summary as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, + Integer maxpagesize, String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Fetch the report summary of all the storage task assignments and instances in an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return fetch Storage Tasks Run Summary as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + final Integer maxpagesize = null; + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Fetch the report summary of all the storage task assignments and instances in an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment instances to be included in + * the list response. + * @param filter Optional. When specified, it can be used to query using reporting properties. See [Constructing + * Filter + * Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) + * for details. + * @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 fetch Storage Tasks Run Summary as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, + Integer maxpagesize, String filter, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Fetch the report summary of all the storage task assignments and instances in an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + final Integer maxpagesize = null; + final String filter = null; + return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter)); + } + + /** + * Fetch the report summary of all the storage task assignments and instances in an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment instances to be included in + * the list response. + * @param filter Optional. When specified, it can be used to query using reporting properties. See [Constructing + * Filter + * Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) + * for details. + * @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 fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, + Integer maxpagesize, String filter, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter, 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 fetch Storage Tasks Run Summary 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 fetch Storage Tasks Run Summary 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/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageTaskAssignmentsInstancesReportsImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageTaskAssignmentsInstancesReportsImpl.java new file mode 100644 index 0000000000000..34115866d1d8e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageTaskAssignmentsInstancesReportsImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.StorageTaskAssignmentsInstancesReportsClient; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageTaskReportInstanceInner; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignmentsInstancesReports; +import com.azure.resourcemanager.storage.generated.models.StorageTaskReportInstance; + +public final class StorageTaskAssignmentsInstancesReportsImpl implements StorageTaskAssignmentsInstancesReports { + private static final ClientLogger LOGGER = new ClientLogger(StorageTaskAssignmentsInstancesReportsImpl.class); + + private final StorageTaskAssignmentsInstancesReportsClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public StorageTaskAssignmentsInstancesReportsImpl(StorageTaskAssignmentsInstancesReportsClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskReportInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, + Integer maxpagesize, String filter, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName, maxpagesize, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskReportInstanceImpl(inner1, this.manager())); + } + + private StorageTaskAssignmentsInstancesReportsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageTaskReportInstanceImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageTaskReportInstanceImpl.java new file mode 100644 index 0000000000000..293953bae12e2 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageTaskReportInstanceImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.StorageTaskReportInstanceInner; +import com.azure.resourcemanager.storage.generated.models.StorageTaskReportInstance; +import com.azure.resourcemanager.storage.generated.models.StorageTaskReportProperties; + +public final class StorageTaskReportInstanceImpl implements StorageTaskReportInstance { + private StorageTaskReportInstanceInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + StorageTaskReportInstanceImpl(StorageTaskReportInstanceInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public StorageTaskReportProperties properties() { + return this.innerModel().properties(); + } + + public StorageTaskReportInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableImpl.java new file mode 100644 index 0000000000000..0441667d61100 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableImpl.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.TableInner; +import com.azure.resourcemanager.storage.generated.models.Table; +import com.azure.resourcemanager.storage.generated.models.TableSignedIdentifier; +import java.util.Collections; +import java.util.List; + +public final class TableImpl implements Table, Table.Definition, Table.Update { + private TableInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String tableName() { + return this.innerModel().tableName(); + } + + public List signedIdentifiers() { + List inner = this.innerModel().signedIdentifiers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public TableInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String tableName; + + public TableImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public Table create() { + this.innerObject = serviceManager.serviceClient() + .getTables() + .createWithResponse(resourceGroupName, accountName, tableName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Table create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getTables() + .createWithResponse(resourceGroupName, accountName, tableName, this.innerModel(), context) + .getValue(); + return this; + } + + TableImpl(String name, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new TableInner(); + this.serviceManager = serviceManager; + this.tableName = name; + } + + public TableImpl update() { + return this; + } + + public Table apply() { + this.innerObject = serviceManager.serviceClient() + .getTables() + .updateWithResponse(resourceGroupName, accountName, tableName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Table apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getTables() + .updateWithResponse(resourceGroupName, accountName, tableName, this.innerModel(), context) + .getValue(); + return this; + } + + TableImpl(TableInner innerObject, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.tableName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "tables"); + } + + public Table refresh() { + this.innerObject = serviceManager.serviceClient() + .getTables() + .getWithResponse(resourceGroupName, accountName, tableName, Context.NONE) + .getValue(); + return this; + } + + public Table refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getTables() + .getWithResponse(resourceGroupName, accountName, tableName, context) + .getValue(); + return this; + } + + public TableImpl withSignedIdentifiers(List signedIdentifiers) { + this.innerModel().withSignedIdentifiers(signedIdentifiers); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableServicePropertiesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableServicePropertiesImpl.java new file mode 100644 index 0000000000000..75ad88526a50c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableServicePropertiesImpl.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.TableServicePropertiesInner; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.azure.resourcemanager.storage.generated.models.TableServiceProperties; + +public final class TableServicePropertiesImpl + implements TableServiceProperties, TableServiceProperties.Definition, TableServiceProperties.Update { + private TableServicePropertiesInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public CorsRules cors() { + return this.innerModel().cors(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public TableServicePropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + public TableServicePropertiesImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public TableServiceProperties create() { + this.innerObject = serviceManager.serviceClient() + .getTableServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public TableServiceProperties create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getTableServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), context) + .getValue(); + return this; + } + + TableServicePropertiesImpl(com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = new TableServicePropertiesInner(); + this.serviceManager = serviceManager; + } + + public TableServicePropertiesImpl update() { + return this; + } + + public TableServiceProperties apply() { + this.innerObject = serviceManager.serviceClient() + .getTableServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public TableServiceProperties apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getTableServices() + .setServicePropertiesWithResponse(resourceGroupName, accountName, this.innerModel(), context) + .getValue(); + return this; + } + + TableServicePropertiesImpl(TableServicePropertiesInner innerObject, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + } + + public TableServiceProperties refresh() { + this.innerObject = serviceManager.serviceClient() + .getTableServices() + .getServicePropertiesWithResponse(resourceGroupName, accountName, Context.NONE) + .getValue(); + return this; + } + + public TableServiceProperties refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getTableServices() + .getServicePropertiesWithResponse(resourceGroupName, accountName, context) + .getValue(); + return this; + } + + public TableServicePropertiesImpl withCors(CorsRules cors) { + this.innerModel().withCors(cors); + return this; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableServicesClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableServicesClientImpl.java new file mode 100644 index 0000000000000..c7f6ff9a5c401 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableServicesClientImpl.java @@ -0,0 +1,521 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.annotation.BodyParam; +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.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.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.storage.generated.fluent.TableServicesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.ListTableServicesInner; +import com.azure.resourcemanager.storage.generated.fluent.models.TableServicePropertiesInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in TableServicesClient. + */ +public final class TableServicesClientImpl implements TableServicesClient { + /** + * The proxy service used to perform REST calls. + */ + private final TableServicesService service; + + /** + * The service client containing this operation class. + */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of TableServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TableServicesClientImpl(StorageManagementClientImpl client) { + this.service + = RestProxy.create(TableServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientTableServices to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + public interface TableServicesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> setServiceProperties(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("tableServiceName") String tableServiceName, + @BodyParam("application/json") TableServicePropertiesInner parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getServiceProperties(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("tableServiceName") String tableServiceName, @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List all table services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all table services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, String accountName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + } + + /** + * List all table services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String accountName) { + return listWithResponseAsync(resourceGroupName, accountName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List all table services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, String accountName, + Context context) { + return listWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * List all table services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ListTableServicesInner list(String resourceGroupName, String accountName) { + return listWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Table service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of a storage account’s Table service along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> setServicePropertiesWithResponseAsync(String resourceGroupName, + String accountName, TableServicePropertiesInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String tableServiceName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.setServiceProperties(this.client.getEndpoint(), resourceGroupName, + accountName, this.client.getApiVersion(), this.client.getSubscriptionId(), tableServiceName, parameters, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Table service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @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 properties of a storage account’s Table service along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> setServicePropertiesWithResponseAsync(String resourceGroupName, + String accountName, TableServicePropertiesInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String tableServiceName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.setServiceProperties(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), tableServiceName, parameters, accept, + context); + } + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Table service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of a storage account’s Table service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setServicePropertiesAsync(String resourceGroupName, String accountName, + TableServicePropertiesInner parameters) { + return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Table service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @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 properties of a storage account’s Table service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response setServicePropertiesWithResponse(String resourceGroupName, + String accountName, TableServicePropertiesInner parameters, Context context) { + return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The properties of a storage account’s Table service, only properties for Storage Analytics and + * CORS (Cross-Origin Resource Sharing) rules can be specified. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of a storage account’s Table service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TableServicePropertiesInner setServiceProperties(String resourceGroupName, String accountName, + TableServicePropertiesInner parameters) { + return setServicePropertiesWithResponse(resourceGroupName, accountName, parameters, Context.NONE).getValue(); + } + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getServicePropertiesWithResponseAsync(String resourceGroupName, + String accountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String tableServiceName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getServiceProperties(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), tableServiceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getServicePropertiesWithResponseAsync(String resourceGroupName, + String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String tableServiceName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getServiceProperties(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), tableServiceName, accept, context); + } + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getServicePropertiesAsync(String resourceGroupName, String accountName) { + return getServicePropertiesWithResponseAsync(resourceGroupName, accountName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getServicePropertiesWithResponse(String resourceGroupName, + String accountName, Context context) { + return getServicePropertiesWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TableServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName) { + return getServicePropertiesWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableServicesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableServicesImpl.java new file mode 100644 index 0000000000000..d499e2cffb049 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableServicesImpl.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.TableServicesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.ListTableServicesInner; +import com.azure.resourcemanager.storage.generated.fluent.models.TableServicePropertiesInner; +import com.azure.resourcemanager.storage.generated.models.ListTableServices; +import com.azure.resourcemanager.storage.generated.models.TableServiceProperties; +import com.azure.resourcemanager.storage.generated.models.TableServices; + +public final class TableServicesImpl implements TableServices { + private static final ClientLogger LOGGER = new ClientLogger(TableServicesImpl.class); + + private final TableServicesClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public TableServicesImpl(TableServicesClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listWithResponse(String resourceGroupName, String accountName, Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ListTableServicesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ListTableServices list(String resourceGroupName, String accountName) { + ListTableServicesInner inner = this.serviceClient().list(resourceGroupName, accountName); + if (inner != null) { + return new ListTableServicesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getServicePropertiesWithResponse(String resourceGroupName, + String accountName, Context context) { + Response inner + = this.serviceClient().getServicePropertiesWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new TableServicePropertiesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public TableServiceProperties getServiceProperties(String resourceGroupName, String accountName) { + TableServicePropertiesInner inner = this.serviceClient().getServiceProperties(resourceGroupName, accountName); + if (inner != null) { + return new TableServicePropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public TableServiceProperties getServicePropertiesById(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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + return this.getServicePropertiesWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } + + public Response getServicePropertiesByIdWithResponse(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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + return this.getServicePropertiesWithResponse(resourceGroupName, accountName, context); + } + + private TableServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public TableServicePropertiesImpl define() { + return new TableServicePropertiesImpl(this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TablesClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TablesClientImpl.java new file mode 100644 index 0000000000000..21b3ed12686d8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TablesClientImpl.java @@ -0,0 +1,935 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.storage.generated.fluent.TablesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.TableInner; +import com.azure.resourcemanager.storage.generated.models.ListTableResource; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in TablesClient. + */ +public final class TablesClientImpl implements TablesClient { + /** + * The proxy service used to perform REST calls. + */ + private final TablesService service; + + /** + * The service client containing this operation class. + */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of TablesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TablesClientImpl(StorageManagementClientImpl client) { + this.service = RestProxy.create(TablesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientTables to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + public interface TablesService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("tableName") String tableName, @BodyParam("application/json") TableInner parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("tableName") String tableName, @BodyParam("application/json") TableInner parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("tableName") String tableName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("tableName") String tableName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @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> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @param parameters The parameters to provide to create a table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the table, including Id, resource name, resource type along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, String accountName, + String tableName, TableInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), tableName, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @param parameters The parameters to provide to create a table. + * @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 properties of the table, including Id, resource name, resource type along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, String accountName, + String tableName, TableInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), tableName, parameters, accept, context); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the table, including Id, resource name, resource type on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String accountName, String tableName) { + final TableInner parameters = null; + return createWithResponseAsync(resourceGroupName, accountName, tableName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @param parameters The parameters to provide to create a table. + * @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 properties of the table, including Id, resource name, resource type along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse(String resourceGroupName, String accountName, String tableName, + TableInner parameters, Context context) { + return createWithResponseAsync(resourceGroupName, accountName, tableName, parameters, context).block(); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the table, including Id, resource name, resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TableInner create(String resourceGroupName, String accountName, String tableName) { + final TableInner parameters = null; + return createWithResponse(resourceGroupName, accountName, tableName, parameters, Context.NONE).getValue(); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @param parameters The parameters to provide to create a table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the table, including Id, resource name, resource type along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String accountName, + String tableName, TableInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), tableName, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @param parameters The parameters to provide to create a table. + * @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 properties of the table, including Id, resource name, resource type along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String accountName, + String tableName, TableInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), tableName, parameters, accept, context); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the table, including Id, resource name, resource type on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String accountName, String tableName) { + final TableInner parameters = null; + return updateWithResponseAsync(resourceGroupName, accountName, tableName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @param parameters The parameters to provide to create a table. + * @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 properties of the table, including Id, resource name, resource type along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String accountName, String tableName, + TableInner parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, tableName, parameters, context).block(); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the table, including Id, resource name, resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TableInner update(String resourceGroupName, String accountName, String tableName) { + final TableInner parameters = null; + return updateWithResponse(resourceGroupName, accountName, tableName, parameters, Context.NONE).getValue(); + } + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 table with the specified table name, under the specified account if it exists along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String tableName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), tableName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @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 table with the specified table name, under the specified account if it exists along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String tableName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), tableName, accept, context); + } + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 table with the specified table name, under the specified account if it exists on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String tableName) { + return getWithResponseAsync(resourceGroupName, accountName, tableName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @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 table with the specified table name, under the specified account if it exists along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, String tableName, + Context context) { + return getWithResponseAsync(resourceGroupName, accountName, tableName, context).block(); + } + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 table with the specified table name, under the specified account if it exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TableInner get(String resourceGroupName, String accountName, String tableName) { + return getWithResponse(resourceGroupName, accountName, tableName, Context.NONE).getValue(); + } + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 accountName, + String tableName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, accountName, + this.client.getApiVersion(), this.client.getSubscriptionId(), tableName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @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 accountName, String tableName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), + this.client.getSubscriptionId(), tableName, accept, context); + } + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 accountName, String tableName) { + return deleteWithResponseAsync(resourceGroupName, accountName, tableName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String accountName, String tableName, + Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, tableName, context).block(); + } + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String tableName) { + deleteWithResponse(resourceGroupName, accountName, tableName, Context.NONE); + } + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 all the tables under the specified storage account along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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(), resourceGroupName, accountName, + 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())); + } + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 all the tables under the specified storage account along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (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(), resourceGroupName, accountName, 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)); + } + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 all the tables under the specified storage account as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 all the tables under the specified storage account as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 all the tables under the specified storage account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName)); + } + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 all the tables under the specified storage account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, 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 response schema 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 response schema 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/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TablesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TablesImpl.java new file mode 100644 index 0000000000000..85c2137bf8882 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TablesImpl.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.TablesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.TableInner; +import com.azure.resourcemanager.storage.generated.models.Table; +import com.azure.resourcemanager.storage.generated.models.Tables; + +public final class TablesImpl implements Tables { + private static final ClientLogger LOGGER = new ClientLogger(TablesImpl.class); + + private final TablesClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public TablesImpl(TablesClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String accountName, String tableName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, accountName, tableName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new TableImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Table get(String resourceGroupName, String accountName, String tableName) { + TableInner inner = this.serviceClient().get(resourceGroupName, accountName, tableName); + if (inner != null) { + return new TableImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String accountName, String tableName, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, tableName, context); + } + + public void delete(String resourceGroupName, String accountName, String tableName) { + this.serviceClient().delete(resourceGroupName, accountName, tableName); + } + + public PagedIterable
list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TableImpl(inner1, this.manager())); + } + + public PagedIterable
list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TableImpl(inner1, this.manager())); + } + + public Table 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String tableName = ResourceManagerUtils.getValueFromIdByName(id, "tables"); + if (tableName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tables'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, tableName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String tableName = ResourceManagerUtils.getValueFromIdByName(id, "tables"); + if (tableName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tables'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, tableName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String tableName = ResourceManagerUtils.getValueFromIdByName(id, "tables"); + if (tableName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tables'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, tableName, Context.NONE); + } + + public Response 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "storageAccounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String tableName = ResourceManagerUtils.getValueFromIdByName(id, "tables"); + if (tableName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tables'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, tableName, context); + } + + private TablesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } + + public TableImpl define(String name) { + return new TableImpl(name, this.manager()); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/UsageImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/UsageImpl.java new file mode 100644 index 0000000000000..23e69aa9396cf --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/UsageImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.storage.generated.models.Usage; +import com.azure.resourcemanager.storage.generated.models.UsageName; +import com.azure.resourcemanager.storage.generated.models.UsageUnit; + +public final class UsageImpl implements Usage { + private UsageInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + UsageImpl(UsageInner innerObject, com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public UsageUnit unit() { + return this.innerModel().unit(); + } + + public Integer currentValue() { + return this.innerModel().currentValue(); + } + + public Integer limit() { + return this.innerModel().limit(); + } + + public UsageName name() { + return this.innerModel().name(); + } + + public UsageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/UsagesClientImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/UsagesClientImpl.java new file mode 100644 index 0000000000000..2f04e8d5baaa3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/UsagesClientImpl.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.UsagesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.storage.generated.models.UsageListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in UsagesClient. + */ +public final class UsagesClientImpl implements UsagesClient { + /** + * The proxy service used to perform REST calls. + */ + private final UsagesService service; + + /** + * The service client containing this operation class. + */ + private final StorageManagementClientImpl client; + + /** + * Initializes an instance of UsagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UsagesClientImpl(StorageManagementClientImpl client) { + this.service = RestProxy.create(UsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageManagementClientUsages to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageManagementCli") + public interface UsagesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByLocation(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage 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 current usage count and the limit for the resources of the location under the subscription along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByLocation(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage 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 current usage count and the limit for the resources of the location under the subscription along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationSinglePageAsync(String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByLocation(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + location, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), null, null)); + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage 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 current usage count and the limit for the resources of the location under the subscription as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByLocationAsync(String location) { + return new PagedFlux<>(() -> listByLocationSinglePageAsync(location)); + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage 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 current usage count and the limit for the resources of the location under the subscription as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByLocationAsync(String location, Context context) { + return new PagedFlux<>(() -> listByLocationSinglePageAsync(location, context)); + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage 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 current usage count and the limit for the resources of the location under the subscription as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByLocation(String location) { + return new PagedIterable<>(listByLocationAsync(location)); + } + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage 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 current usage count and the limit for the resources of the location under the subscription as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByLocation(String location, Context context) { + return new PagedIterable<>(listByLocationAsync(location, context)); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/UsagesImpl.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/UsagesImpl.java new file mode 100644 index 0000000000000..4d9ed0503946f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/UsagesImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.UsagesClient; +import com.azure.resourcemanager.storage.generated.fluent.models.UsageInner; +import com.azure.resourcemanager.storage.generated.models.Usage; +import com.azure.resourcemanager.storage.generated.models.Usages; + +public final class UsagesImpl implements Usages { + private static final ClientLogger LOGGER = new ClientLogger(UsagesImpl.class); + + private final UsagesClient innerClient; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + public UsagesImpl(UsagesClient innerClient, + com.azure.resourcemanager.storage.generated.StorageManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByLocation(String location) { + PagedIterable inner = this.serviceClient().listByLocation(location); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public PagedIterable listByLocation(String location, Context context) { + PagedIterable inner = this.serviceClient().listByLocation(location, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + private UsagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storage.generated.StorageManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/package-info.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/package-info.java new file mode 100644 index 0000000000000..dc7bbf24b1d46 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for StorageManagementClient. + * The Azure Storage Management API. + */ +package com.azure.resourcemanager.storage.generated.implementation; diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccessPolicy.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccessPolicy.java new file mode 100644 index 0000000000000..bbf0c0d2cd08b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccessPolicy.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +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.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * The AccessPolicy model. + */ +@Fluent +public final class AccessPolicy implements JsonSerializable { + /* + * Start time of the access policy + */ + private OffsetDateTime startTime; + + /* + * Expiry time of the access policy + */ + private OffsetDateTime expiryTime; + + /* + * List of abbreviated permissions. + */ + private String permission; + + /** + * Creates an instance of AccessPolicy class. + */ + public AccessPolicy() { + } + + /** + * Get the startTime property: Start time of the access policy. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Start time of the access policy. + * + * @param startTime the startTime value to set. + * @return the AccessPolicy object itself. + */ + public AccessPolicy withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the expiryTime property: Expiry time of the access policy. + * + * @return the expiryTime value. + */ + public OffsetDateTime expiryTime() { + return this.expiryTime; + } + + /** + * Set the expiryTime property: Expiry time of the access policy. + * + * @param expiryTime the expiryTime value to set. + * @return the AccessPolicy object itself. + */ + public AccessPolicy withExpiryTime(OffsetDateTime expiryTime) { + this.expiryTime = expiryTime; + return this; + } + + /** + * Get the permission property: List of abbreviated permissions. + * + * @return the permission value. + */ + public String permission() { + return this.permission; + } + + /** + * Set the permission property: List of abbreviated permissions. + * + * @param permission the permission value to set. + * @return the AccessPolicy object itself. + */ + public AccessPolicy withPermission(String permission) { + this.permission = permission; + 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("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + jsonWriter.writeStringField("expiryTime", + this.expiryTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiryTime)); + jsonWriter.writeStringField("permission", this.permission); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessPolicy 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 AccessPolicy. + */ + public static AccessPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessPolicy deserializedAccessPolicy = new AccessPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startTime".equals(fieldName)) { + deserializedAccessPolicy.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("expiryTime".equals(fieldName)) { + deserializedAccessPolicy.expiryTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("permission".equals(fieldName)) { + deserializedAccessPolicy.permission = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccessPolicy; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccessTier.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccessTier.java new file mode 100644 index 0000000000000..f27834c3a08a6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccessTier.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +/** + * Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access + * tier is the default value for premium block blobs storage account type and it cannot be changed for the premium block + * blobs storage account type. + */ +public enum AccessTier { + /** + * Enum value Hot. + */ + HOT("Hot"), + + /** + * Enum value Cool. + */ + COOL("Cool"), + + /** + * Enum value Premium. + */ + PREMIUM("Premium"), + + /** + * Enum value Cold. + */ + COLD("Cold"); + + /** + * The actual serialized value for a AccessTier instance. + */ + private final String value; + + AccessTier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AccessTier instance. + * + * @param value the serialized value to parse. + * @return the parsed AccessTier object, or null if unable to parse. + */ + public static AccessTier fromString(String value) { + if (value == null) { + return null; + } + AccessTier[] items = AccessTier.values(); + for (AccessTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountImmutabilityPolicyProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountImmutabilityPolicyProperties.java new file mode 100644 index 0000000000000..d18ed5fbc833c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountImmutabilityPolicyProperties.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * This defines account-level immutability policy properties. + */ +@Fluent +public final class AccountImmutabilityPolicyProperties + implements JsonSerializable { + /* + * The immutability period for the blobs in the container since the policy creation, in days. + */ + private Integer immutabilityPeriodSinceCreationInDays; + + /* + * The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state + * allows increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites + * property, Locked state only allows the increase of the immutability retention time. A policy can only be created + * in a Disabled or Unlocked state and can be toggled between the two states. Only a policy in an Unlocked state can + * transition to a Locked state which cannot be reverted. + */ + private AccountImmutabilityPolicyState state; + + /* + * This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new + * blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks + * can be added and any existing blocks cannot be modified or deleted. + */ + private Boolean allowProtectedAppendWrites; + + /** + * Creates an instance of AccountImmutabilityPolicyProperties class. + */ + public AccountImmutabilityPolicyProperties() { + } + + /** + * Get the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container + * since the policy creation, in days. + * + * @return the immutabilityPeriodSinceCreationInDays value. + */ + public Integer immutabilityPeriodSinceCreationInDays() { + return this.immutabilityPeriodSinceCreationInDays; + } + + /** + * Set the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container + * since the policy creation, in days. + * + * @param immutabilityPeriodSinceCreationInDays the immutabilityPeriodSinceCreationInDays value to set. + * @return the AccountImmutabilityPolicyProperties object itself. + */ + public AccountImmutabilityPolicyProperties + withImmutabilityPeriodSinceCreationInDays(Integer immutabilityPeriodSinceCreationInDays) { + this.immutabilityPeriodSinceCreationInDays = immutabilityPeriodSinceCreationInDays; + return this; + } + + /** + * Get the state property: The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the + * policy, Unlocked state allows increase and decrease of immutability retention time and also allows toggling + * allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. A + * policy can only be created in a Disabled or Unlocked state and can be toggled between the two states. Only a + * policy in an Unlocked state can transition to a Locked state which cannot be reverted. + * + * @return the state value. + */ + public AccountImmutabilityPolicyState state() { + return this.state; + } + + /** + * Set the state property: The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the + * policy, Unlocked state allows increase and decrease of immutability retention time and also allows toggling + * allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. A + * policy can only be created in a Disabled or Unlocked state and can be toggled between the two states. Only a + * policy in an Unlocked state can transition to a Locked state which cannot be reverted. + * + * @param state the state value to set. + * @return the AccountImmutabilityPolicyProperties object itself. + */ + public AccountImmutabilityPolicyProperties withState(AccountImmutabilityPolicyState state) { + this.state = state; + return this; + } + + /** + * Get the allowProtectedAppendWrites property: This property can only be changed for disabled and unlocked + * time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining + * immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified + * or deleted. + * + * @return the allowProtectedAppendWrites value. + */ + public Boolean allowProtectedAppendWrites() { + return this.allowProtectedAppendWrites; + } + + /** + * Set the allowProtectedAppendWrites property: This property can only be changed for disabled and unlocked + * time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining + * immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified + * or deleted. + * + * @param allowProtectedAppendWrites the allowProtectedAppendWrites value to set. + * @return the AccountImmutabilityPolicyProperties object itself. + */ + public AccountImmutabilityPolicyProperties withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites) { + this.allowProtectedAppendWrites = allowProtectedAppendWrites; + 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.writeNumberField("immutabilityPeriodSinceCreationInDays", + this.immutabilityPeriodSinceCreationInDays); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeBooleanField("allowProtectedAppendWrites", this.allowProtectedAppendWrites); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountImmutabilityPolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountImmutabilityPolicyProperties 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 AccountImmutabilityPolicyProperties. + */ + public static AccountImmutabilityPolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountImmutabilityPolicyProperties deserializedAccountImmutabilityPolicyProperties + = new AccountImmutabilityPolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("immutabilityPeriodSinceCreationInDays".equals(fieldName)) { + deserializedAccountImmutabilityPolicyProperties.immutabilityPeriodSinceCreationInDays + = reader.getNullable(JsonReader::getInt); + } else if ("state".equals(fieldName)) { + deserializedAccountImmutabilityPolicyProperties.state + = AccountImmutabilityPolicyState.fromString(reader.getString()); + } else if ("allowProtectedAppendWrites".equals(fieldName)) { + deserializedAccountImmutabilityPolicyProperties.allowProtectedAppendWrites + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountImmutabilityPolicyProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountImmutabilityPolicyState.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountImmutabilityPolicyState.java new file mode 100644 index 0000000000000..18408d02e7c18 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountImmutabilityPolicyState.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state + * allows increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites + * property, Locked state only allows the increase of the immutability retention time. A policy can only be created in a + * Disabled or Unlocked state and can be toggled between the two states. Only a policy in an Unlocked state can + * transition to a Locked state which cannot be reverted. + */ +public final class AccountImmutabilityPolicyState extends ExpandableStringEnum { + /** + * Static value Unlocked for AccountImmutabilityPolicyState. + */ + public static final AccountImmutabilityPolicyState UNLOCKED = fromString("Unlocked"); + + /** + * Static value Locked for AccountImmutabilityPolicyState. + */ + public static final AccountImmutabilityPolicyState LOCKED = fromString("Locked"); + + /** + * Static value Disabled for AccountImmutabilityPolicyState. + */ + public static final AccountImmutabilityPolicyState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of AccountImmutabilityPolicyState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccountImmutabilityPolicyState() { + } + + /** + * Creates or finds a AccountImmutabilityPolicyState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccountImmutabilityPolicyState. + */ + public static AccountImmutabilityPolicyState fromString(String name) { + return fromString(name, AccountImmutabilityPolicyState.class); + } + + /** + * Gets known AccountImmutabilityPolicyState values. + * + * @return known AccountImmutabilityPolicyState values. + */ + public static Collection values() { + return values(AccountImmutabilityPolicyState.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountLimits.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountLimits.java new file mode 100644 index 0000000000000..255b01c223b97 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountLimits.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Maximum provisioned storage, IOPS, bandwidth and number of file shares limits for the storage account. + */ +@Immutable +public final class AccountLimits implements JsonSerializable { + /* + * The maximum number of file shares limit for the storage account. + */ + private Integer maxFileShares; + + /* + * The maximum provisioned storage quota limit in gibibytes for the storage account. + */ + private Integer maxProvisionedStorageGiB; + + /* + * The maximum provisioned IOPS limit for the storage account. + */ + private Integer maxProvisionedIops; + + /* + * The maximum provisioned bandwidth limit in mebibytes per second for the storage account. + */ + private Integer maxProvisionedBandwidthMiBPerSec; + + /** + * Creates an instance of AccountLimits class. + */ + public AccountLimits() { + } + + /** + * Get the maxFileShares property: The maximum number of file shares limit for the storage account. + * + * @return the maxFileShares value. + */ + public Integer maxFileShares() { + return this.maxFileShares; + } + + /** + * Get the maxProvisionedStorageGiB property: The maximum provisioned storage quota limit in gibibytes for the + * storage account. + * + * @return the maxProvisionedStorageGiB value. + */ + public Integer maxProvisionedStorageGiB() { + return this.maxProvisionedStorageGiB; + } + + /** + * Get the maxProvisionedIops property: The maximum provisioned IOPS limit for the storage account. + * + * @return the maxProvisionedIops value. + */ + public Integer maxProvisionedIops() { + return this.maxProvisionedIops; + } + + /** + * Get the maxProvisionedBandwidthMiBPerSec property: The maximum provisioned bandwidth limit in mebibytes per + * second for the storage account. + * + * @return the maxProvisionedBandwidthMiBPerSec value. + */ + public Integer maxProvisionedBandwidthMiBPerSec() { + return this.maxProvisionedBandwidthMiBPerSec; + } + + /** + * 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 AccountLimits from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountLimits 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 AccountLimits. + */ + public static AccountLimits fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountLimits deserializedAccountLimits = new AccountLimits(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxFileShares".equals(fieldName)) { + deserializedAccountLimits.maxFileShares = reader.getNullable(JsonReader::getInt); + } else if ("maxProvisionedStorageGiB".equals(fieldName)) { + deserializedAccountLimits.maxProvisionedStorageGiB = reader.getNullable(JsonReader::getInt); + } else if ("maxProvisionedIOPS".equals(fieldName)) { + deserializedAccountLimits.maxProvisionedIops = reader.getNullable(JsonReader::getInt); + } else if ("maxProvisionedBandwidthMiBPerSec".equals(fieldName)) { + deserializedAccountLimits.maxProvisionedBandwidthMiBPerSec = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountLimits; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountSasParameters.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountSasParameters.java new file mode 100644 index 0000000000000..fd08a09e076cf --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountSasParameters.java @@ -0,0 +1,336 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +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.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * The parameters to list SAS credentials of a storage account. + */ +@Fluent +public final class AccountSasParameters implements JsonSerializable { + /* + * The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), + * File (f). + */ + private Services services; + + /* + * The signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; + * Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, + * table entities, and files. + */ + private SignedResourceTypes resourceTypes; + + /* + * The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), + * Add (a), Create (c), Update (u) and Process (p). + */ + private Permissions permissions; + + /* + * An IP address or a range of IP addresses from which to accept requests. + */ + private String ipAddressOrRange; + + /* + * The protocol permitted for a request made with the account SAS. + */ + private HttpProtocol protocols; + + /* + * The time at which the SAS becomes valid. + */ + private OffsetDateTime sharedAccessStartTime; + + /* + * The time at which the shared access signature becomes invalid. + */ + private OffsetDateTime sharedAccessExpiryTime; + + /* + * The key to sign the account SAS token with. + */ + private String keyToSign; + + /** + * Creates an instance of AccountSasParameters class. + */ + public AccountSasParameters() { + } + + /** + * Get the services property: The signed services accessible with the account SAS. Possible values include: Blob + * (b), Queue (q), Table (t), File (f). + * + * @return the services value. + */ + public Services services() { + return this.services; + } + + /** + * Set the services property: The signed services accessible with the account SAS. Possible values include: Blob + * (b), Queue (q), Table (t), File (f). + * + * @param services the services value to set. + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withServices(Services services) { + this.services = services; + return this; + } + + /** + * Get the resourceTypes property: The signed resource types that are accessible with the account SAS. Service (s): + * Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level + * APIs for blobs, queue messages, table entities, and files. + * + * @return the resourceTypes value. + */ + public SignedResourceTypes resourceTypes() { + return this.resourceTypes; + } + + /** + * Set the resourceTypes property: The signed resource types that are accessible with the account SAS. Service (s): + * Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level + * APIs for blobs, queue messages, table entities, and files. + * + * @param resourceTypes the resourceTypes value to set. + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withResourceTypes(SignedResourceTypes resourceTypes) { + this.resourceTypes = resourceTypes; + return this; + } + + /** + * Get the permissions property: The signed permissions for the account SAS. Possible values include: Read (r), + * Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). + * + * @return the permissions value. + */ + public Permissions permissions() { + return this.permissions; + } + + /** + * Set the permissions property: The signed permissions for the account SAS. Possible values include: Read (r), + * Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). + * + * @param permissions the permissions value to set. + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withPermissions(Permissions permissions) { + this.permissions = permissions; + return this; + } + + /** + * Get the ipAddressOrRange property: An IP address or a range of IP addresses from which to accept requests. + * + * @return the ipAddressOrRange value. + */ + public String ipAddressOrRange() { + return this.ipAddressOrRange; + } + + /** + * Set the ipAddressOrRange property: An IP address or a range of IP addresses from which to accept requests. + * + * @param ipAddressOrRange the ipAddressOrRange value to set. + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withIpAddressOrRange(String ipAddressOrRange) { + this.ipAddressOrRange = ipAddressOrRange; + return this; + } + + /** + * Get the protocols property: The protocol permitted for a request made with the account SAS. + * + * @return the protocols value. + */ + public HttpProtocol protocols() { + return this.protocols; + } + + /** + * Set the protocols property: The protocol permitted for a request made with the account SAS. + * + * @param protocols the protocols value to set. + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withProtocols(HttpProtocol protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get the sharedAccessStartTime property: The time at which the SAS becomes valid. + * + * @return the sharedAccessStartTime value. + */ + public OffsetDateTime sharedAccessStartTime() { + return this.sharedAccessStartTime; + } + + /** + * Set the sharedAccessStartTime property: The time at which the SAS becomes valid. + * + * @param sharedAccessStartTime the sharedAccessStartTime value to set. + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withSharedAccessStartTime(OffsetDateTime sharedAccessStartTime) { + this.sharedAccessStartTime = sharedAccessStartTime; + return this; + } + + /** + * Get the sharedAccessExpiryTime property: The time at which the shared access signature becomes invalid. + * + * @return the sharedAccessExpiryTime value. + */ + public OffsetDateTime sharedAccessExpiryTime() { + return this.sharedAccessExpiryTime; + } + + /** + * Set the sharedAccessExpiryTime property: The time at which the shared access signature becomes invalid. + * + * @param sharedAccessExpiryTime the sharedAccessExpiryTime value to set. + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withSharedAccessExpiryTime(OffsetDateTime sharedAccessExpiryTime) { + this.sharedAccessExpiryTime = sharedAccessExpiryTime; + return this; + } + + /** + * Get the keyToSign property: The key to sign the account SAS token with. + * + * @return the keyToSign value. + */ + public String keyToSign() { + return this.keyToSign; + } + + /** + * Set the keyToSign property: The key to sign the account SAS token with. + * + * @param keyToSign the keyToSign value to set. + * @return the AccountSasParameters object itself. + */ + public AccountSasParameters withKeyToSign(String keyToSign) { + this.keyToSign = keyToSign; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (services() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property services in model AccountSasParameters")); + } + if (resourceTypes() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property resourceTypes in model AccountSasParameters")); + } + if (permissions() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property permissions in model AccountSasParameters")); + } + if (sharedAccessExpiryTime() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sharedAccessExpiryTime in model AccountSasParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AccountSasParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("signedServices", this.services == null ? null : this.services.toString()); + jsonWriter.writeStringField("signedResourceTypes", + this.resourceTypes == null ? null : this.resourceTypes.toString()); + jsonWriter.writeStringField("signedPermission", this.permissions == null ? null : this.permissions.toString()); + jsonWriter.writeStringField("signedExpiry", + this.sharedAccessExpiryTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.sharedAccessExpiryTime)); + jsonWriter.writeStringField("signedIp", this.ipAddressOrRange); + jsonWriter.writeStringField("signedProtocol", this.protocols == null ? null : this.protocols.toString()); + jsonWriter.writeStringField("signedStart", + this.sharedAccessStartTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.sharedAccessStartTime)); + jsonWriter.writeStringField("keyToSign", this.keyToSign); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountSasParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountSasParameters 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 AccountSasParameters. + */ + public static AccountSasParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountSasParameters deserializedAccountSasParameters = new AccountSasParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("signedServices".equals(fieldName)) { + deserializedAccountSasParameters.services = Services.fromString(reader.getString()); + } else if ("signedResourceTypes".equals(fieldName)) { + deserializedAccountSasParameters.resourceTypes = SignedResourceTypes.fromString(reader.getString()); + } else if ("signedPermission".equals(fieldName)) { + deserializedAccountSasParameters.permissions = Permissions.fromString(reader.getString()); + } else if ("signedExpiry".equals(fieldName)) { + deserializedAccountSasParameters.sharedAccessExpiryTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("signedIp".equals(fieldName)) { + deserializedAccountSasParameters.ipAddressOrRange = reader.getString(); + } else if ("signedProtocol".equals(fieldName)) { + deserializedAccountSasParameters.protocols = HttpProtocol.fromString(reader.getString()); + } else if ("signedStart".equals(fieldName)) { + deserializedAccountSasParameters.sharedAccessStartTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("keyToSign".equals(fieldName)) { + deserializedAccountSasParameters.keyToSign = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountSasParameters; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountStatus.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountStatus.java new file mode 100644 index 0000000000000..18aaf48fc2718 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountStatus.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +/** + * Gets the status indicating whether the primary location of the storage account is available or unavailable. + */ +public enum AccountStatus { + /** + * Enum value available. + */ + AVAILABLE("available"), + + /** + * Enum value unavailable. + */ + UNAVAILABLE("unavailable"); + + /** + * The actual serialized value for a AccountStatus instance. + */ + private final String value; + + AccountStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AccountStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed AccountStatus object, or null if unable to parse. + */ + public static AccountStatus fromString(String value) { + if (value == null) { + return null; + } + AccountStatus[] items = AccountStatus.values(); + for (AccountStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountType.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountType.java new file mode 100644 index 0000000000000..b1fcd7cb5f334 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the Active Directory account type for Azure Storage. + */ +public final class AccountType extends ExpandableStringEnum { + /** + * Static value User for AccountType. + */ + public static final AccountType USER = fromString("User"); + + /** + * Static value Computer for AccountType. + */ + public static final AccountType COMPUTER = fromString("Computer"); + + /** + * Creates a new instance of AccountType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccountType() { + } + + /** + * Creates or finds a AccountType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccountType. + */ + public static AccountType fromString(String name) { + return fromString(name, AccountType.class); + } + + /** + * Gets known AccountType values. + * + * @return known AccountType values. + */ + public static Collection values() { + return values(AccountType.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountUsage.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountUsage.java new file mode 100644 index 0000000000000..38150dbfbedfd --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountUsage.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Usage of provisioned storage, IOPS, bandwidth and number of file shares across all live shares and soft-deleted + * shares in the account. + */ +@Immutable +public final class AccountUsage implements JsonSerializable { + /* + * Usage of provisioned storage, IOPS, bandwidth and number of file shares across all live shares or soft-deleted + * shares in the account. + */ + private AccountUsageElements liveShares; + + /* + * Usage of provisioned storage, IOPS, bandwidth and number of file shares across all live shares or soft-deleted + * shares in the account. + */ + private AccountUsageElements softDeletedShares; + + /** + * Creates an instance of AccountUsage class. + */ + public AccountUsage() { + } + + /** + * Get the liveShares property: Usage of provisioned storage, IOPS, bandwidth and number of file shares across all + * live shares or soft-deleted shares in the account. + * + * @return the liveShares value. + */ + public AccountUsageElements liveShares() { + return this.liveShares; + } + + /** + * Get the softDeletedShares property: Usage of provisioned storage, IOPS, bandwidth and number of file shares + * across all live shares or soft-deleted shares in the account. + * + * @return the softDeletedShares value. + */ + public AccountUsageElements softDeletedShares() { + return this.softDeletedShares; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (liveShares() != null) { + liveShares().validate(); + } + if (softDeletedShares() != null) { + softDeletedShares().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountUsage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountUsage 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 AccountUsage. + */ + public static AccountUsage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountUsage deserializedAccountUsage = new AccountUsage(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("liveShares".equals(fieldName)) { + deserializedAccountUsage.liveShares = AccountUsageElements.fromJson(reader); + } else if ("softDeletedShares".equals(fieldName)) { + deserializedAccountUsage.softDeletedShares = AccountUsageElements.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountUsage; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountUsageElements.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountUsageElements.java new file mode 100644 index 0000000000000..fd57536297f0a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountUsageElements.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Usage of provisioned storage, IOPS, bandwidth and number of file shares across all live shares or soft-deleted shares + * in the account. + */ +@Immutable +public final class AccountUsageElements implements JsonSerializable { + /* + * The total number of file shares. + */ + private Integer fileShareCount; + + /* + * The total provisioned storage quota in gibibytes. + */ + private Integer provisionedStorageGiB; + + /* + * The total provisioned IOPS. + */ + private Integer provisionedIops; + + /* + * The total provisioned bandwidth in mebibytes per second. + */ + private Integer provisionedBandwidthMiBPerSec; + + /** + * Creates an instance of AccountUsageElements class. + */ + public AccountUsageElements() { + } + + /** + * Get the fileShareCount property: The total number of file shares. + * + * @return the fileShareCount value. + */ + public Integer fileShareCount() { + return this.fileShareCount; + } + + /** + * Get the provisionedStorageGiB property: The total provisioned storage quota in gibibytes. + * + * @return the provisionedStorageGiB value. + */ + public Integer provisionedStorageGiB() { + return this.provisionedStorageGiB; + } + + /** + * Get the provisionedIops property: The total provisioned IOPS. + * + * @return the provisionedIops value. + */ + public Integer provisionedIops() { + return this.provisionedIops; + } + + /** + * Get the provisionedBandwidthMiBPerSec property: The total provisioned bandwidth in mebibytes per second. + * + * @return the provisionedBandwidthMiBPerSec value. + */ + public Integer provisionedBandwidthMiBPerSec() { + return this.provisionedBandwidthMiBPerSec; + } + + /** + * 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 AccountUsageElements from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountUsageElements 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 AccountUsageElements. + */ + public static AccountUsageElements fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountUsageElements deserializedAccountUsageElements = new AccountUsageElements(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fileShareCount".equals(fieldName)) { + deserializedAccountUsageElements.fileShareCount = reader.getNullable(JsonReader::getInt); + } else if ("provisionedStorageGiB".equals(fieldName)) { + deserializedAccountUsageElements.provisionedStorageGiB = reader.getNullable(JsonReader::getInt); + } else if ("provisionedIOPS".equals(fieldName)) { + deserializedAccountUsageElements.provisionedIops = reader.getNullable(JsonReader::getInt); + } else if ("provisionedBandwidthMiBPerSec".equals(fieldName)) { + deserializedAccountUsageElements.provisionedBandwidthMiBPerSec + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountUsageElements; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Action.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Action.java new file mode 100644 index 0000000000000..2ba826ae8590b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Action.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +/** + * The action of virtual network rule. + */ +public enum Action { + /** + * Enum value Allow. + */ + ALLOW("Allow"); + + /** + * The actual serialized value for a Action instance. + */ + private final String value; + + Action(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Action instance. + * + * @param value the serialized value to parse. + * @return the parsed Action object, or null if unable to parse. + */ + public static Action fromString(String value) { + if (value == null) { + return null; + } + Action[] items = Action.values(); + for (Action item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ActiveDirectoryProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ActiveDirectoryProperties.java new file mode 100644 index 0000000000000..4f0c645e1f963 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ActiveDirectoryProperties.java @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Settings properties for Active Directory (AD). + */ +@Fluent +public final class ActiveDirectoryProperties implements JsonSerializable { + /* + * Specifies the primary domain that the AD DNS server is authoritative for. + */ + private String domainName; + + /* + * Specifies the NetBIOS domain name. + */ + private String netBiosDomainName; + + /* + * Specifies the Active Directory forest to get. + */ + private String forestName; + + /* + * Specifies the domain GUID. + */ + private String domainGuid; + + /* + * Specifies the security identifier (SID). + */ + private String domainSid; + + /* + * Specifies the security identifier (SID) for Azure Storage. + */ + private String azureStorageSid; + + /* + * Specifies the Active Directory SAMAccountName for Azure Storage. + */ + private String samAccountName; + + /* + * Specifies the Active Directory account type for Azure Storage. + */ + private AccountType accountType; + + /** + * Creates an instance of ActiveDirectoryProperties class. + */ + public ActiveDirectoryProperties() { + } + + /** + * Get the domainName property: Specifies the primary domain that the AD DNS server is authoritative for. + * + * @return the domainName value. + */ + public String domainName() { + return this.domainName; + } + + /** + * Set the domainName property: Specifies the primary domain that the AD DNS server is authoritative for. + * + * @param domainName the domainName value to set. + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withDomainName(String domainName) { + this.domainName = domainName; + return this; + } + + /** + * Get the netBiosDomainName property: Specifies the NetBIOS domain name. + * + * @return the netBiosDomainName value. + */ + public String netBiosDomainName() { + return this.netBiosDomainName; + } + + /** + * Set the netBiosDomainName property: Specifies the NetBIOS domain name. + * + * @param netBiosDomainName the netBiosDomainName value to set. + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withNetBiosDomainName(String netBiosDomainName) { + this.netBiosDomainName = netBiosDomainName; + return this; + } + + /** + * Get the forestName property: Specifies the Active Directory forest to get. + * + * @return the forestName value. + */ + public String forestName() { + return this.forestName; + } + + /** + * Set the forestName property: Specifies the Active Directory forest to get. + * + * @param forestName the forestName value to set. + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withForestName(String forestName) { + this.forestName = forestName; + return this; + } + + /** + * Get the domainGuid property: Specifies the domain GUID. + * + * @return the domainGuid value. + */ + public String domainGuid() { + return this.domainGuid; + } + + /** + * Set the domainGuid property: Specifies the domain GUID. + * + * @param domainGuid the domainGuid value to set. + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withDomainGuid(String domainGuid) { + this.domainGuid = domainGuid; + return this; + } + + /** + * Get the domainSid property: Specifies the security identifier (SID). + * + * @return the domainSid value. + */ + public String domainSid() { + return this.domainSid; + } + + /** + * Set the domainSid property: Specifies the security identifier (SID). + * + * @param domainSid the domainSid value to set. + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withDomainSid(String domainSid) { + this.domainSid = domainSid; + return this; + } + + /** + * Get the azureStorageSid property: Specifies the security identifier (SID) for Azure Storage. + * + * @return the azureStorageSid value. + */ + public String azureStorageSid() { + return this.azureStorageSid; + } + + /** + * Set the azureStorageSid property: Specifies the security identifier (SID) for Azure Storage. + * + * @param azureStorageSid the azureStorageSid value to set. + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withAzureStorageSid(String azureStorageSid) { + this.azureStorageSid = azureStorageSid; + return this; + } + + /** + * Get the samAccountName property: Specifies the Active Directory SAMAccountName for Azure Storage. + * + * @return the samAccountName value. + */ + public String samAccountName() { + return this.samAccountName; + } + + /** + * Set the samAccountName property: Specifies the Active Directory SAMAccountName for Azure Storage. + * + * @param samAccountName the samAccountName value to set. + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withSamAccountName(String samAccountName) { + this.samAccountName = samAccountName; + return this; + } + + /** + * Get the accountType property: Specifies the Active Directory account type for Azure Storage. + * + * @return the accountType value. + */ + public AccountType accountType() { + return this.accountType; + } + + /** + * Set the accountType property: Specifies the Active Directory account type for Azure Storage. + * + * @param accountType the accountType value to set. + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withAccountType(AccountType accountType) { + this.accountType = accountType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (domainName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property domainName in model ActiveDirectoryProperties")); + } + if (domainGuid() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property domainGuid in model ActiveDirectoryProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ActiveDirectoryProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("domainName", this.domainName); + jsonWriter.writeStringField("domainGuid", this.domainGuid); + jsonWriter.writeStringField("netBiosDomainName", this.netBiosDomainName); + jsonWriter.writeStringField("forestName", this.forestName); + jsonWriter.writeStringField("domainSid", this.domainSid); + jsonWriter.writeStringField("azureStorageSid", this.azureStorageSid); + jsonWriter.writeStringField("samAccountName", this.samAccountName); + jsonWriter.writeStringField("accountType", this.accountType == null ? null : this.accountType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActiveDirectoryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActiveDirectoryProperties 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 ActiveDirectoryProperties. + */ + public static ActiveDirectoryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActiveDirectoryProperties deserializedActiveDirectoryProperties = new ActiveDirectoryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("domainName".equals(fieldName)) { + deserializedActiveDirectoryProperties.domainName = reader.getString(); + } else if ("domainGuid".equals(fieldName)) { + deserializedActiveDirectoryProperties.domainGuid = reader.getString(); + } else if ("netBiosDomainName".equals(fieldName)) { + deserializedActiveDirectoryProperties.netBiosDomainName = reader.getString(); + } else if ("forestName".equals(fieldName)) { + deserializedActiveDirectoryProperties.forestName = reader.getString(); + } else if ("domainSid".equals(fieldName)) { + deserializedActiveDirectoryProperties.domainSid = reader.getString(); + } else if ("azureStorageSid".equals(fieldName)) { + deserializedActiveDirectoryProperties.azureStorageSid = reader.getString(); + } else if ("samAccountName".equals(fieldName)) { + deserializedActiveDirectoryProperties.samAccountName = reader.getString(); + } else if ("accountType".equals(fieldName)) { + deserializedActiveDirectoryProperties.accountType = AccountType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedActiveDirectoryProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AllowedCopyScope.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AllowedCopyScope.java new file mode 100644 index 0000000000000..7cbed83abd838 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AllowedCopyScope.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + */ +public final class AllowedCopyScope extends ExpandableStringEnum { + /** + * Static value PrivateLink for AllowedCopyScope. + */ + public static final AllowedCopyScope PRIVATE_LINK = fromString("PrivateLink"); + + /** + * Static value AAD for AllowedCopyScope. + */ + public static final AllowedCopyScope AAD = fromString("AAD"); + + /** + * Creates a new instance of AllowedCopyScope value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AllowedCopyScope() { + } + + /** + * Creates or finds a AllowedCopyScope from its string representation. + * + * @param name a name to look for. + * @return the corresponding AllowedCopyScope. + */ + public static AllowedCopyScope fromString(String name) { + return fromString(name, AllowedCopyScope.class); + } + + /** + * Gets known AllowedCopyScope values. + * + * @return known AllowedCopyScope values. + */ + public static Collection values() { + return values(AllowedCopyScope.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AllowedMethods.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AllowedMethods.java new file mode 100644 index 0000000000000..224e8ca432caa --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AllowedMethods.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for AllowedMethods. + */ +public final class AllowedMethods extends ExpandableStringEnum { + /** + * Static value DELETE for AllowedMethods. + */ + public static final AllowedMethods DELETE = fromString("DELETE"); + + /** + * Static value GET for AllowedMethods. + */ + public static final AllowedMethods GET = fromString("GET"); + + /** + * Static value HEAD for AllowedMethods. + */ + public static final AllowedMethods HEAD = fromString("HEAD"); + + /** + * Static value MERGE for AllowedMethods. + */ + public static final AllowedMethods MERGE = fromString("MERGE"); + + /** + * Static value POST for AllowedMethods. + */ + public static final AllowedMethods POST = fromString("POST"); + + /** + * Static value OPTIONS for AllowedMethods. + */ + public static final AllowedMethods OPTIONS = fromString("OPTIONS"); + + /** + * Static value PUT for AllowedMethods. + */ + public static final AllowedMethods PUT = fromString("PUT"); + + /** + * Static value PATCH for AllowedMethods. + */ + public static final AllowedMethods PATCH = fromString("PATCH"); + + /** + * Static value CONNECT for AllowedMethods. + */ + public static final AllowedMethods CONNECT = fromString("CONNECT"); + + /** + * Static value TRACE for AllowedMethods. + */ + public static final AllowedMethods TRACE = fromString("TRACE"); + + /** + * Creates a new instance of AllowedMethods value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AllowedMethods() { + } + + /** + * Creates or finds a AllowedMethods from its string representation. + * + * @param name a name to look for. + * @return the corresponding AllowedMethods. + */ + public static AllowedMethods fromString(String name) { + return fromString(name, AllowedMethods.class); + } + + /** + * Gets known AllowedMethods values. + * + * @return known AllowedMethods values. + */ + public static Collection values() { + return values(AllowedMethods.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AzureEntityResource.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AzureEntityResource.java new file mode 100644 index 0000000000000..b1b099d4774ea --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AzureEntityResource.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Entity Resource + * + * The resource model definition for an Azure Resource Manager resource with an etag. + */ +@Immutable +public class AzureEntityResource extends ProxyResource { + /* + * Resource Etag. + */ + private String etag; + + /* + * 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 AzureEntityResource class. + */ + public AzureEntityResource() { + } + + /** + * Get the etag property: Resource Etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Resource Etag. + * + * @param etag the etag value to set. + * @return the AzureEntityResource object itself. + */ + AzureEntityResource withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * 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; + } + + /** + * 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 AzureEntityResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureEntityResource 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 AzureEntityResource. + */ + public static AzureEntityResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureEntityResource deserializedAzureEntityResource = new AzureEntityResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAzureEntityResource.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAzureEntityResource.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAzureEntityResource.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedAzureEntityResource.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureEntityResource; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AzureFilesIdentityBasedAuthentication.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AzureFilesIdentityBasedAuthentication.java new file mode 100644 index 0000000000000..00618a6dba9d8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AzureFilesIdentityBasedAuthentication.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Settings for Azure Files identity based authentication. + */ +@Fluent +public final class AzureFilesIdentityBasedAuthentication + implements JsonSerializable { + /* + * Indicates the directory service used. Note that this enum may be extended in the future. + */ + private DirectoryServiceOptions directoryServiceOptions; + + /* + * Required if directoryServiceOptions are AD, optional if they are AADKERB. + */ + private ActiveDirectoryProperties activeDirectoryProperties; + + /* + * Default share permission for users using Kerberos authentication if RBAC role is not assigned. + */ + private DefaultSharePermission defaultSharePermission; + + /** + * Creates an instance of AzureFilesIdentityBasedAuthentication class. + */ + public AzureFilesIdentityBasedAuthentication() { + } + + /** + * Get the directoryServiceOptions property: Indicates the directory service used. Note that this enum may be + * extended in the future. + * + * @return the directoryServiceOptions value. + */ + public DirectoryServiceOptions directoryServiceOptions() { + return this.directoryServiceOptions; + } + + /** + * Set the directoryServiceOptions property: Indicates the directory service used. Note that this enum may be + * extended in the future. + * + * @param directoryServiceOptions the directoryServiceOptions value to set. + * @return the AzureFilesIdentityBasedAuthentication object itself. + */ + public AzureFilesIdentityBasedAuthentication + withDirectoryServiceOptions(DirectoryServiceOptions directoryServiceOptions) { + this.directoryServiceOptions = directoryServiceOptions; + return this; + } + + /** + * Get the activeDirectoryProperties property: Required if directoryServiceOptions are AD, optional if they are + * AADKERB. + * + * @return the activeDirectoryProperties value. + */ + public ActiveDirectoryProperties activeDirectoryProperties() { + return this.activeDirectoryProperties; + } + + /** + * Set the activeDirectoryProperties property: Required if directoryServiceOptions are AD, optional if they are + * AADKERB. + * + * @param activeDirectoryProperties the activeDirectoryProperties value to set. + * @return the AzureFilesIdentityBasedAuthentication object itself. + */ + public AzureFilesIdentityBasedAuthentication + withActiveDirectoryProperties(ActiveDirectoryProperties activeDirectoryProperties) { + this.activeDirectoryProperties = activeDirectoryProperties; + return this; + } + + /** + * Get the defaultSharePermission property: Default share permission for users using Kerberos authentication if RBAC + * role is not assigned. + * + * @return the defaultSharePermission value. + */ + public DefaultSharePermission defaultSharePermission() { + return this.defaultSharePermission; + } + + /** + * Set the defaultSharePermission property: Default share permission for users using Kerberos authentication if RBAC + * role is not assigned. + * + * @param defaultSharePermission the defaultSharePermission value to set. + * @return the AzureFilesIdentityBasedAuthentication object itself. + */ + public AzureFilesIdentityBasedAuthentication + withDefaultSharePermission(DefaultSharePermission defaultSharePermission) { + this.defaultSharePermission = defaultSharePermission; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (directoryServiceOptions() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property directoryServiceOptions in model AzureFilesIdentityBasedAuthentication")); + } + if (activeDirectoryProperties() != null) { + activeDirectoryProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureFilesIdentityBasedAuthentication.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("directoryServiceOptions", + this.directoryServiceOptions == null ? null : this.directoryServiceOptions.toString()); + jsonWriter.writeJsonField("activeDirectoryProperties", this.activeDirectoryProperties); + jsonWriter.writeStringField("defaultSharePermission", + this.defaultSharePermission == null ? null : this.defaultSharePermission.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFilesIdentityBasedAuthentication from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFilesIdentityBasedAuthentication 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 AzureFilesIdentityBasedAuthentication. + */ + public static AzureFilesIdentityBasedAuthentication fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFilesIdentityBasedAuthentication deserializedAzureFilesIdentityBasedAuthentication + = new AzureFilesIdentityBasedAuthentication(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("directoryServiceOptions".equals(fieldName)) { + deserializedAzureFilesIdentityBasedAuthentication.directoryServiceOptions + = DirectoryServiceOptions.fromString(reader.getString()); + } else if ("activeDirectoryProperties".equals(fieldName)) { + deserializedAzureFilesIdentityBasedAuthentication.activeDirectoryProperties + = ActiveDirectoryProperties.fromJson(reader); + } else if ("defaultSharePermission".equals(fieldName)) { + deserializedAzureFilesIdentityBasedAuthentication.defaultSharePermission + = DefaultSharePermission.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFilesIdentityBasedAuthentication; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainer.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainer.java new file mode 100644 index 0000000000000..088579ab8af55 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainer.java @@ -0,0 +1,601 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobContainerInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LegalHoldInner; +import java.time.OffsetDateTime; +import java.util.Map; + +/** + * An immutable client-side representation of BlobContainer. + */ +public interface BlobContainer { + /** + * 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 etag property: Resource Etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the version property: The version of the deleted blob container. + * + * @return the version value. + */ + String version(); + + /** + * Gets the deleted property: Indicates whether the blob container was deleted. + * + * @return the deleted value. + */ + Boolean deleted(); + + /** + * Gets the deletedTime property: Blob container deletion time. + * + * @return the deletedTime value. + */ + OffsetDateTime deletedTime(); + + /** + * Gets the remainingRetentionDays property: Remaining retention days for soft deleted blob container. + * + * @return the remainingRetentionDays value. + */ + Integer remainingRetentionDays(); + + /** + * Gets the defaultEncryptionScope property: Default the container to use specified encryption scope for all writes. + * + * @return the defaultEncryptionScope value. + */ + String defaultEncryptionScope(); + + /** + * Gets the denyEncryptionScopeOverride property: Block override of encryption scope from the container default. + * + * @return the denyEncryptionScopeOverride value. + */ + Boolean denyEncryptionScopeOverride(); + + /** + * Gets the publicAccess property: Specifies whether data in the container may be accessed publicly and the level of + * access. + * + * @return the publicAccess value. + */ + PublicAccess publicAccess(); + + /** + * Gets the lastModifiedTime property: Returns the date and time the container was last modified. + * + * @return the lastModifiedTime value. + */ + OffsetDateTime lastModifiedTime(); + + /** + * Gets the leaseStatus property: The lease status of the container. + * + * @return the leaseStatus value. + */ + LeaseStatus leaseStatus(); + + /** + * Gets the leaseState property: Lease state of the container. + * + * @return the leaseState value. + */ + LeaseState leaseState(); + + /** + * Gets the leaseDuration property: Specifies whether the lease on a container is of infinite or fixed duration, + * only when the container is leased. + * + * @return the leaseDuration value. + */ + LeaseDuration leaseDuration(); + + /** + * Gets the metadata property: A name-value pair to associate with the container as metadata. + * + * @return the metadata value. + */ + Map metadata(); + + /** + * Gets the immutabilityPolicy property: The ImmutabilityPolicy property of the container. + * + * @return the immutabilityPolicy value. + */ + ImmutabilityPolicyProperties immutabilityPolicy(); + + /** + * Gets the legalHold property: The LegalHold property of the container. + * + * @return the legalHold value. + */ + LegalHoldProperties legalHold(); + + /** + * Gets the hasLegalHold property: The hasLegalHold public property is set to true by SRP if there are at least one + * existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared + * out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. + * + * @return the hasLegalHold value. + */ + Boolean hasLegalHold(); + + /** + * Gets the hasImmutabilityPolicy property: The hasImmutabilityPolicy public property is set to true by SRP if + * ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false + * by SRP if ImmutabilityPolicy has not been created for this container. + * + * @return the hasImmutabilityPolicy value. + */ + Boolean hasImmutabilityPolicy(); + + /** + * Gets the immutableStorageWithVersioning property: The object level immutability property of the container. The + * property is immutable and can only be set to true at the container creation time. Existing containers must + * undergo a migration process. + * + * @return the immutableStorageWithVersioning value. + */ + ImmutableStorageWithVersioning immutableStorageWithVersioning(); + + /** + * Gets the enableNfsV3RootSquash property: Enable NFSv3 root squash on blob container. + * + * @return the enableNfsV3RootSquash value. + */ + Boolean enableNfsV3RootSquash(); + + /** + * Gets the enableNfsV3AllSquash property: Enable NFSv3 all squash on blob container. + * + * @return the enableNfsV3AllSquash value. + */ + Boolean enableNfsV3AllSquash(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.BlobContainerInner object. + * + * @return the inner object. + */ + BlobContainerInner innerModel(); + + /** + * The entirety of the BlobContainer definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The BlobContainer definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the BlobContainer definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the BlobContainer definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the BlobContainer 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.WithDefaultEncryptionScope, + DefinitionStages.WithDenyEncryptionScopeOverride, DefinitionStages.WithPublicAccess, + DefinitionStages.WithMetadata, DefinitionStages.WithImmutableStorageWithVersioning, + DefinitionStages.WithEnableNfsV3RootSquash, DefinitionStages.WithEnableNfsV3AllSquash { + /** + * Executes the create request. + * + * @return the created resource. + */ + BlobContainer create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BlobContainer create(Context context); + } + + /** + * The stage of the BlobContainer definition allowing to specify defaultEncryptionScope. + */ + interface WithDefaultEncryptionScope { + /** + * Specifies the defaultEncryptionScope property: Default the container to use specified encryption scope + * for all writes.. + * + * @param defaultEncryptionScope Default the container to use specified encryption scope for all writes. + * @return the next definition stage. + */ + WithCreate withDefaultEncryptionScope(String defaultEncryptionScope); + } + + /** + * The stage of the BlobContainer definition allowing to specify denyEncryptionScopeOverride. + */ + interface WithDenyEncryptionScopeOverride { + /** + * Specifies the denyEncryptionScopeOverride property: Block override of encryption scope from the container + * default.. + * + * @param denyEncryptionScopeOverride Block override of encryption scope from the container default. + * @return the next definition stage. + */ + WithCreate withDenyEncryptionScopeOverride(Boolean denyEncryptionScopeOverride); + } + + /** + * The stage of the BlobContainer definition allowing to specify publicAccess. + */ + interface WithPublicAccess { + /** + * Specifies the publicAccess property: Specifies whether data in the container may be accessed publicly and + * the level of access.. + * + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of + * access. + * @return the next definition stage. + */ + WithCreate withPublicAccess(PublicAccess publicAccess); + } + + /** + * The stage of the BlobContainer definition allowing to specify metadata. + */ + interface WithMetadata { + /** + * Specifies the metadata property: A name-value pair to associate with the container as metadata.. + * + * @param metadata A name-value pair to associate with the container as metadata. + * @return the next definition stage. + */ + WithCreate withMetadata(Map metadata); + } + + /** + * The stage of the BlobContainer definition allowing to specify immutableStorageWithVersioning. + */ + interface WithImmutableStorageWithVersioning { + /** + * Specifies the immutableStorageWithVersioning property: The object level immutability property of the + * container. The property is immutable and can only be set to true at the container creation time. Existing + * containers must undergo a migration process.. + * + * @param immutableStorageWithVersioning The object level immutability property of the container. The + * property is immutable and can only be set to true at the container creation time. Existing containers + * must undergo a migration process. + * @return the next definition stage. + */ + WithCreate + withImmutableStorageWithVersioning(ImmutableStorageWithVersioning immutableStorageWithVersioning); + } + + /** + * The stage of the BlobContainer definition allowing to specify enableNfsV3RootSquash. + */ + interface WithEnableNfsV3RootSquash { + /** + * Specifies the enableNfsV3RootSquash property: Enable NFSv3 root squash on blob container.. + * + * @param enableNfsV3RootSquash Enable NFSv3 root squash on blob container. + * @return the next definition stage. + */ + WithCreate withEnableNfsV3RootSquash(Boolean enableNfsV3RootSquash); + } + + /** + * The stage of the BlobContainer definition allowing to specify enableNfsV3AllSquash. + */ + interface WithEnableNfsV3AllSquash { + /** + * Specifies the enableNfsV3AllSquash property: Enable NFSv3 all squash on blob container.. + * + * @param enableNfsV3AllSquash Enable NFSv3 all squash on blob container. + * @return the next definition stage. + */ + WithCreate withEnableNfsV3AllSquash(Boolean enableNfsV3AllSquash); + } + } + + /** + * Begins update for the BlobContainer resource. + * + * @return the stage of resource update. + */ + BlobContainer.Update update(); + + /** + * The template for BlobContainer update. + */ + interface Update extends UpdateStages.WithDefaultEncryptionScope, UpdateStages.WithDenyEncryptionScopeOverride, + UpdateStages.WithPublicAccess, UpdateStages.WithMetadata, UpdateStages.WithImmutableStorageWithVersioning, + UpdateStages.WithEnableNfsV3RootSquash, UpdateStages.WithEnableNfsV3AllSquash { + /** + * Executes the update request. + * + * @return the updated resource. + */ + BlobContainer apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + BlobContainer apply(Context context); + } + + /** + * The BlobContainer update stages. + */ + interface UpdateStages { + /** + * The stage of the BlobContainer update allowing to specify defaultEncryptionScope. + */ + interface WithDefaultEncryptionScope { + /** + * Specifies the defaultEncryptionScope property: Default the container to use specified encryption scope + * for all writes.. + * + * @param defaultEncryptionScope Default the container to use specified encryption scope for all writes. + * @return the next definition stage. + */ + Update withDefaultEncryptionScope(String defaultEncryptionScope); + } + + /** + * The stage of the BlobContainer update allowing to specify denyEncryptionScopeOverride. + */ + interface WithDenyEncryptionScopeOverride { + /** + * Specifies the denyEncryptionScopeOverride property: Block override of encryption scope from the container + * default.. + * + * @param denyEncryptionScopeOverride Block override of encryption scope from the container default. + * @return the next definition stage. + */ + Update withDenyEncryptionScopeOverride(Boolean denyEncryptionScopeOverride); + } + + /** + * The stage of the BlobContainer update allowing to specify publicAccess. + */ + interface WithPublicAccess { + /** + * Specifies the publicAccess property: Specifies whether data in the container may be accessed publicly and + * the level of access.. + * + * @param publicAccess Specifies whether data in the container may be accessed publicly and the level of + * access. + * @return the next definition stage. + */ + Update withPublicAccess(PublicAccess publicAccess); + } + + /** + * The stage of the BlobContainer update allowing to specify metadata. + */ + interface WithMetadata { + /** + * Specifies the metadata property: A name-value pair to associate with the container as metadata.. + * + * @param metadata A name-value pair to associate with the container as metadata. + * @return the next definition stage. + */ + Update withMetadata(Map metadata); + } + + /** + * The stage of the BlobContainer update allowing to specify immutableStorageWithVersioning. + */ + interface WithImmutableStorageWithVersioning { + /** + * Specifies the immutableStorageWithVersioning property: The object level immutability property of the + * container. The property is immutable and can only be set to true at the container creation time. Existing + * containers must undergo a migration process.. + * + * @param immutableStorageWithVersioning The object level immutability property of the container. The + * property is immutable and can only be set to true at the container creation time. Existing containers + * must undergo a migration process. + * @return the next definition stage. + */ + Update withImmutableStorageWithVersioning(ImmutableStorageWithVersioning immutableStorageWithVersioning); + } + + /** + * The stage of the BlobContainer update allowing to specify enableNfsV3RootSquash. + */ + interface WithEnableNfsV3RootSquash { + /** + * Specifies the enableNfsV3RootSquash property: Enable NFSv3 root squash on blob container.. + * + * @param enableNfsV3RootSquash Enable NFSv3 root squash on blob container. + * @return the next definition stage. + */ + Update withEnableNfsV3RootSquash(Boolean enableNfsV3RootSquash); + } + + /** + * The stage of the BlobContainer update allowing to specify enableNfsV3AllSquash. + */ + interface WithEnableNfsV3AllSquash { + /** + * Specifies the enableNfsV3AllSquash property: Enable NFSv3 all squash on blob container.. + * + * @param enableNfsV3AllSquash Enable NFSv3 all squash on blob container. + * @return the next definition stage. + */ + Update withEnableNfsV3AllSquash(Boolean enableNfsV3AllSquash); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + BlobContainer refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + BlobContainer refresh(Context context); + + /** + * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append + * pattern and does not clear out the existing tags that are not specified in the request. + * + * @param legalHold The LegalHold property that will be set to a blob container. + * @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 LegalHold property of a blob container along with {@link Response}. + */ + Response setLegalHoldWithResponse(LegalHoldInner legalHold, Context context); + + /** + * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append + * pattern and does not clear out the existing tags that are not specified in the request. + * + * @param legalHold The LegalHold property that will be set to a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 LegalHold property of a blob container. + */ + LegalHold setLegalHold(LegalHoldInner legalHold); + + /** + * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold + * clears out only the specified tags in the request. + * + * @param legalHold The LegalHold property that will be clear from a blob container. + * @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 LegalHold property of a blob container along with {@link Response}. + */ + Response clearLegalHoldWithResponse(LegalHoldInner legalHold, Context context); + + /** + * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold + * clears out only the specified tags in the request. + * + * @param legalHold The LegalHold property that will be clear from a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 LegalHold property of a blob container. + */ + LegalHold clearLegalHold(LegalHoldInner legalHold); + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock + * duration can be 15 to 60 seconds, or can be infinite. + * + * @param parameters Lease Container request body. + * @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 lease Container response schema along with {@link Response}. + */ + Response leaseWithResponse(LeaseContainerRequest parameters, Context context); + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock + * duration can be 15 to 60 seconds, or can be infinite. + * + * @throws com.azure.core.management.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 lease Container response schema. + */ + LeaseContainerResponse lease(); + + /** + * This operation migrates a blob container from container level WORM to object level immutability enabled + * container. Prerequisites require a container level immutability policy either in locked or unlocked state, + * Account level versioning must be enabled and there should be no Legal hold on the container. + * + * @throws com.azure.core.management.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 objectLevelWorm(); + + /** + * This operation migrates a blob container from container level WORM to object level immutability enabled + * container. Prerequisites require a container level immutability policy either in locked or unlocked state, + * Account level versioning must be enabled and there should be no Legal hold on the container. + * + * @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 objectLevelWorm(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainers.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainers.java new file mode 100644 index 0000000000000..1afeb35b81e79 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainers.java @@ -0,0 +1,573 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner; +import com.azure.resourcemanager.storage.generated.fluent.models.LegalHoldInner; + +/** + * Resource collection API of BlobContainers. + */ +public interface BlobContainers { + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation + * token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 response schema as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation + * token. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. + * @param filter Optional. When specified, only container names starting with the filter will be listed. + * @param include Optional, used to include the properties for soft deleted blob containers. + * @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 response schema as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, String maxpagesize, + String filter, ListContainersInclude include, Context context); + + /** + * Gets properties of a specified container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @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 properties of a specified container along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String accountName, String containerName, + Context context); + + /** + * Gets properties of a specified container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 properties of a specified container. + */ + BlobContainer get(String resourceGroupName, String accountName, String containerName); + + /** + * Deletes specified container under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @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 Response}. + */ + Response deleteWithResponse(String resourceGroupName, String accountName, String containerName, + Context context); + + /** + * Deletes specified container under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String containerName); + + /** + * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append + * pattern and does not clear out the existing tags that are not specified in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be set to a blob container. + * @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 LegalHold property of a blob container along with {@link Response}. + */ + Response setLegalHoldWithResponse(String resourceGroupName, String accountName, String containerName, + LegalHoldInner legalHold, Context context); + + /** + * Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append + * pattern and does not clear out the existing tags that are not specified in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be set to a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 LegalHold property of a blob container. + */ + LegalHold setLegalHold(String resourceGroupName, String accountName, String containerName, + LegalHoldInner legalHold); + + /** + * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold + * clears out only the specified tags in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be clear from a blob container. + * @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 LegalHold property of a blob container along with {@link Response}. + */ + Response clearLegalHoldWithResponse(String resourceGroupName, String accountName, String containerName, + LegalHoldInner legalHold, Context context); + + /** + * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold + * clears out only the specified tags in the request. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param legalHold The LegalHold property that will be clear from a blob container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 LegalHold property of a blob container. + */ + LegalHold clearLegalHold(String resourceGroupName, String accountName, String containerName, + LegalHoldInner legalHold); + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @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 existing immutability policy along with the corresponding ETag in response headers and body. + */ + Response getImmutabilityPolicyWithResponse(String resourceGroupName, String accountName, + String containerName, String ifMatch, Context context); + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 existing immutability policy along with the corresponding ETag in response headers and body. + */ + ImmutabilityPolicy getImmutabilityPolicy(String resourceGroupName, String accountName, String containerName); + + /** + * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to + * 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the + * only way is to delete the container after deleting all expired blobs inside the policy locked container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + Response deleteImmutabilityPolicyWithResponse(String resourceGroupName, String accountName, + String containerName, String ifMatch, Context context); + + /** + * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to + * 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the + * only way is to delete the container after deleting all expired blobs inside the policy locked container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + ImmutabilityPolicy deleteImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, + String ifMatch); + + /** + * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is + * ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + Response lockImmutabilityPolicyWithResponse(String resourceGroupName, String accountName, + String containerName, String ifMatch, Context context); + + /** + * Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is + * ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + ImmutabilityPolicy lockImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, + String ifMatch); + + /** + * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a + * Locked policy will be this action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @param parameters The ImmutabilityPolicy Properties that will be extended for a blob container. + * @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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + Response extendImmutabilityPolicyWithResponse(String resourceGroupName, String accountName, + String containerName, String ifMatch, ImmutabilityPolicyInner parameters, Context context); + + /** + * Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a + * Locked policy will be this action. ETag in If-Match is required for this operation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + ImmutabilityPolicy extendImmutabilityPolicy(String resourceGroupName, String accountName, String containerName, + String ifMatch); + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock + * duration can be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @param parameters Lease Container request body. + * @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 lease Container response schema along with {@link Response}. + */ + Response leaseWithResponse(String resourceGroupName, String accountName, + String containerName, LeaseContainerRequest parameters, Context context); + + /** + * The Lease Container operation establishes and manages a lock on a container for delete operations. The lock + * duration can be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 lease Container response schema. + */ + LeaseContainerResponse lease(String resourceGroupName, String accountName, String containerName); + + /** + * This operation migrates a blob container from container level WORM to object level immutability enabled + * container. Prerequisites require a container level immutability policy either in locked or unlocked state, + * Account level versioning must be enabled and there should be no Legal hold on the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 objectLevelWorm(String resourceGroupName, String accountName, String containerName); + + /** + * This operation migrates a blob container from container level WORM to object level immutability enabled + * container. Prerequisites require a container level immutability policy either in locked or unlocked state, + * Account level versioning must be enabled and there should be no Legal hold on the container. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container names + * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + * (-) character must be immediately preceded and followed by a letter or number. + * @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 objectLevelWorm(String resourceGroupName, String accountName, String containerName, Context context); + + /** + * Gets properties of a specified container. + * + * @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 properties of a specified container along with {@link Response}. + */ + BlobContainer getById(String id); + + /** + * Gets properties of a specified container. + * + * @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 properties of a specified container along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the existing immutability policy along with the corresponding ETag in response headers and body. + */ + ImmutabilityPolicy getImmutabilityPolicyById(String id); + + /** + * Gets the existing immutability policy along with the corresponding ETag in response headers and body. + * + * @param id the resource ID. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @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 existing immutability policy along with the corresponding ETag in response headers and body. + */ + Response getImmutabilityPolicyByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Deletes specified container under its account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes specified container under its account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to + * 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the + * only way is to delete the container after deleting all expired blobs inside the policy locked container. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + ImmutabilityPolicy deleteImmutabilityPolicyById(String id); + + /** + * Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to + * 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the + * only way is to delete the container after deleting all expired blobs inside the policy locked container. + * + * @param id the resource ID. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. + * @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 ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + */ + Response deleteImmutabilityPolicyByIdWithResponse(String id, String ifMatch, Context context); + + /** + * Begins definition for a new BlobContainer resource. + * + * @param name resource name. + * @return the first stage of the new BlobContainer definition. + */ + BlobContainer.DefinitionStages.Blank define(String name); + + /** + * Begins definition for a new ImmutabilityPolicy resource. + * + * @return the first stage of the new ImmutabilityPolicy definition. + */ + ImmutabilityPolicy.DefinitionStages.Blank defineImmutabilityPolicy(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java new file mode 100644 index 0000000000000..6e473fb35dccd --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; + +/** + * The BlobContainersCreateOrUpdateImmutabilityPolicyHeaders model. + */ +@Fluent +public final class BlobContainersCreateOrUpdateImmutabilityPolicyHeaders { + /* + * The Etag property. + */ + private String etag; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of BlobContainersCreateOrUpdateImmutabilityPolicyHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public BlobContainersCreateOrUpdateImmutabilityPolicyHeaders(HttpHeaders rawHeaders) { + this.etag = rawHeaders.getValue(HttpHeaderName.ETAG); + } + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the BlobContainersCreateOrUpdateImmutabilityPolicyHeaders object itself. + */ + public BlobContainersCreateOrUpdateImmutabilityPolicyHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersCreateOrUpdateImmutabilityPolicyResponse.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersCreateOrUpdateImmutabilityPolicyResponse.java new file mode 100644 index 0000000000000..7e2a759be5196 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersCreateOrUpdateImmutabilityPolicyResponse.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner; + +/** + * Contains all response data for the createOrUpdateImmutabilityPolicy operation. + */ +public final class BlobContainersCreateOrUpdateImmutabilityPolicyResponse + extends ResponseBase { + /** + * Creates an instance of BlobContainersCreateOrUpdateImmutabilityPolicyResponse. + * + * @param request the request which resulted in this BlobContainersCreateOrUpdateImmutabilityPolicyResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public BlobContainersCreateOrUpdateImmutabilityPolicyResponse(HttpRequest request, int statusCode, + HttpHeaders rawHeaders, ImmutabilityPolicyInner value, + BlobContainersCreateOrUpdateImmutabilityPolicyHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public ImmutabilityPolicyInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersDeleteImmutabilityPolicyHeaders.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersDeleteImmutabilityPolicyHeaders.java new file mode 100644 index 0000000000000..15f222d8be3f2 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersDeleteImmutabilityPolicyHeaders.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; + +/** + * The BlobContainersDeleteImmutabilityPolicyHeaders model. + */ +@Fluent +public final class BlobContainersDeleteImmutabilityPolicyHeaders { + /* + * The Etag property. + */ + private String etag; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of BlobContainersDeleteImmutabilityPolicyHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public BlobContainersDeleteImmutabilityPolicyHeaders(HttpHeaders rawHeaders) { + this.etag = rawHeaders.getValue(HttpHeaderName.ETAG); + } + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the BlobContainersDeleteImmutabilityPolicyHeaders object itself. + */ + public BlobContainersDeleteImmutabilityPolicyHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersDeleteImmutabilityPolicyResponse.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersDeleteImmutabilityPolicyResponse.java new file mode 100644 index 0000000000000..ac40bc09529e0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersDeleteImmutabilityPolicyResponse.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner; + +/** + * Contains all response data for the deleteImmutabilityPolicy operation. + */ +public final class BlobContainersDeleteImmutabilityPolicyResponse + extends ResponseBase { + /** + * Creates an instance of BlobContainersDeleteImmutabilityPolicyResponse. + * + * @param request the request which resulted in this BlobContainersDeleteImmutabilityPolicyResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public BlobContainersDeleteImmutabilityPolicyResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, + ImmutabilityPolicyInner value, BlobContainersDeleteImmutabilityPolicyHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public ImmutabilityPolicyInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersExtendImmutabilityPolicyHeaders.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersExtendImmutabilityPolicyHeaders.java new file mode 100644 index 0000000000000..0f5b132e72996 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersExtendImmutabilityPolicyHeaders.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; + +/** + * The BlobContainersExtendImmutabilityPolicyHeaders model. + */ +@Fluent +public final class BlobContainersExtendImmutabilityPolicyHeaders { + /* + * The Etag property. + */ + private String etag; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of BlobContainersExtendImmutabilityPolicyHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public BlobContainersExtendImmutabilityPolicyHeaders(HttpHeaders rawHeaders) { + this.etag = rawHeaders.getValue(HttpHeaderName.ETAG); + } + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the BlobContainersExtendImmutabilityPolicyHeaders object itself. + */ + public BlobContainersExtendImmutabilityPolicyHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersExtendImmutabilityPolicyResponse.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersExtendImmutabilityPolicyResponse.java new file mode 100644 index 0000000000000..ce98737a973b4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersExtendImmutabilityPolicyResponse.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner; + +/** + * Contains all response data for the extendImmutabilityPolicy operation. + */ +public final class BlobContainersExtendImmutabilityPolicyResponse + extends ResponseBase { + /** + * Creates an instance of BlobContainersExtendImmutabilityPolicyResponse. + * + * @param request the request which resulted in this BlobContainersExtendImmutabilityPolicyResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public BlobContainersExtendImmutabilityPolicyResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, + ImmutabilityPolicyInner value, BlobContainersExtendImmutabilityPolicyHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public ImmutabilityPolicyInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersGetImmutabilityPolicyHeaders.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersGetImmutabilityPolicyHeaders.java new file mode 100644 index 0000000000000..eeeb0b9b2ef9b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersGetImmutabilityPolicyHeaders.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; + +/** + * The BlobContainersGetImmutabilityPolicyHeaders model. + */ +@Fluent +public final class BlobContainersGetImmutabilityPolicyHeaders { + /* + * The Etag property. + */ + private String etag; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of BlobContainersGetImmutabilityPolicyHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public BlobContainersGetImmutabilityPolicyHeaders(HttpHeaders rawHeaders) { + this.etag = rawHeaders.getValue(HttpHeaderName.ETAG); + } + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the BlobContainersGetImmutabilityPolicyHeaders object itself. + */ + public BlobContainersGetImmutabilityPolicyHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersGetImmutabilityPolicyResponse.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersGetImmutabilityPolicyResponse.java new file mode 100644 index 0000000000000..9081b7e130235 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersGetImmutabilityPolicyResponse.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner; + +/** + * Contains all response data for the getImmutabilityPolicy operation. + */ +public final class BlobContainersGetImmutabilityPolicyResponse + extends ResponseBase { + /** + * Creates an instance of BlobContainersGetImmutabilityPolicyResponse. + * + * @param request the request which resulted in this BlobContainersGetImmutabilityPolicyResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public BlobContainersGetImmutabilityPolicyResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, + ImmutabilityPolicyInner value, BlobContainersGetImmutabilityPolicyHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public ImmutabilityPolicyInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersLockImmutabilityPolicyHeaders.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersLockImmutabilityPolicyHeaders.java new file mode 100644 index 0000000000000..1ad151d41deec --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersLockImmutabilityPolicyHeaders.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; + +/** + * The BlobContainersLockImmutabilityPolicyHeaders model. + */ +@Fluent +public final class BlobContainersLockImmutabilityPolicyHeaders { + /* + * The Etag property. + */ + private String etag; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of BlobContainersLockImmutabilityPolicyHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public BlobContainersLockImmutabilityPolicyHeaders(HttpHeaders rawHeaders) { + this.etag = rawHeaders.getValue(HttpHeaderName.ETAG); + } + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the BlobContainersLockImmutabilityPolicyHeaders object itself. + */ + public BlobContainersLockImmutabilityPolicyHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersLockImmutabilityPolicyResponse.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersLockImmutabilityPolicyResponse.java new file mode 100644 index 0000000000000..6d77bc0cc6757 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersLockImmutabilityPolicyResponse.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner; + +/** + * Contains all response data for the lockImmutabilityPolicy operation. + */ +public final class BlobContainersLockImmutabilityPolicyResponse + extends ResponseBase { + /** + * Creates an instance of BlobContainersLockImmutabilityPolicyResponse. + * + * @param request the request which resulted in this BlobContainersLockImmutabilityPolicyResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public BlobContainersLockImmutabilityPolicyResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, + ImmutabilityPolicyInner value, BlobContainersLockImmutabilityPolicyHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public ImmutabilityPolicyInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryCreationTime.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryCreationTime.java new file mode 100644 index 0000000000000..6b6e1f809942c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryCreationTime.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * This property defines the creation time based filtering condition. Blob Inventory schema parameter 'Creation-Time' is + * mandatory with this filter. + */ +@Fluent +public final class BlobInventoryCreationTime implements JsonSerializable { + /* + * When set the policy filters the objects that are created in the last N days. Where N is an integer value between + * 1 to 36500. + */ + private Integer lastNDays; + + /** + * Creates an instance of BlobInventoryCreationTime class. + */ + public BlobInventoryCreationTime() { + } + + /** + * Get the lastNDays property: When set the policy filters the objects that are created in the last N days. Where N + * is an integer value between 1 to 36500. + * + * @return the lastNDays value. + */ + public Integer lastNDays() { + return this.lastNDays; + } + + /** + * Set the lastNDays property: When set the policy filters the objects that are created in the last N days. Where N + * is an integer value between 1 to 36500. + * + * @param lastNDays the lastNDays value to set. + * @return the BlobInventoryCreationTime object itself. + */ + public BlobInventoryCreationTime withLastNDays(Integer lastNDays) { + this.lastNDays = lastNDays; + 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.writeNumberField("lastNDays", this.lastNDays); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobInventoryCreationTime from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobInventoryCreationTime 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 BlobInventoryCreationTime. + */ + public static BlobInventoryCreationTime fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobInventoryCreationTime deserializedBlobInventoryCreationTime = new BlobInventoryCreationTime(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("lastNDays".equals(fieldName)) { + deserializedBlobInventoryCreationTime.lastNDays = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobInventoryCreationTime; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicies.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicies.java new file mode 100644 index 0000000000000..c333b125e79de --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicies.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 BlobInventoryPolicies. + */ +public interface BlobInventoryPolicies { + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @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 blob inventory policy associated with the specified storage account along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, Context context); + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 blob inventory policy associated with the specified storage account. + */ + BlobInventoryPolicy get(String resourceGroupName, String accountName, + BlobInventoryPolicyName blobInventoryPolicyName); + + /** + * Deletes the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @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 Response}. + */ + Response deleteWithResponse(String resourceGroupName, String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, Context context); + + /** + * Deletes the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param blobInventoryPolicyName The name of the storage account blob inventory policy. It should always be + * 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName); + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 blob inventory policy associated with the specified storage account as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 blob inventory policy associated with the specified storage account as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blob inventory policy associated with the specified storage account along with {@link Response}. + */ + BlobInventoryPolicy getById(String id); + + /** + * Gets the blob inventory policy associated with the specified storage account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blob inventory policy associated with the specified storage account along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the blob inventory policy associated with the specified storage account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the blob inventory policy associated with the specified storage account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new BlobInventoryPolicy resource. + * + * @param name resource name. + * @return the first stage of the new BlobInventoryPolicy definition. + */ + BlobInventoryPolicy.DefinitionStages.Blank define(BlobInventoryPolicyName name); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicy.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicy.java new file mode 100644 index 0000000000000..96e96d55d6df4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicy.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobInventoryPolicyInner; +import java.time.OffsetDateTime; + +/** + * An immutable client-side representation of BlobInventoryPolicy. + */ +public interface BlobInventoryPolicy { + /** + * 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the lastModifiedTime property: Returns the last modified date and time of the blob inventory policy. + * + * @return the lastModifiedTime value. + */ + OffsetDateTime lastModifiedTime(); + + /** + * Gets the policy property: The storage account blob inventory policy object. It is composed of policy rules. + * + * @return the policy value. + */ + BlobInventoryPolicySchema policy(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.BlobInventoryPolicyInner object. + * + * @return the inner object. + */ + BlobInventoryPolicyInner innerModel(); + + /** + * The entirety of the BlobInventoryPolicy definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The BlobInventoryPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the BlobInventoryPolicy definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the BlobInventoryPolicy definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the BlobInventoryPolicy 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.WithPolicy { + /** + * Executes the create request. + * + * @return the created resource. + */ + BlobInventoryPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BlobInventoryPolicy create(Context context); + } + + /** + * The stage of the BlobInventoryPolicy definition allowing to specify policy. + */ + interface WithPolicy { + /** + * Specifies the policy property: The storage account blob inventory policy object. It is composed of policy + * rules.. + * + * @param policy The storage account blob inventory policy object. It is composed of policy rules. + * @return the next definition stage. + */ + WithCreate withPolicy(BlobInventoryPolicySchema policy); + } + } + + /** + * Begins update for the BlobInventoryPolicy resource. + * + * @return the stage of resource update. + */ + BlobInventoryPolicy.Update update(); + + /** + * The template for BlobInventoryPolicy update. + */ + interface Update extends UpdateStages.WithPolicy { + /** + * Executes the update request. + * + * @return the updated resource. + */ + BlobInventoryPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + BlobInventoryPolicy apply(Context context); + } + + /** + * The BlobInventoryPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the BlobInventoryPolicy update allowing to specify policy. + */ + interface WithPolicy { + /** + * Specifies the policy property: The storage account blob inventory policy object. It is composed of policy + * rules.. + * + * @param policy The storage account blob inventory policy object. It is composed of policy rules. + * @return the next definition stage. + */ + Update withPolicy(BlobInventoryPolicySchema policy); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + BlobInventoryPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + BlobInventoryPolicy refresh(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyDefinition.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyDefinition.java new file mode 100644 index 0000000000000..fdf77a0629514 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyDefinition.java @@ -0,0 +1,283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.List; + +/** + * An object that defines the blob inventory rule. + */ +@Fluent +public final class BlobInventoryPolicyDefinition implements JsonSerializable { + /* + * An object that defines the filter set. + */ + private BlobInventoryPolicyFilter filters; + + /* + * This is a required field, it specifies the format for the inventory files. + */ + private Format format; + + /* + * This is a required field. This field is used to schedule an inventory formation. + */ + private Schedule schedule; + + /* + * This is a required field. This field specifies the scope of the inventory created either at the blob or container + * level. + */ + private ObjectType objectType; + + /* + * This is a required field. This field specifies the fields and properties of the object to be included in the + * inventory. The Schema field value 'Name' is always required. The valid values for this field for the 'Blob' + * definition.objectType include 'Name, Creation-Time, Last-Modified, Content-Length, Content-MD5, BlobType, + * AccessTier, AccessTierChangeTime, AccessTierInferred, Tags, Expiry-Time, hdi_isfolder, Owner, Group, Permissions, + * Acl, Snapshot, VersionId, IsCurrentVersion, Metadata, LastAccessTime, Tags, Etag, ContentType, ContentEncoding, + * ContentLanguage, ContentCRC64, CacheControl, ContentDisposition, LeaseStatus, LeaseState, LeaseDuration, + * ServerEncrypted, Deleted, DeletionId, DeletedTime, RemainingRetentionDays, ImmutabilityPolicyUntilDate, + * ImmutabilityPolicyMode, LegalHold, CopyId, CopyStatus, CopySource, CopyProgress, CopyCompletionTime, + * CopyStatusDescription, CustomerProvidedKeySha256, RehydratePriority, ArchiveStatus, XmsBlobSequenceNumber, + * EncryptionScope, IncrementalCopy, TagCount'. For Blob object type schema field value 'DeletedTime' is applicable + * only for Hns enabled accounts. The valid values for 'Container' definition.objectType include 'Name, + * Last-Modified, Metadata, LeaseStatus, LeaseState, LeaseDuration, PublicAccess, HasImmutabilityPolicy, + * HasLegalHold, Etag, DefaultEncryptionScope, DenyEncryptionScopeOverride, ImmutableStorageWithVersioningEnabled, + * Deleted, Version, DeletedTime, RemainingRetentionDays'. Schema field values 'Expiry-Time, hdi_isfolder, Owner, + * Group, Permissions, Acl, DeletionId' are valid only for Hns enabled accounts.Schema field values 'Tags, TagCount' + * are only valid for Non-Hns accounts. + */ + private List schemaFields; + + /** + * Creates an instance of BlobInventoryPolicyDefinition class. + */ + public BlobInventoryPolicyDefinition() { + } + + /** + * Get the filters property: An object that defines the filter set. + * + * @return the filters value. + */ + public BlobInventoryPolicyFilter filters() { + return this.filters; + } + + /** + * Set the filters property: An object that defines the filter set. + * + * @param filters the filters value to set. + * @return the BlobInventoryPolicyDefinition object itself. + */ + public BlobInventoryPolicyDefinition withFilters(BlobInventoryPolicyFilter filters) { + this.filters = filters; + return this; + } + + /** + * Get the format property: This is a required field, it specifies the format for the inventory files. + * + * @return the format value. + */ + public Format format() { + return this.format; + } + + /** + * Set the format property: This is a required field, it specifies the format for the inventory files. + * + * @param format the format value to set. + * @return the BlobInventoryPolicyDefinition object itself. + */ + public BlobInventoryPolicyDefinition withFormat(Format format) { + this.format = format; + return this; + } + + /** + * Get the schedule property: This is a required field. This field is used to schedule an inventory formation. + * + * @return the schedule value. + */ + public Schedule schedule() { + return this.schedule; + } + + /** + * Set the schedule property: This is a required field. This field is used to schedule an inventory formation. + * + * @param schedule the schedule value to set. + * @return the BlobInventoryPolicyDefinition object itself. + */ + public BlobInventoryPolicyDefinition withSchedule(Schedule schedule) { + this.schedule = schedule; + return this; + } + + /** + * Get the objectType property: This is a required field. This field specifies the scope of the inventory created + * either at the blob or container level. + * + * @return the objectType value. + */ + public ObjectType objectType() { + return this.objectType; + } + + /** + * Set the objectType property: This is a required field. This field specifies the scope of the inventory created + * either at the blob or container level. + * + * @param objectType the objectType value to set. + * @return the BlobInventoryPolicyDefinition object itself. + */ + public BlobInventoryPolicyDefinition withObjectType(ObjectType objectType) { + this.objectType = objectType; + return this; + } + + /** + * Get the schemaFields property: This is a required field. This field specifies the fields and properties of the + * object to be included in the inventory. The Schema field value 'Name' is always required. The valid values for + * this field for the 'Blob' definition.objectType include 'Name, Creation-Time, Last-Modified, Content-Length, + * Content-MD5, BlobType, AccessTier, AccessTierChangeTime, AccessTierInferred, Tags, Expiry-Time, hdi_isfolder, + * Owner, Group, Permissions, Acl, Snapshot, VersionId, IsCurrentVersion, Metadata, LastAccessTime, Tags, Etag, + * ContentType, ContentEncoding, ContentLanguage, ContentCRC64, CacheControl, ContentDisposition, LeaseStatus, + * LeaseState, LeaseDuration, ServerEncrypted, Deleted, DeletionId, DeletedTime, RemainingRetentionDays, + * ImmutabilityPolicyUntilDate, ImmutabilityPolicyMode, LegalHold, CopyId, CopyStatus, CopySource, CopyProgress, + * CopyCompletionTime, CopyStatusDescription, CustomerProvidedKeySha256, RehydratePriority, ArchiveStatus, + * XmsBlobSequenceNumber, EncryptionScope, IncrementalCopy, TagCount'. For Blob object type schema field value + * 'DeletedTime' is applicable only for Hns enabled accounts. The valid values for 'Container' definition.objectType + * include 'Name, Last-Modified, Metadata, LeaseStatus, LeaseState, LeaseDuration, PublicAccess, + * HasImmutabilityPolicy, HasLegalHold, Etag, DefaultEncryptionScope, DenyEncryptionScopeOverride, + * ImmutableStorageWithVersioningEnabled, Deleted, Version, DeletedTime, RemainingRetentionDays'. Schema field + * values 'Expiry-Time, hdi_isfolder, Owner, Group, Permissions, Acl, DeletionId' are valid only for Hns enabled + * accounts.Schema field values 'Tags, TagCount' are only valid for Non-Hns accounts. + * + * @return the schemaFields value. + */ + public List schemaFields() { + return this.schemaFields; + } + + /** + * Set the schemaFields property: This is a required field. This field specifies the fields and properties of the + * object to be included in the inventory. The Schema field value 'Name' is always required. The valid values for + * this field for the 'Blob' definition.objectType include 'Name, Creation-Time, Last-Modified, Content-Length, + * Content-MD5, BlobType, AccessTier, AccessTierChangeTime, AccessTierInferred, Tags, Expiry-Time, hdi_isfolder, + * Owner, Group, Permissions, Acl, Snapshot, VersionId, IsCurrentVersion, Metadata, LastAccessTime, Tags, Etag, + * ContentType, ContentEncoding, ContentLanguage, ContentCRC64, CacheControl, ContentDisposition, LeaseStatus, + * LeaseState, LeaseDuration, ServerEncrypted, Deleted, DeletionId, DeletedTime, RemainingRetentionDays, + * ImmutabilityPolicyUntilDate, ImmutabilityPolicyMode, LegalHold, CopyId, CopyStatus, CopySource, CopyProgress, + * CopyCompletionTime, CopyStatusDescription, CustomerProvidedKeySha256, RehydratePriority, ArchiveStatus, + * XmsBlobSequenceNumber, EncryptionScope, IncrementalCopy, TagCount'. For Blob object type schema field value + * 'DeletedTime' is applicable only for Hns enabled accounts. The valid values for 'Container' definition.objectType + * include 'Name, Last-Modified, Metadata, LeaseStatus, LeaseState, LeaseDuration, PublicAccess, + * HasImmutabilityPolicy, HasLegalHold, Etag, DefaultEncryptionScope, DenyEncryptionScopeOverride, + * ImmutableStorageWithVersioningEnabled, Deleted, Version, DeletedTime, RemainingRetentionDays'. Schema field + * values 'Expiry-Time, hdi_isfolder, Owner, Group, Permissions, Acl, DeletionId' are valid only for Hns enabled + * accounts.Schema field values 'Tags, TagCount' are only valid for Non-Hns accounts. + * + * @param schemaFields the schemaFields value to set. + * @return the BlobInventoryPolicyDefinition object itself. + */ + public BlobInventoryPolicyDefinition withSchemaFields(List schemaFields) { + this.schemaFields = schemaFields; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (filters() != null) { + filters().validate(); + } + if (format() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property format in model BlobInventoryPolicyDefinition")); + } + if (schedule() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property schedule in model BlobInventoryPolicyDefinition")); + } + if (objectType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property objectType in model BlobInventoryPolicyDefinition")); + } + if (schemaFields() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property schemaFields in model BlobInventoryPolicyDefinition")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BlobInventoryPolicyDefinition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("format", this.format == null ? null : this.format.toString()); + jsonWriter.writeStringField("schedule", this.schedule == null ? null : this.schedule.toString()); + jsonWriter.writeStringField("objectType", this.objectType == null ? null : this.objectType.toString()); + jsonWriter.writeArrayField("schemaFields", this.schemaFields, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("filters", this.filters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobInventoryPolicyDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobInventoryPolicyDefinition 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 BlobInventoryPolicyDefinition. + */ + public static BlobInventoryPolicyDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobInventoryPolicyDefinition deserializedBlobInventoryPolicyDefinition + = new BlobInventoryPolicyDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("format".equals(fieldName)) { + deserializedBlobInventoryPolicyDefinition.format = Format.fromString(reader.getString()); + } else if ("schedule".equals(fieldName)) { + deserializedBlobInventoryPolicyDefinition.schedule = Schedule.fromString(reader.getString()); + } else if ("objectType".equals(fieldName)) { + deserializedBlobInventoryPolicyDefinition.objectType = ObjectType.fromString(reader.getString()); + } else if ("schemaFields".equals(fieldName)) { + List schemaFields = reader.readArray(reader1 -> reader1.getString()); + deserializedBlobInventoryPolicyDefinition.schemaFields = schemaFields; + } else if ("filters".equals(fieldName)) { + deserializedBlobInventoryPolicyDefinition.filters = BlobInventoryPolicyFilter.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobInventoryPolicyDefinition; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyFilter.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyFilter.java new file mode 100644 index 0000000000000..aaf07df8538b0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyFilter.java @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.List; + +/** + * An object that defines the blob inventory rule filter conditions. For 'Blob' definition.objectType all filter + * properties are applicable, 'blobTypes' is required and others are optional. For 'Container' definition.objectType + * only prefixMatch is applicable and is optional. + */ +@Fluent +public final class BlobInventoryPolicyFilter implements JsonSerializable { + /* + * An array of strings with maximum 10 blob prefixes to be included in the inventory. + */ + private List prefixMatch; + + /* + * An array of strings with maximum 10 blob prefixes to be excluded from the inventory. + */ + private List excludePrefix; + + /* + * An array of predefined enum values. Valid values include blockBlob, appendBlob, pageBlob. Hns accounts does not + * support pageBlobs. This field is required when definition.objectType property is set to 'Blob'. + */ + private List blobTypes; + + /* + * Includes blob versions in blob inventory when value is set to true. The definition.schemaFields values 'VersionId + * and IsCurrentVersion' are required if this property is set to true, else they must be excluded. + */ + private Boolean includeBlobVersions; + + /* + * Includes blob snapshots in blob inventory when value is set to true. The definition.schemaFields value 'Snapshot' + * is required if this property is set to true, else it must be excluded. + */ + private Boolean includeSnapshots; + + /* + * For 'Container' definition.objectType the definition.schemaFields must include 'Deleted, Version, DeletedTime and + * RemainingRetentionDays'. For 'Blob' definition.objectType and HNS enabled storage accounts the + * definition.schemaFields must include 'DeletionId, Deleted, DeletedTime and RemainingRetentionDays' and for Hns + * disabled accounts the definition.schemaFields must include 'Deleted and RemainingRetentionDays', else it must be + * excluded. + */ + private Boolean includeDeleted; + + /* + * This property is used to filter objects based on the object creation time + */ + private BlobInventoryCreationTime creationTime; + + /** + * Creates an instance of BlobInventoryPolicyFilter class. + */ + public BlobInventoryPolicyFilter() { + } + + /** + * Get the prefixMatch property: An array of strings with maximum 10 blob prefixes to be included in the inventory. + * + * @return the prefixMatch value. + */ + public List prefixMatch() { + return this.prefixMatch; + } + + /** + * Set the prefixMatch property: An array of strings with maximum 10 blob prefixes to be included in the inventory. + * + * @param prefixMatch the prefixMatch value to set. + * @return the BlobInventoryPolicyFilter object itself. + */ + public BlobInventoryPolicyFilter withPrefixMatch(List prefixMatch) { + this.prefixMatch = prefixMatch; + return this; + } + + /** + * Get the excludePrefix property: An array of strings with maximum 10 blob prefixes to be excluded from the + * inventory. + * + * @return the excludePrefix value. + */ + public List excludePrefix() { + return this.excludePrefix; + } + + /** + * Set the excludePrefix property: An array of strings with maximum 10 blob prefixes to be excluded from the + * inventory. + * + * @param excludePrefix the excludePrefix value to set. + * @return the BlobInventoryPolicyFilter object itself. + */ + public BlobInventoryPolicyFilter withExcludePrefix(List excludePrefix) { + this.excludePrefix = excludePrefix; + return this; + } + + /** + * Get the blobTypes property: An array of predefined enum values. Valid values include blockBlob, appendBlob, + * pageBlob. Hns accounts does not support pageBlobs. This field is required when definition.objectType property is + * set to 'Blob'. + * + * @return the blobTypes value. + */ + public List blobTypes() { + return this.blobTypes; + } + + /** + * Set the blobTypes property: An array of predefined enum values. Valid values include blockBlob, appendBlob, + * pageBlob. Hns accounts does not support pageBlobs. This field is required when definition.objectType property is + * set to 'Blob'. + * + * @param blobTypes the blobTypes value to set. + * @return the BlobInventoryPolicyFilter object itself. + */ + public BlobInventoryPolicyFilter withBlobTypes(List blobTypes) { + this.blobTypes = blobTypes; + return this; + } + + /** + * Get the includeBlobVersions property: Includes blob versions in blob inventory when value is set to true. The + * definition.schemaFields values 'VersionId and IsCurrentVersion' are required if this property is set to true, + * else they must be excluded. + * + * @return the includeBlobVersions value. + */ + public Boolean includeBlobVersions() { + return this.includeBlobVersions; + } + + /** + * Set the includeBlobVersions property: Includes blob versions in blob inventory when value is set to true. The + * definition.schemaFields values 'VersionId and IsCurrentVersion' are required if this property is set to true, + * else they must be excluded. + * + * @param includeBlobVersions the includeBlobVersions value to set. + * @return the BlobInventoryPolicyFilter object itself. + */ + public BlobInventoryPolicyFilter withIncludeBlobVersions(Boolean includeBlobVersions) { + this.includeBlobVersions = includeBlobVersions; + return this; + } + + /** + * Get the includeSnapshots property: Includes blob snapshots in blob inventory when value is set to true. The + * definition.schemaFields value 'Snapshot' is required if this property is set to true, else it must be excluded. + * + * @return the includeSnapshots value. + */ + public Boolean includeSnapshots() { + return this.includeSnapshots; + } + + /** + * Set the includeSnapshots property: Includes blob snapshots in blob inventory when value is set to true. The + * definition.schemaFields value 'Snapshot' is required if this property is set to true, else it must be excluded. + * + * @param includeSnapshots the includeSnapshots value to set. + * @return the BlobInventoryPolicyFilter object itself. + */ + public BlobInventoryPolicyFilter withIncludeSnapshots(Boolean includeSnapshots) { + this.includeSnapshots = includeSnapshots; + return this; + } + + /** + * Get the includeDeleted property: For 'Container' definition.objectType the definition.schemaFields must include + * 'Deleted, Version, DeletedTime and RemainingRetentionDays'. For 'Blob' definition.objectType and HNS enabled + * storage accounts the definition.schemaFields must include 'DeletionId, Deleted, DeletedTime and + * RemainingRetentionDays' and for Hns disabled accounts the definition.schemaFields must include 'Deleted and + * RemainingRetentionDays', else it must be excluded. + * + * @return the includeDeleted value. + */ + public Boolean includeDeleted() { + return this.includeDeleted; + } + + /** + * Set the includeDeleted property: For 'Container' definition.objectType the definition.schemaFields must include + * 'Deleted, Version, DeletedTime and RemainingRetentionDays'. For 'Blob' definition.objectType and HNS enabled + * storage accounts the definition.schemaFields must include 'DeletionId, Deleted, DeletedTime and + * RemainingRetentionDays' and for Hns disabled accounts the definition.schemaFields must include 'Deleted and + * RemainingRetentionDays', else it must be excluded. + * + * @param includeDeleted the includeDeleted value to set. + * @return the BlobInventoryPolicyFilter object itself. + */ + public BlobInventoryPolicyFilter withIncludeDeleted(Boolean includeDeleted) { + this.includeDeleted = includeDeleted; + return this; + } + + /** + * Get the creationTime property: This property is used to filter objects based on the object creation time. + * + * @return the creationTime value. + */ + public BlobInventoryCreationTime creationTime() { + return this.creationTime; + } + + /** + * Set the creationTime property: This property is used to filter objects based on the object creation time. + * + * @param creationTime the creationTime value to set. + * @return the BlobInventoryPolicyFilter object itself. + */ + public BlobInventoryPolicyFilter withCreationTime(BlobInventoryCreationTime creationTime) { + this.creationTime = creationTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (creationTime() != null) { + creationTime().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("prefixMatch", this.prefixMatch, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("excludePrefix", this.excludePrefix, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("blobTypes", this.blobTypes, (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("includeBlobVersions", this.includeBlobVersions); + jsonWriter.writeBooleanField("includeSnapshots", this.includeSnapshots); + jsonWriter.writeBooleanField("includeDeleted", this.includeDeleted); + jsonWriter.writeJsonField("creationTime", this.creationTime); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobInventoryPolicyFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobInventoryPolicyFilter 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 BlobInventoryPolicyFilter. + */ + public static BlobInventoryPolicyFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobInventoryPolicyFilter deserializedBlobInventoryPolicyFilter = new BlobInventoryPolicyFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("prefixMatch".equals(fieldName)) { + List prefixMatch = reader.readArray(reader1 -> reader1.getString()); + deserializedBlobInventoryPolicyFilter.prefixMatch = prefixMatch; + } else if ("excludePrefix".equals(fieldName)) { + List excludePrefix = reader.readArray(reader1 -> reader1.getString()); + deserializedBlobInventoryPolicyFilter.excludePrefix = excludePrefix; + } else if ("blobTypes".equals(fieldName)) { + List blobTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedBlobInventoryPolicyFilter.blobTypes = blobTypes; + } else if ("includeBlobVersions".equals(fieldName)) { + deserializedBlobInventoryPolicyFilter.includeBlobVersions + = reader.getNullable(JsonReader::getBoolean); + } else if ("includeSnapshots".equals(fieldName)) { + deserializedBlobInventoryPolicyFilter.includeSnapshots = reader.getNullable(JsonReader::getBoolean); + } else if ("includeDeleted".equals(fieldName)) { + deserializedBlobInventoryPolicyFilter.includeDeleted = reader.getNullable(JsonReader::getBoolean); + } else if ("creationTime".equals(fieldName)) { + deserializedBlobInventoryPolicyFilter.creationTime = BlobInventoryCreationTime.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobInventoryPolicyFilter; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyName.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyName.java new file mode 100644 index 0000000000000..2cc5802464daa --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyName.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for BlobInventoryPolicyName. + */ +public final class BlobInventoryPolicyName extends ExpandableStringEnum { + /** + * Static value default for BlobInventoryPolicyName. + */ + public static final BlobInventoryPolicyName DEFAULT = fromString("default"); + + /** + * Creates a new instance of BlobInventoryPolicyName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BlobInventoryPolicyName() { + } + + /** + * Creates or finds a BlobInventoryPolicyName from its string representation. + * + * @param name a name to look for. + * @return the corresponding BlobInventoryPolicyName. + */ + public static BlobInventoryPolicyName fromString(String name) { + return fromString(name, BlobInventoryPolicyName.class); + } + + /** + * Gets known BlobInventoryPolicyName values. + * + * @return known BlobInventoryPolicyName values. + */ + public static Collection values() { + return values(BlobInventoryPolicyName.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyRule.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyRule.java new file mode 100644 index 0000000000000..fd50dffe231d6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyRule.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * An object that wraps the blob inventory rule. Each rule is uniquely defined by name. + */ +@Fluent +public final class BlobInventoryPolicyRule implements JsonSerializable { + /* + * Rule is enabled when set to true. + */ + private boolean enabled; + + /* + * A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be + * unique within a policy. + */ + private String name; + + /* + * Container name where blob inventory files are stored. Must be pre-created. + */ + private String destination; + + /* + * An object that defines the blob inventory policy rule. + */ + private BlobInventoryPolicyDefinition definition; + + /** + * Creates an instance of BlobInventoryPolicyRule class. + */ + public BlobInventoryPolicyRule() { + } + + /** + * Get the enabled property: Rule is enabled when set to true. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Rule is enabled when set to true. + * + * @param enabled the enabled value to set. + * @return the BlobInventoryPolicyRule object itself. + */ + public BlobInventoryPolicyRule withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the name property: A rule name can contain any combination of alpha numeric characters. Rule name is + * case-sensitive. It must be unique within a policy. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A rule name can contain any combination of alpha numeric characters. Rule name is + * case-sensitive. It must be unique within a policy. + * + * @param name the name value to set. + * @return the BlobInventoryPolicyRule object itself. + */ + public BlobInventoryPolicyRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the destination property: Container name where blob inventory files are stored. Must be pre-created. + * + * @return the destination value. + */ + public String destination() { + return this.destination; + } + + /** + * Set the destination property: Container name where blob inventory files are stored. Must be pre-created. + * + * @param destination the destination value to set. + * @return the BlobInventoryPolicyRule object itself. + */ + public BlobInventoryPolicyRule withDestination(String destination) { + this.destination = destination; + return this; + } + + /** + * Get the definition property: An object that defines the blob inventory policy rule. + * + * @return the definition value. + */ + public BlobInventoryPolicyDefinition definition() { + return this.definition; + } + + /** + * Set the definition property: An object that defines the blob inventory policy rule. + * + * @param definition the definition value to set. + * @return the BlobInventoryPolicyRule object itself. + */ + public BlobInventoryPolicyRule withDefinition(BlobInventoryPolicyDefinition definition) { + this.definition = definition; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model BlobInventoryPolicyRule")); + } + if (destination() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destination in model BlobInventoryPolicyRule")); + } + if (definition() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property definition in model BlobInventoryPolicyRule")); + } else { + definition().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BlobInventoryPolicyRule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("destination", this.destination); + jsonWriter.writeJsonField("definition", this.definition); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobInventoryPolicyRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobInventoryPolicyRule 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 BlobInventoryPolicyRule. + */ + public static BlobInventoryPolicyRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobInventoryPolicyRule deserializedBlobInventoryPolicyRule = new BlobInventoryPolicyRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedBlobInventoryPolicyRule.enabled = reader.getBoolean(); + } else if ("name".equals(fieldName)) { + deserializedBlobInventoryPolicyRule.name = reader.getString(); + } else if ("destination".equals(fieldName)) { + deserializedBlobInventoryPolicyRule.destination = reader.getString(); + } else if ("definition".equals(fieldName)) { + deserializedBlobInventoryPolicyRule.definition = BlobInventoryPolicyDefinition.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobInventoryPolicyRule; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicySchema.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicySchema.java new file mode 100644 index 0000000000000..6d477c66515af --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicySchema.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.List; + +/** + * The storage account blob inventory policy rules. + */ +@Fluent +public final class BlobInventoryPolicySchema implements JsonSerializable { + /* + * Policy is enabled if set to true. + */ + private boolean enabled; + + /* + * Deprecated Property from API version 2021-04-01 onwards, the required destination container name must be + * specified at the rule level 'policy.rule.destination' + */ + private String destination; + + /* + * The valid value is Inventory + */ + private InventoryRuleType type; + + /* + * The storage account blob inventory policy rules. The rule is applied when it is enabled. + */ + private List rules; + + /** + * Creates an instance of BlobInventoryPolicySchema class. + */ + public BlobInventoryPolicySchema() { + } + + /** + * Get the enabled property: Policy is enabled if set to true. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Policy is enabled if set to true. + * + * @param enabled the enabled value to set. + * @return the BlobInventoryPolicySchema object itself. + */ + public BlobInventoryPolicySchema withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the destination property: Deprecated Property from API version 2021-04-01 onwards, the required destination + * container name must be specified at the rule level 'policy.rule.destination'. + * + * @return the destination value. + */ + public String destination() { + return this.destination; + } + + /** + * Get the type property: The valid value is Inventory. + * + * @return the type value. + */ + public InventoryRuleType type() { + return this.type; + } + + /** + * Set the type property: The valid value is Inventory. + * + * @param type the type value to set. + * @return the BlobInventoryPolicySchema object itself. + */ + public BlobInventoryPolicySchema withType(InventoryRuleType type) { + this.type = type; + return this; + } + + /** + * Get the rules property: The storage account blob inventory policy rules. The rule is applied when it is enabled. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: The storage account blob inventory policy rules. The rule is applied when it is enabled. + * + * @param rules the rules value to set. + * @return the BlobInventoryPolicySchema object itself. + */ + public BlobInventoryPolicySchema withRules(List rules) { + this.rules = rules; + 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 BlobInventoryPolicySchema")); + } + if (rules() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property rules in model BlobInventoryPolicySchema")); + } else { + rules().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BlobInventoryPolicySchema.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobInventoryPolicySchema from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobInventoryPolicySchema 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 BlobInventoryPolicySchema. + */ + public static BlobInventoryPolicySchema fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobInventoryPolicySchema deserializedBlobInventoryPolicySchema = new BlobInventoryPolicySchema(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedBlobInventoryPolicySchema.enabled = reader.getBoolean(); + } else if ("type".equals(fieldName)) { + deserializedBlobInventoryPolicySchema.type = InventoryRuleType.fromString(reader.getString()); + } else if ("rules".equals(fieldName)) { + List rules + = reader.readArray(reader1 -> BlobInventoryPolicyRule.fromJson(reader1)); + deserializedBlobInventoryPolicySchema.rules = rules; + } else if ("destination".equals(fieldName)) { + deserializedBlobInventoryPolicySchema.destination = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobInventoryPolicySchema; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreParameters.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreParameters.java new file mode 100644 index 0000000000000..3aaa213b573b0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreParameters.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +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.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Blob restore parameters. + */ +@Fluent +public final class BlobRestoreParameters implements JsonSerializable { + /* + * Restore blob to the specified time. + */ + private OffsetDateTime timeToRestore; + + /* + * Blob ranges to restore. + */ + private List blobRanges; + + /** + * Creates an instance of BlobRestoreParameters class. + */ + public BlobRestoreParameters() { + } + + /** + * Get the timeToRestore property: Restore blob to the specified time. + * + * @return the timeToRestore value. + */ + public OffsetDateTime timeToRestore() { + return this.timeToRestore; + } + + /** + * Set the timeToRestore property: Restore blob to the specified time. + * + * @param timeToRestore the timeToRestore value to set. + * @return the BlobRestoreParameters object itself. + */ + public BlobRestoreParameters withTimeToRestore(OffsetDateTime timeToRestore) { + this.timeToRestore = timeToRestore; + return this; + } + + /** + * Get the blobRanges property: Blob ranges to restore. + * + * @return the blobRanges value. + */ + public List blobRanges() { + return this.blobRanges; + } + + /** + * Set the blobRanges property: Blob ranges to restore. + * + * @param blobRanges the blobRanges value to set. + * @return the BlobRestoreParameters object itself. + */ + public BlobRestoreParameters withBlobRanges(List blobRanges) { + this.blobRanges = blobRanges; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (timeToRestore() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property timeToRestore in model BlobRestoreParameters")); + } + if (blobRanges() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property blobRanges in model BlobRestoreParameters")); + } else { + blobRanges().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BlobRestoreParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("timeToRestore", + this.timeToRestore == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.timeToRestore)); + jsonWriter.writeArrayField("blobRanges", this.blobRanges, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobRestoreParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobRestoreParameters 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 BlobRestoreParameters. + */ + public static BlobRestoreParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobRestoreParameters deserializedBlobRestoreParameters = new BlobRestoreParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("timeToRestore".equals(fieldName)) { + deserializedBlobRestoreParameters.timeToRestore = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("blobRanges".equals(fieldName)) { + List blobRanges = reader.readArray(reader1 -> BlobRestoreRange.fromJson(reader1)); + deserializedBlobRestoreParameters.blobRanges = blobRanges; + } else { + reader.skipChildren(); + } + } + + return deserializedBlobRestoreParameters; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreProgressStatus.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreProgressStatus.java new file mode 100644 index 0000000000000..13351b0666d36 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreProgressStatus.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The status of blob restore progress. Possible values are: - InProgress: Indicates that blob restore is ongoing. - + * Complete: Indicates that blob restore has been completed successfully. - Failed: Indicates that blob restore is + * failed. + */ +public final class BlobRestoreProgressStatus extends ExpandableStringEnum { + /** + * Static value InProgress for BlobRestoreProgressStatus. + */ + public static final BlobRestoreProgressStatus IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Complete for BlobRestoreProgressStatus. + */ + public static final BlobRestoreProgressStatus COMPLETE = fromString("Complete"); + + /** + * Static value Failed for BlobRestoreProgressStatus. + */ + public static final BlobRestoreProgressStatus FAILED = fromString("Failed"); + + /** + * Creates a new instance of BlobRestoreProgressStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BlobRestoreProgressStatus() { + } + + /** + * Creates or finds a BlobRestoreProgressStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding BlobRestoreProgressStatus. + */ + public static BlobRestoreProgressStatus fromString(String name) { + return fromString(name, BlobRestoreProgressStatus.class); + } + + /** + * Gets known BlobRestoreProgressStatus values. + * + * @return known BlobRestoreProgressStatus values. + */ + public static Collection values() { + return values(BlobRestoreProgressStatus.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreRange.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreRange.java new file mode 100644 index 0000000000000..7d2d47a0a72d7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreRange.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Blob range. + */ +@Fluent +public final class BlobRestoreRange implements JsonSerializable { + /* + * Blob start range. This is inclusive. Empty means account start. + */ + private String startRange; + + /* + * Blob end range. This is exclusive. Empty means account end. + */ + private String endRange; + + /** + * Creates an instance of BlobRestoreRange class. + */ + public BlobRestoreRange() { + } + + /** + * Get the startRange property: Blob start range. This is inclusive. Empty means account start. + * + * @return the startRange value. + */ + public String startRange() { + return this.startRange; + } + + /** + * Set the startRange property: Blob start range. This is inclusive. Empty means account start. + * + * @param startRange the startRange value to set. + * @return the BlobRestoreRange object itself. + */ + public BlobRestoreRange withStartRange(String startRange) { + this.startRange = startRange; + return this; + } + + /** + * Get the endRange property: Blob end range. This is exclusive. Empty means account end. + * + * @return the endRange value. + */ + public String endRange() { + return this.endRange; + } + + /** + * Set the endRange property: Blob end range. This is exclusive. Empty means account end. + * + * @param endRange the endRange value to set. + * @return the BlobRestoreRange object itself. + */ + public BlobRestoreRange withEndRange(String endRange) { + this.endRange = endRange; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (startRange() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property startRange in model BlobRestoreRange")); + } + if (endRange() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property endRange in model BlobRestoreRange")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BlobRestoreRange.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("startRange", this.startRange); + jsonWriter.writeStringField("endRange", this.endRange); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobRestoreRange from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobRestoreRange 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 BlobRestoreRange. + */ + public static BlobRestoreRange fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobRestoreRange deserializedBlobRestoreRange = new BlobRestoreRange(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startRange".equals(fieldName)) { + deserializedBlobRestoreRange.startRange = reader.getString(); + } else if ("endRange".equals(fieldName)) { + deserializedBlobRestoreRange.endRange = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobRestoreRange; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreStatus.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreStatus.java new file mode 100644 index 0000000000000..cfc9281bfa66d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreStatus.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.BlobRestoreStatusInner; + +/** + * An immutable client-side representation of BlobRestoreStatus. + */ +public interface BlobRestoreStatus { + /** + * Gets the status property: The status of blob restore progress. Possible values are: - InProgress: Indicates that + * blob restore is ongoing. - Complete: Indicates that blob restore has been completed successfully. - Failed: + * Indicates that blob restore is failed. + * + * @return the status value. + */ + BlobRestoreProgressStatus status(); + + /** + * Gets the failureReason property: Failure reason when blob restore is failed. + * + * @return the failureReason value. + */ + String failureReason(); + + /** + * Gets the restoreId property: Id for tracking blob restore request. + * + * @return the restoreId value. + */ + String restoreId(); + + /** + * Gets the parameters property: Blob restore request parameters. + * + * @return the parameters value. + */ + BlobRestoreParameters parameters(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.BlobRestoreStatusInner object. + * + * @return the inner object. + */ + BlobRestoreStatusInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobServiceItems.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobServiceItems.java new file mode 100644 index 0000000000000..c187a4429166e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobServiceItems.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.models.BlobServicePropertiesInner; +import java.io.IOException; +import java.util.List; + +/** + * The BlobServiceItems model. + */ +@Immutable +public final class BlobServiceItems implements JsonSerializable { + /* + * List of blob services returned. + */ + private List value; + + /** + * Creates an instance of BlobServiceItems class. + */ + public BlobServiceItems() { + } + + /** + * Get the value property: List of blob services returned. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobServiceItems from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobServiceItems 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 BlobServiceItems. + */ + public static BlobServiceItems fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobServiceItems deserializedBlobServiceItems = new BlobServiceItems(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> BlobServicePropertiesInner.fromJson(reader1)); + deserializedBlobServiceItems.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedBlobServiceItems; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobServiceProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobServiceProperties.java new file mode 100644 index 0000000000000..8b229abb98579 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobServiceProperties.java @@ -0,0 +1,490 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobServicePropertiesInner; + +/** + * An immutable client-side representation of BlobServiceProperties. + */ +public interface BlobServiceProperties { + /** + * 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 sku property: Sku name and tier. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the cors property: Specifies CORS rules for the Blob service. You can include up to five CorsRule elements + * in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and + * CORS will be disabled for the Blob service. + * + * @return the cors value. + */ + CorsRules cors(); + + /** + * Gets the defaultServiceVersion property: DefaultServiceVersion indicates the default version to use for requests + * to the Blob service if an incoming request’s version is not specified. Possible values include version 2008-10-27 + * and all more recent versions. + * + * @return the defaultServiceVersion value. + */ + String defaultServiceVersion(); + + /** + * Gets the deleteRetentionPolicy property: The blob service properties for blob soft delete. + * + * @return the deleteRetentionPolicy value. + */ + DeleteRetentionPolicy deleteRetentionPolicy(); + + /** + * Gets the isVersioningEnabled property: Versioning is enabled if set to true. + * + * @return the isVersioningEnabled value. + */ + Boolean isVersioningEnabled(); + + /** + * Gets the automaticSnapshotPolicyEnabled property: Deprecated in favor of isVersioningEnabled property. + * + * @return the automaticSnapshotPolicyEnabled value. + */ + Boolean automaticSnapshotPolicyEnabled(); + + /** + * Gets the changeFeed property: The blob service properties for change feed events. + * + * @return the changeFeed value. + */ + ChangeFeed changeFeed(); + + /** + * Gets the restorePolicy property: The blob service properties for blob restore policy. + * + * @return the restorePolicy value. + */ + RestorePolicyProperties restorePolicy(); + + /** + * Gets the containerDeleteRetentionPolicy property: The blob service properties for container soft delete. + * + * @return the containerDeleteRetentionPolicy value. + */ + DeleteRetentionPolicy containerDeleteRetentionPolicy(); + + /** + * Gets the lastAccessTimeTrackingPolicy property: The blob service property to configure last access time based + * tracking policy. + * + * @return the lastAccessTimeTrackingPolicy value. + */ + LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.BlobServicePropertiesInner object. + * + * @return the inner object. + */ + BlobServicePropertiesInner innerModel(); + + /** + * The entirety of the BlobServiceProperties definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The BlobServiceProperties definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the BlobServiceProperties definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the BlobServiceProperties definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the BlobServiceProperties 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.WithCors, DefinitionStages.WithDefaultServiceVersion, + DefinitionStages.WithDeleteRetentionPolicy, DefinitionStages.WithIsVersioningEnabled, + DefinitionStages.WithAutomaticSnapshotPolicyEnabled, DefinitionStages.WithChangeFeed, + DefinitionStages.WithRestorePolicy, DefinitionStages.WithContainerDeleteRetentionPolicy, + DefinitionStages.WithLastAccessTimeTrackingPolicy { + /** + * Executes the create request. + * + * @return the created resource. + */ + BlobServiceProperties create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BlobServiceProperties create(Context context); + } + + /** + * The stage of the BlobServiceProperties definition allowing to specify cors. + */ + interface WithCors { + /** + * Specifies the cors property: Specifies CORS rules for the Blob service. You can include up to five + * CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS + * rules will be deleted, and CORS will be disabled for the Blob service.. + * + * @param cors Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in + * the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, + * and CORS will be disabled for the Blob service. + * @return the next definition stage. + */ + WithCreate withCors(CorsRules cors); + } + + /** + * The stage of the BlobServiceProperties definition allowing to specify defaultServiceVersion. + */ + interface WithDefaultServiceVersion { + /** + * Specifies the defaultServiceVersion property: DefaultServiceVersion indicates the default version to use + * for requests to the Blob service if an incoming request’s version is not specified. Possible values + * include version 2008-10-27 and all more recent versions.. + * + * @param defaultServiceVersion DefaultServiceVersion indicates the default version to use for requests to + * the Blob service if an incoming request’s version is not specified. Possible values include version + * 2008-10-27 and all more recent versions. + * @return the next definition stage. + */ + WithCreate withDefaultServiceVersion(String defaultServiceVersion); + } + + /** + * The stage of the BlobServiceProperties definition allowing to specify deleteRetentionPolicy. + */ + interface WithDeleteRetentionPolicy { + /** + * Specifies the deleteRetentionPolicy property: The blob service properties for blob soft delete.. + * + * @param deleteRetentionPolicy The blob service properties for blob soft delete. + * @return the next definition stage. + */ + WithCreate withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy); + } + + /** + * The stage of the BlobServiceProperties definition allowing to specify isVersioningEnabled. + */ + interface WithIsVersioningEnabled { + /** + * Specifies the isVersioningEnabled property: Versioning is enabled if set to true.. + * + * @param isVersioningEnabled Versioning is enabled if set to true. + * @return the next definition stage. + */ + WithCreate withIsVersioningEnabled(Boolean isVersioningEnabled); + } + + /** + * The stage of the BlobServiceProperties definition allowing to specify automaticSnapshotPolicyEnabled. + */ + interface WithAutomaticSnapshotPolicyEnabled { + /** + * Specifies the automaticSnapshotPolicyEnabled property: Deprecated in favor of isVersioningEnabled + * property.. + * + * @param automaticSnapshotPolicyEnabled Deprecated in favor of isVersioningEnabled property. + * @return the next definition stage. + */ + WithCreate withAutomaticSnapshotPolicyEnabled(Boolean automaticSnapshotPolicyEnabled); + } + + /** + * The stage of the BlobServiceProperties definition allowing to specify changeFeed. + */ + interface WithChangeFeed { + /** + * Specifies the changeFeed property: The blob service properties for change feed events.. + * + * @param changeFeed The blob service properties for change feed events. + * @return the next definition stage. + */ + WithCreate withChangeFeed(ChangeFeed changeFeed); + } + + /** + * The stage of the BlobServiceProperties definition allowing to specify restorePolicy. + */ + interface WithRestorePolicy { + /** + * Specifies the restorePolicy property: The blob service properties for blob restore policy.. + * + * @param restorePolicy The blob service properties for blob restore policy. + * @return the next definition stage. + */ + WithCreate withRestorePolicy(RestorePolicyProperties restorePolicy); + } + + /** + * The stage of the BlobServiceProperties definition allowing to specify containerDeleteRetentionPolicy. + */ + interface WithContainerDeleteRetentionPolicy { + /** + * Specifies the containerDeleteRetentionPolicy property: The blob service properties for container soft + * delete.. + * + * @param containerDeleteRetentionPolicy The blob service properties for container soft delete. + * @return the next definition stage. + */ + WithCreate withContainerDeleteRetentionPolicy(DeleteRetentionPolicy containerDeleteRetentionPolicy); + } + + /** + * The stage of the BlobServiceProperties definition allowing to specify lastAccessTimeTrackingPolicy. + */ + interface WithLastAccessTimeTrackingPolicy { + /** + * Specifies the lastAccessTimeTrackingPolicy property: The blob service property to configure last access + * time based tracking policy.. + * + * @param lastAccessTimeTrackingPolicy The blob service property to configure last access time based + * tracking policy. + * @return the next definition stage. + */ + WithCreate withLastAccessTimeTrackingPolicy(LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy); + } + } + + /** + * Begins update for the BlobServiceProperties resource. + * + * @return the stage of resource update. + */ + BlobServiceProperties.Update update(); + + /** + * The template for BlobServiceProperties update. + */ + interface Update extends UpdateStages.WithCors, UpdateStages.WithDefaultServiceVersion, + UpdateStages.WithDeleteRetentionPolicy, UpdateStages.WithIsVersioningEnabled, + UpdateStages.WithAutomaticSnapshotPolicyEnabled, UpdateStages.WithChangeFeed, UpdateStages.WithRestorePolicy, + UpdateStages.WithContainerDeleteRetentionPolicy, UpdateStages.WithLastAccessTimeTrackingPolicy { + /** + * Executes the update request. + * + * @return the updated resource. + */ + BlobServiceProperties apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + BlobServiceProperties apply(Context context); + } + + /** + * The BlobServiceProperties update stages. + */ + interface UpdateStages { + /** + * The stage of the BlobServiceProperties update allowing to specify cors. + */ + interface WithCors { + /** + * Specifies the cors property: Specifies CORS rules for the Blob service. You can include up to five + * CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS + * rules will be deleted, and CORS will be disabled for the Blob service.. + * + * @param cors Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in + * the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, + * and CORS will be disabled for the Blob service. + * @return the next definition stage. + */ + Update withCors(CorsRules cors); + } + + /** + * The stage of the BlobServiceProperties update allowing to specify defaultServiceVersion. + */ + interface WithDefaultServiceVersion { + /** + * Specifies the defaultServiceVersion property: DefaultServiceVersion indicates the default version to use + * for requests to the Blob service if an incoming request’s version is not specified. Possible values + * include version 2008-10-27 and all more recent versions.. + * + * @param defaultServiceVersion DefaultServiceVersion indicates the default version to use for requests to + * the Blob service if an incoming request’s version is not specified. Possible values include version + * 2008-10-27 and all more recent versions. + * @return the next definition stage. + */ + Update withDefaultServiceVersion(String defaultServiceVersion); + } + + /** + * The stage of the BlobServiceProperties update allowing to specify deleteRetentionPolicy. + */ + interface WithDeleteRetentionPolicy { + /** + * Specifies the deleteRetentionPolicy property: The blob service properties for blob soft delete.. + * + * @param deleteRetentionPolicy The blob service properties for blob soft delete. + * @return the next definition stage. + */ + Update withDeleteRetentionPolicy(DeleteRetentionPolicy deleteRetentionPolicy); + } + + /** + * The stage of the BlobServiceProperties update allowing to specify isVersioningEnabled. + */ + interface WithIsVersioningEnabled { + /** + * Specifies the isVersioningEnabled property: Versioning is enabled if set to true.. + * + * @param isVersioningEnabled Versioning is enabled if set to true. + * @return the next definition stage. + */ + Update withIsVersioningEnabled(Boolean isVersioningEnabled); + } + + /** + * The stage of the BlobServiceProperties update allowing to specify automaticSnapshotPolicyEnabled. + */ + interface WithAutomaticSnapshotPolicyEnabled { + /** + * Specifies the automaticSnapshotPolicyEnabled property: Deprecated in favor of isVersioningEnabled + * property.. + * + * @param automaticSnapshotPolicyEnabled Deprecated in favor of isVersioningEnabled property. + * @return the next definition stage. + */ + Update withAutomaticSnapshotPolicyEnabled(Boolean automaticSnapshotPolicyEnabled); + } + + /** + * The stage of the BlobServiceProperties update allowing to specify changeFeed. + */ + interface WithChangeFeed { + /** + * Specifies the changeFeed property: The blob service properties for change feed events.. + * + * @param changeFeed The blob service properties for change feed events. + * @return the next definition stage. + */ + Update withChangeFeed(ChangeFeed changeFeed); + } + + /** + * The stage of the BlobServiceProperties update allowing to specify restorePolicy. + */ + interface WithRestorePolicy { + /** + * Specifies the restorePolicy property: The blob service properties for blob restore policy.. + * + * @param restorePolicy The blob service properties for blob restore policy. + * @return the next definition stage. + */ + Update withRestorePolicy(RestorePolicyProperties restorePolicy); + } + + /** + * The stage of the BlobServiceProperties update allowing to specify containerDeleteRetentionPolicy. + */ + interface WithContainerDeleteRetentionPolicy { + /** + * Specifies the containerDeleteRetentionPolicy property: The blob service properties for container soft + * delete.. + * + * @param containerDeleteRetentionPolicy The blob service properties for container soft delete. + * @return the next definition stage. + */ + Update withContainerDeleteRetentionPolicy(DeleteRetentionPolicy containerDeleteRetentionPolicy); + } + + /** + * The stage of the BlobServiceProperties update allowing to specify lastAccessTimeTrackingPolicy. + */ + interface WithLastAccessTimeTrackingPolicy { + /** + * Specifies the lastAccessTimeTrackingPolicy property: The blob service property to configure last access + * time based tracking policy.. + * + * @param lastAccessTimeTrackingPolicy The blob service property to configure last access time based + * tracking policy. + * @return the next definition stage. + */ + Update withLastAccessTimeTrackingPolicy(LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + BlobServiceProperties refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + BlobServiceProperties refresh(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobServices.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobServices.java new file mode 100644 index 0000000000000..559d9944349f1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobServices.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 BlobServices. + */ +public interface BlobServices { + /** + * List blob services of storage account. It returns a collection of one object named default. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List blob services of storage account. It returns a collection of one object named default. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + Response getServicePropertiesWithResponse(String resourceGroupName, String accountName, + Context context); + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + */ + BlobServiceProperties getServiceProperties(String resourceGroupName, String accountName); + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + BlobServiceProperties getServicePropertiesById(String id); + + /** + * Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + Response getServicePropertiesByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new BlobServiceProperties resource. + * + * @return the first stage of the new BlobServiceProperties definition. + */ + BlobServiceProperties.DefinitionStages.Blank define(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BurstingConstants.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BurstingConstants.java new file mode 100644 index 0000000000000..763ae686cf76b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BurstingConstants.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Constants used for calculating included burst IOPS and maximum burst credits for IOPS for a file share in the storage + * account. + */ +@Immutable +public final class BurstingConstants implements JsonSerializable { + /* + * The guaranteed floor of burst IOPS for small file shares. + */ + private Integer burstFloorIops; + + /* + * The scalar against provisioned IOPS in the file share included burst IOPS formula. + */ + private Double burstIOScalar; + + /* + * The time frame for bursting in seconds in the file share maximum burst credits for IOPS formula. + */ + private Integer burstTimeframeSeconds; + + /** + * Creates an instance of BurstingConstants class. + */ + public BurstingConstants() { + } + + /** + * Get the burstFloorIops property: The guaranteed floor of burst IOPS for small file shares. + * + * @return the burstFloorIops value. + */ + public Integer burstFloorIops() { + return this.burstFloorIops; + } + + /** + * Get the burstIOScalar property: The scalar against provisioned IOPS in the file share included burst IOPS + * formula. + * + * @return the burstIOScalar value. + */ + public Double burstIOScalar() { + return this.burstIOScalar; + } + + /** + * Get the burstTimeframeSeconds property: The time frame for bursting in seconds in the file share maximum burst + * credits for IOPS formula. + * + * @return the burstTimeframeSeconds value. + */ + public Integer burstTimeframeSeconds() { + return this.burstTimeframeSeconds; + } + + /** + * 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 BurstingConstants from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BurstingConstants 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 BurstingConstants. + */ + public static BurstingConstants fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BurstingConstants deserializedBurstingConstants = new BurstingConstants(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("burstFloorIOPS".equals(fieldName)) { + deserializedBurstingConstants.burstFloorIops = reader.getNullable(JsonReader::getInt); + } else if ("burstIOScalar".equals(fieldName)) { + deserializedBurstingConstants.burstIOScalar = reader.getNullable(JsonReader::getDouble); + } else if ("burstTimeframeSeconds".equals(fieldName)) { + deserializedBurstingConstants.burstTimeframeSeconds = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedBurstingConstants; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Bypass.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Bypass.java new file mode 100644 index 0000000000000..a09934641b766 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Bypass.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of + * Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. + */ +public final class Bypass extends ExpandableStringEnum { + /** + * Static value None for Bypass. + */ + public static final Bypass NONE = fromString("None"); + + /** + * Static value Logging for Bypass. + */ + public static final Bypass LOGGING = fromString("Logging"); + + /** + * Static value Metrics for Bypass. + */ + public static final Bypass METRICS = fromString("Metrics"); + + /** + * Static value AzureServices for Bypass. + */ + public static final Bypass AZURE_SERVICES = fromString("AzureServices"); + + /** + * Creates a new instance of Bypass value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Bypass() { + } + + /** + * Creates or finds a Bypass from its string representation. + * + * @param name a name to look for. + * @return the corresponding Bypass. + */ + public static Bypass fromString(String name) { + return fromString(name, Bypass.class); + } + + /** + * Gets known Bypass values. + * + * @return known Bypass values. + */ + public static Collection values() { + return values(Bypass.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ChangeFeed.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ChangeFeed.java new file mode 100644 index 0000000000000..9454a9aef6548 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ChangeFeed.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 blob service properties for change feed events. + */ +@Fluent +public final class ChangeFeed implements JsonSerializable { + /* + * Indicates whether change feed event logging is enabled for the Blob service. + */ + private Boolean enabled; + + /* + * Indicates the duration of changeFeed retention in days. Minimum value is 1 day and maximum value is 146000 days + * (400 years). A null value indicates an infinite retention of the change feed. + */ + private Integer retentionInDays; + + /** + * Creates an instance of ChangeFeed class. + */ + public ChangeFeed() { + } + + /** + * Get the enabled property: Indicates whether change feed event logging is enabled for the Blob service. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Indicates whether change feed event logging is enabled for the Blob service. + * + * @param enabled the enabled value to set. + * @return the ChangeFeed object itself. + */ + public ChangeFeed withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the retentionInDays property: Indicates the duration of changeFeed retention in days. Minimum value is 1 day + * and maximum value is 146000 days (400 years). A null value indicates an infinite retention of the change feed. + * + * @return the retentionInDays value. + */ + public Integer retentionInDays() { + return this.retentionInDays; + } + + /** + * Set the retentionInDays property: Indicates the duration of changeFeed retention in days. Minimum value is 1 day + * and maximum value is 146000 days (400 years). A null value indicates an infinite retention of the change feed. + * + * @param retentionInDays the retentionInDays value to set. + * @return the ChangeFeed object itself. + */ + public ChangeFeed withRetentionInDays(Integer retentionInDays) { + this.retentionInDays = retentionInDays; + 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.writeBooleanField("enabled", this.enabled); + jsonWriter.writeNumberField("retentionInDays", this.retentionInDays); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChangeFeed from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChangeFeed 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 ChangeFeed. + */ + public static ChangeFeed fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChangeFeed deserializedChangeFeed = new ChangeFeed(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedChangeFeed.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("retentionInDays".equals(fieldName)) { + deserializedChangeFeed.retentionInDays = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedChangeFeed; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CheckNameAvailabilityResult.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CheckNameAvailabilityResult.java new file mode 100644 index 0000000000000..decb1c2e46965 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CheckNameAvailabilityResult.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.CheckNameAvailabilityResultInner; + +/** + * An immutable client-side representation of CheckNameAvailabilityResult. + */ +public interface CheckNameAvailabilityResult { + /** + * Gets the nameAvailable property: Gets a boolean value that indicates whether the name is available for you to + * use. If true, the name is available. If false, the name has already been taken or is invalid and cannot be used. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the reason property: Gets the reason that a storage account name could not be used. The Reason element is + * only returned if NameAvailable is false. + * + * @return the reason value. + */ + Reason reason(); + + /** + * Gets the message property: Gets an error message explaining the Reason value in more detail. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.CheckNameAvailabilityResultInner object. + * + * @return the inner object. + */ + CheckNameAvailabilityResultInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CorsRule.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CorsRule.java new file mode 100644 index 0000000000000..b75bb6e070887 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CorsRule.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.List; + +/** + * Specifies a CORS rule for the Blob service. + */ +@Fluent +public final class CorsRule implements JsonSerializable { + /* + * Required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or "*" to allow + * all domains + */ + private List allowedOrigins; + + /* + * Required if CorsRule element is present. A list of HTTP methods that are allowed to be executed by the origin. + */ + private List allowedMethods; + + /* + * Required if CorsRule element is present. The number of seconds that the client/browser should cache a preflight + * response. + */ + private int maxAgeInSeconds; + + /* + * Required if CorsRule element is present. A list of response headers to expose to CORS clients. + */ + private List exposedHeaders; + + /* + * Required if CorsRule element is present. A list of headers allowed to be part of the cross-origin request. + */ + private List allowedHeaders; + + /** + * Creates an instance of CorsRule class. + */ + public CorsRule() { + } + + /** + * Get the allowedOrigins property: Required if CorsRule element is present. A list of origin domains that will be + * allowed via CORS, or "*" to allow all domains. + * + * @return the allowedOrigins value. + */ + public List allowedOrigins() { + return this.allowedOrigins; + } + + /** + * Set the allowedOrigins property: Required if CorsRule element is present. A list of origin domains that will be + * allowed via CORS, or "*" to allow all domains. + * + * @param allowedOrigins the allowedOrigins value to set. + * @return the CorsRule object itself. + */ + public CorsRule withAllowedOrigins(List allowedOrigins) { + this.allowedOrigins = allowedOrigins; + return this; + } + + /** + * Get the allowedMethods property: Required if CorsRule element is present. A list of HTTP methods that are allowed + * to be executed by the origin. + * + * @return the allowedMethods value. + */ + public List allowedMethods() { + return this.allowedMethods; + } + + /** + * Set the allowedMethods property: Required if CorsRule element is present. A list of HTTP methods that are allowed + * to be executed by the origin. + * + * @param allowedMethods the allowedMethods value to set. + * @return the CorsRule object itself. + */ + public CorsRule withAllowedMethods(List allowedMethods) { + this.allowedMethods = allowedMethods; + return this; + } + + /** + * Get the maxAgeInSeconds property: Required if CorsRule element is present. The number of seconds that the + * client/browser should cache a preflight response. + * + * @return the maxAgeInSeconds value. + */ + public int maxAgeInSeconds() { + return this.maxAgeInSeconds; + } + + /** + * Set the maxAgeInSeconds property: Required if CorsRule element is present. The number of seconds that the + * client/browser should cache a preflight response. + * + * @param maxAgeInSeconds the maxAgeInSeconds value to set. + * @return the CorsRule object itself. + */ + public CorsRule withMaxAgeInSeconds(int maxAgeInSeconds) { + this.maxAgeInSeconds = maxAgeInSeconds; + return this; + } + + /** + * Get the exposedHeaders property: Required if CorsRule element is present. A list of response headers to expose to + * CORS clients. + * + * @return the exposedHeaders value. + */ + public List exposedHeaders() { + return this.exposedHeaders; + } + + /** + * Set the exposedHeaders property: Required if CorsRule element is present. A list of response headers to expose to + * CORS clients. + * + * @param exposedHeaders the exposedHeaders value to set. + * @return the CorsRule object itself. + */ + public CorsRule withExposedHeaders(List exposedHeaders) { + this.exposedHeaders = exposedHeaders; + return this; + } + + /** + * Get the allowedHeaders property: Required if CorsRule element is present. A list of headers allowed to be part of + * the cross-origin request. + * + * @return the allowedHeaders value. + */ + public List allowedHeaders() { + return this.allowedHeaders; + } + + /** + * Set the allowedHeaders property: Required if CorsRule element is present. A list of headers allowed to be part of + * the cross-origin request. + * + * @param allowedHeaders the allowedHeaders value to set. + * @return the CorsRule object itself. + */ + public CorsRule withAllowedHeaders(List allowedHeaders) { + this.allowedHeaders = allowedHeaders; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (allowedOrigins() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property allowedOrigins in model CorsRule")); + } + if (allowedMethods() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property allowedMethods in model CorsRule")); + } + if (exposedHeaders() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property exposedHeaders in model CorsRule")); + } + if (allowedHeaders() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property allowedHeaders in model CorsRule")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CorsRule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("allowedOrigins", this.allowedOrigins, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("allowedMethods", this.allowedMethods, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeIntField("maxAgeInSeconds", this.maxAgeInSeconds); + jsonWriter.writeArrayField("exposedHeaders", this.exposedHeaders, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("allowedHeaders", this.allowedHeaders, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CorsRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CorsRule 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 CorsRule. + */ + public static CorsRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CorsRule deserializedCorsRule = new CorsRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowedOrigins".equals(fieldName)) { + List allowedOrigins = reader.readArray(reader1 -> reader1.getString()); + deserializedCorsRule.allowedOrigins = allowedOrigins; + } else if ("allowedMethods".equals(fieldName)) { + List allowedMethods + = reader.readArray(reader1 -> AllowedMethods.fromString(reader1.getString())); + deserializedCorsRule.allowedMethods = allowedMethods; + } else if ("maxAgeInSeconds".equals(fieldName)) { + deserializedCorsRule.maxAgeInSeconds = reader.getInt(); + } else if ("exposedHeaders".equals(fieldName)) { + List exposedHeaders = reader.readArray(reader1 -> reader1.getString()); + deserializedCorsRule.exposedHeaders = exposedHeaders; + } else if ("allowedHeaders".equals(fieldName)) { + List allowedHeaders = reader.readArray(reader1 -> reader1.getString()); + deserializedCorsRule.allowedHeaders = allowedHeaders; + } else { + reader.skipChildren(); + } + } + + return deserializedCorsRule; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CorsRules.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CorsRules.java new file mode 100644 index 0000000000000..047cbfcbea359 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CorsRules.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.List; + +/** + * Sets the CORS rules. You can include up to five CorsRule elements in the request. + */ +@Fluent +public final class CorsRules implements JsonSerializable { + /* + * The List of CORS rules. You can include up to five CorsRule elements in the request. + */ + private List corsRules; + + /** + * Creates an instance of CorsRules class. + */ + public CorsRules() { + } + + /** + * Get the corsRules property: The List of CORS rules. You can include up to five CorsRule elements in the request. + * + * @return the corsRules value. + */ + public List corsRules() { + return this.corsRules; + } + + /** + * Set the corsRules property: The List of CORS rules. You can include up to five CorsRule elements in the request. + * + * @param corsRules the corsRules value to set. + * @return the CorsRules object itself. + */ + public CorsRules withCorsRules(List corsRules) { + this.corsRules = corsRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (corsRules() != null) { + corsRules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("corsRules", this.corsRules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CorsRules from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CorsRules 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 CorsRules. + */ + public static CorsRules fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CorsRules deserializedCorsRules = new CorsRules(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("corsRules".equals(fieldName)) { + List corsRules = reader.readArray(reader1 -> CorsRule.fromJson(reader1)); + deserializedCorsRules.corsRules = corsRules; + } else { + reader.skipChildren(); + } + } + + return deserializedCorsRules; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CustomDomain.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CustomDomain.java new file mode 100644 index 0000000000000..d55dde5139687 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CustomDomain.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * The custom domain assigned to this storage account. This can be set via Update. + */ +@Fluent +public final class CustomDomain implements JsonSerializable { + /* + * Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + */ + private String name; + + /* + * Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on + * updates. + */ + private Boolean useSubDomainName; + + /** + * Creates an instance of CustomDomain class. + */ + public CustomDomain() { + } + + /** + * Get the name property: Gets or sets the custom domain name assigned to the storage account. Name is the CNAME + * source. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets or sets the custom domain name assigned to the storage account. Name is the CNAME + * source. + * + * @param name the name value to set. + * @return the CustomDomain object itself. + */ + public CustomDomain withName(String name) { + this.name = name; + return this; + } + + /** + * Get the useSubDomainName property: Indicates whether indirect CName validation is enabled. Default value is + * false. This should only be set on updates. + * + * @return the useSubDomainName value. + */ + public Boolean useSubDomainName() { + return this.useSubDomainName; + } + + /** + * Set the useSubDomainName property: Indicates whether indirect CName validation is enabled. Default value is + * false. This should only be set on updates. + * + * @param useSubDomainName the useSubDomainName value to set. + * @return the CustomDomain object itself. + */ + public CustomDomain withUseSubDomainName(Boolean useSubDomainName) { + this.useSubDomainName = useSubDomainName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model CustomDomain")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomDomain.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeBooleanField("useSubDomainName", this.useSubDomainName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomDomain from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomDomain 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 CustomDomain. + */ + public static CustomDomain fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomDomain deserializedCustomDomain = new CustomDomain(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCustomDomain.name = reader.getString(); + } else if ("useSubDomainName".equals(fieldName)) { + deserializedCustomDomain.useSubDomainName = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomDomain; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DateAfterCreation.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DateAfterCreation.java new file mode 100644 index 0000000000000..69e32b69a5cbe --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DateAfterCreation.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Object to define snapshot and version action conditions. + */ +@Fluent +public final class DateAfterCreation implements JsonSerializable { + /* + * Value indicating the age in days after creation + */ + private float daysAfterCreationGreaterThan; + + /* + * Value indicating the age in days after last blob tier change time. This property is only applicable for + * tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based + * actions. The blob will be archived if both the conditions are satisfied. + */ + private Float daysAfterLastTierChangeGreaterThan; + + /** + * Creates an instance of DateAfterCreation class. + */ + public DateAfterCreation() { + } + + /** + * Get the daysAfterCreationGreaterThan property: Value indicating the age in days after creation. + * + * @return the daysAfterCreationGreaterThan value. + */ + public float daysAfterCreationGreaterThan() { + return this.daysAfterCreationGreaterThan; + } + + /** + * Set the daysAfterCreationGreaterThan property: Value indicating the age in days after creation. + * + * @param daysAfterCreationGreaterThan the daysAfterCreationGreaterThan value to set. + * @return the DateAfterCreation object itself. + */ + public DateAfterCreation withDaysAfterCreationGreaterThan(float daysAfterCreationGreaterThan) { + this.daysAfterCreationGreaterThan = daysAfterCreationGreaterThan; + return this; + } + + /** + * Get the daysAfterLastTierChangeGreaterThan property: Value indicating the age in days after last blob tier change + * time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be + * set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied. + * + * @return the daysAfterLastTierChangeGreaterThan value. + */ + public Float daysAfterLastTierChangeGreaterThan() { + return this.daysAfterLastTierChangeGreaterThan; + } + + /** + * Set the daysAfterLastTierChangeGreaterThan property: Value indicating the age in days after last blob tier change + * time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be + * set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied. + * + * @param daysAfterLastTierChangeGreaterThan the daysAfterLastTierChangeGreaterThan value to set. + * @return the DateAfterCreation object itself. + */ + public DateAfterCreation withDaysAfterLastTierChangeGreaterThan(Float daysAfterLastTierChangeGreaterThan) { + this.daysAfterLastTierChangeGreaterThan = daysAfterLastTierChangeGreaterThan; + 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.writeFloatField("daysAfterCreationGreaterThan", this.daysAfterCreationGreaterThan); + jsonWriter.writeNumberField("daysAfterLastTierChangeGreaterThan", this.daysAfterLastTierChangeGreaterThan); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DateAfterCreation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DateAfterCreation 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 DateAfterCreation. + */ + public static DateAfterCreation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DateAfterCreation deserializedDateAfterCreation = new DateAfterCreation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("daysAfterCreationGreaterThan".equals(fieldName)) { + deserializedDateAfterCreation.daysAfterCreationGreaterThan = reader.getFloat(); + } else if ("daysAfterLastTierChangeGreaterThan".equals(fieldName)) { + deserializedDateAfterCreation.daysAfterLastTierChangeGreaterThan + = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedDateAfterCreation; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DateAfterModification.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DateAfterModification.java new file mode 100644 index 0000000000000..b3953ec677900 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DateAfterModification.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Object to define the base blob action conditions. Properties daysAfterModificationGreaterThan, + * daysAfterLastAccessTimeGreaterThan and daysAfterCreationGreaterThan are mutually exclusive. The + * daysAfterLastTierChangeGreaterThan property is only applicable for tierToArchive actions which requires + * daysAfterModificationGreaterThan to be set, also it cannot be used in conjunction with + * daysAfterLastAccessTimeGreaterThan or daysAfterCreationGreaterThan. + */ +@Fluent +public final class DateAfterModification implements JsonSerializable { + /* + * Value indicating the age in days after last modification + */ + private Float daysAfterModificationGreaterThan; + + /* + * Value indicating the age in days after last blob access. This property can only be used in conjunction with last + * access time tracking policy + */ + private Float daysAfterLastAccessTimeGreaterThan; + + /* + * Value indicating the age in days after last blob tier change time. This property is only applicable for + * tierToArchive actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The + * blob will be archived if both the conditions are satisfied. + */ + private Float daysAfterLastTierChangeGreaterThan; + + /* + * Value indicating the age in days after blob creation. + */ + private Float daysAfterCreationGreaterThan; + + /** + * Creates an instance of DateAfterModification class. + */ + public DateAfterModification() { + } + + /** + * Get the daysAfterModificationGreaterThan property: Value indicating the age in days after last modification. + * + * @return the daysAfterModificationGreaterThan value. + */ + public Float daysAfterModificationGreaterThan() { + return this.daysAfterModificationGreaterThan; + } + + /** + * Set the daysAfterModificationGreaterThan property: Value indicating the age in days after last modification. + * + * @param daysAfterModificationGreaterThan the daysAfterModificationGreaterThan value to set. + * @return the DateAfterModification object itself. + */ + public DateAfterModification withDaysAfterModificationGreaterThan(Float daysAfterModificationGreaterThan) { + this.daysAfterModificationGreaterThan = daysAfterModificationGreaterThan; + return this; + } + + /** + * Get the daysAfterLastAccessTimeGreaterThan property: Value indicating the age in days after last blob access. + * This property can only be used in conjunction with last access time tracking policy. + * + * @return the daysAfterLastAccessTimeGreaterThan value. + */ + public Float daysAfterLastAccessTimeGreaterThan() { + return this.daysAfterLastAccessTimeGreaterThan; + } + + /** + * Set the daysAfterLastAccessTimeGreaterThan property: Value indicating the age in days after last blob access. + * This property can only be used in conjunction with last access time tracking policy. + * + * @param daysAfterLastAccessTimeGreaterThan the daysAfterLastAccessTimeGreaterThan value to set. + * @return the DateAfterModification object itself. + */ + public DateAfterModification withDaysAfterLastAccessTimeGreaterThan(Float daysAfterLastAccessTimeGreaterThan) { + this.daysAfterLastAccessTimeGreaterThan = daysAfterLastAccessTimeGreaterThan; + return this; + } + + /** + * Get the daysAfterLastTierChangeGreaterThan property: Value indicating the age in days after last blob tier change + * time. This property is only applicable for tierToArchive actions and requires daysAfterModificationGreaterThan to + * be set for baseBlobs based actions. The blob will be archived if both the conditions are satisfied. + * + * @return the daysAfterLastTierChangeGreaterThan value. + */ + public Float daysAfterLastTierChangeGreaterThan() { + return this.daysAfterLastTierChangeGreaterThan; + } + + /** + * Set the daysAfterLastTierChangeGreaterThan property: Value indicating the age in days after last blob tier change + * time. This property is only applicable for tierToArchive actions and requires daysAfterModificationGreaterThan to + * be set for baseBlobs based actions. The blob will be archived if both the conditions are satisfied. + * + * @param daysAfterLastTierChangeGreaterThan the daysAfterLastTierChangeGreaterThan value to set. + * @return the DateAfterModification object itself. + */ + public DateAfterModification withDaysAfterLastTierChangeGreaterThan(Float daysAfterLastTierChangeGreaterThan) { + this.daysAfterLastTierChangeGreaterThan = daysAfterLastTierChangeGreaterThan; + return this; + } + + /** + * Get the daysAfterCreationGreaterThan property: Value indicating the age in days after blob creation. + * + * @return the daysAfterCreationGreaterThan value. + */ + public Float daysAfterCreationGreaterThan() { + return this.daysAfterCreationGreaterThan; + } + + /** + * Set the daysAfterCreationGreaterThan property: Value indicating the age in days after blob creation. + * + * @param daysAfterCreationGreaterThan the daysAfterCreationGreaterThan value to set. + * @return the DateAfterModification object itself. + */ + public DateAfterModification withDaysAfterCreationGreaterThan(Float daysAfterCreationGreaterThan) { + this.daysAfterCreationGreaterThan = daysAfterCreationGreaterThan; + 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.writeNumberField("daysAfterModificationGreaterThan", this.daysAfterModificationGreaterThan); + jsonWriter.writeNumberField("daysAfterLastAccessTimeGreaterThan", this.daysAfterLastAccessTimeGreaterThan); + jsonWriter.writeNumberField("daysAfterLastTierChangeGreaterThan", this.daysAfterLastTierChangeGreaterThan); + jsonWriter.writeNumberField("daysAfterCreationGreaterThan", this.daysAfterCreationGreaterThan); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DateAfterModification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DateAfterModification 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 DateAfterModification. + */ + public static DateAfterModification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DateAfterModification deserializedDateAfterModification = new DateAfterModification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("daysAfterModificationGreaterThan".equals(fieldName)) { + deserializedDateAfterModification.daysAfterModificationGreaterThan + = reader.getNullable(JsonReader::getFloat); + } else if ("daysAfterLastAccessTimeGreaterThan".equals(fieldName)) { + deserializedDateAfterModification.daysAfterLastAccessTimeGreaterThan + = reader.getNullable(JsonReader::getFloat); + } else if ("daysAfterLastTierChangeGreaterThan".equals(fieldName)) { + deserializedDateAfterModification.daysAfterLastTierChangeGreaterThan + = reader.getNullable(JsonReader::getFloat); + } else if ("daysAfterCreationGreaterThan".equals(fieldName)) { + deserializedDateAfterModification.daysAfterCreationGreaterThan + = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedDateAfterModification; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DefaultAction.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DefaultAction.java new file mode 100644 index 0000000000000..7f11982dd786a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DefaultAction.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +/** + * Specifies the default action of allow or deny when no other rules match. + */ +public enum DefaultAction { + /** + * Enum value Allow. + */ + ALLOW("Allow"), + + /** + * Enum value Deny. + */ + DENY("Deny"); + + /** + * The actual serialized value for a DefaultAction instance. + */ + private final String value; + + DefaultAction(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DefaultAction instance. + * + * @param value the serialized value to parse. + * @return the parsed DefaultAction object, or null if unable to parse. + */ + public static DefaultAction fromString(String value) { + if (value == null) { + return null; + } + DefaultAction[] items = DefaultAction.values(); + for (DefaultAction item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DefaultSharePermission.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DefaultSharePermission.java new file mode 100644 index 0000000000000..32321b44b1453 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DefaultSharePermission.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Default share permission for users using Kerberos authentication if RBAC role is not assigned. + */ +public final class DefaultSharePermission extends ExpandableStringEnum { + /** + * Static value None for DefaultSharePermission. + */ + public static final DefaultSharePermission NONE = fromString("None"); + + /** + * Static value StorageFileDataSmbShareReader for DefaultSharePermission. + */ + public static final DefaultSharePermission STORAGE_FILE_DATA_SMB_SHARE_READER + = fromString("StorageFileDataSmbShareReader"); + + /** + * Static value StorageFileDataSmbShareContributor for DefaultSharePermission. + */ + public static final DefaultSharePermission STORAGE_FILE_DATA_SMB_SHARE_CONTRIBUTOR + = fromString("StorageFileDataSmbShareContributor"); + + /** + * Static value StorageFileDataSmbShareElevatedContributor for DefaultSharePermission. + */ + public static final DefaultSharePermission STORAGE_FILE_DATA_SMB_SHARE_ELEVATED_CONTRIBUTOR + = fromString("StorageFileDataSmbShareElevatedContributor"); + + /** + * Creates a new instance of DefaultSharePermission value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DefaultSharePermission() { + } + + /** + * Creates or finds a DefaultSharePermission from its string representation. + * + * @param name a name to look for. + * @return the corresponding DefaultSharePermission. + */ + public static DefaultSharePermission fromString(String name) { + return fromString(name, DefaultSharePermission.class); + } + + /** + * Gets known DefaultSharePermission values. + * + * @return known DefaultSharePermission values. + */ + public static Collection values() { + return values(DefaultSharePermission.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeleteRetentionPolicy.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeleteRetentionPolicy.java new file mode 100644 index 0000000000000..ebed12e24fa64 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeleteRetentionPolicy.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 service properties for soft delete. + */ +@Fluent +public final class DeleteRetentionPolicy implements JsonSerializable { + /* + * Indicates whether DeleteRetentionPolicy is enabled. + */ + private Boolean enabled; + + /* + * Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and + * the maximum value can be 365. + */ + private Integer days; + + /* + * This property when set to true allows deletion of the soft deleted blob versions and snapshots. This property + * cannot be used blob restore policy. This property only applies to blob service and does not apply to containers + * or file share. + */ + private Boolean allowPermanentDelete; + + /** + * Creates an instance of DeleteRetentionPolicy class. + */ + public DeleteRetentionPolicy() { + } + + /** + * Get the enabled property: Indicates whether DeleteRetentionPolicy is enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Indicates whether DeleteRetentionPolicy is enabled. + * + * @param enabled the enabled value to set. + * @return the DeleteRetentionPolicy object itself. + */ + public DeleteRetentionPolicy withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the days property: Indicates the number of days that the deleted item should be retained. The minimum + * specified value can be 1 and the maximum value can be 365. + * + * @return the days value. + */ + public Integer days() { + return this.days; + } + + /** + * Set the days property: Indicates the number of days that the deleted item should be retained. The minimum + * specified value can be 1 and the maximum value can be 365. + * + * @param days the days value to set. + * @return the DeleteRetentionPolicy object itself. + */ + public DeleteRetentionPolicy withDays(Integer days) { + this.days = days; + return this; + } + + /** + * Get the allowPermanentDelete property: This property when set to true allows deletion of the soft deleted blob + * versions and snapshots. This property cannot be used blob restore policy. This property only applies to blob + * service and does not apply to containers or file share. + * + * @return the allowPermanentDelete value. + */ + public Boolean allowPermanentDelete() { + return this.allowPermanentDelete; + } + + /** + * Set the allowPermanentDelete property: This property when set to true allows deletion of the soft deleted blob + * versions and snapshots. This property cannot be used blob restore policy. This property only applies to blob + * service and does not apply to containers or file share. + * + * @param allowPermanentDelete the allowPermanentDelete value to set. + * @return the DeleteRetentionPolicy object itself. + */ + public DeleteRetentionPolicy withAllowPermanentDelete(Boolean allowPermanentDelete) { + this.allowPermanentDelete = allowPermanentDelete; + 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.writeBooleanField("enabled", this.enabled); + jsonWriter.writeNumberField("days", this.days); + jsonWriter.writeBooleanField("allowPermanentDelete", this.allowPermanentDelete); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeleteRetentionPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeleteRetentionPolicy 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 DeleteRetentionPolicy. + */ + public static DeleteRetentionPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeleteRetentionPolicy deserializedDeleteRetentionPolicy = new DeleteRetentionPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedDeleteRetentionPolicy.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("days".equals(fieldName)) { + deserializedDeleteRetentionPolicy.days = reader.getNullable(JsonReader::getInt); + } else if ("allowPermanentDelete".equals(fieldName)) { + deserializedDeleteRetentionPolicy.allowPermanentDelete = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedDeleteRetentionPolicy; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedAccount.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedAccount.java new file mode 100644 index 0000000000000..3845a61bd7d45 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedAccount.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.DeletedAccountInner; + +/** + * An immutable client-side representation of DeletedAccount. + */ +public interface DeletedAccount { + /** + * 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 storageAccountResourceId property: Full resource id of the original storage account. + * + * @return the storageAccountResourceId value. + */ + String storageAccountResourceId(); + + /** + * Gets the location property: Location of the deleted account. + * + * @return the location value. + */ + String location(); + + /** + * Gets the restoreReference property: Can be used to attempt recovering this deleted account via PutStorageAccount + * API. + * + * @return the restoreReference value. + */ + String restoreReference(); + + /** + * Gets the creationTime property: Creation time of the deleted account. + * + * @return the creationTime value. + */ + String creationTime(); + + /** + * Gets the deletionTime property: Deletion time of the deleted account. + * + * @return the deletionTime value. + */ + String deletionTime(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.DeletedAccountInner object. + * + * @return the inner object. + */ + DeletedAccountInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedAccountListResult.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedAccountListResult.java new file mode 100644 index 0000000000000..d4ab98be213a7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedAccountListResult.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.models.DeletedAccountInner; +import java.io.IOException; +import java.util.List; + +/** + * The response from the List Deleted Accounts operation. + */ +@Immutable +public final class DeletedAccountListResult implements JsonSerializable { + /* + * Gets the list of deleted accounts and their properties. + */ + private List value; + + /* + * Request URL that can be used to query next page of deleted accounts. Returned when total number of requested + * deleted accounts exceed maximum page size. + */ + private String nextLink; + + /** + * Creates an instance of DeletedAccountListResult class. + */ + public DeletedAccountListResult() { + } + + /** + * Get the value property: Gets the list of deleted accounts and their properties. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Request URL that can be used to query next page of deleted accounts. Returned when + * total number of requested deleted accounts exceed maximum page size. + * + * @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) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeletedAccountListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeletedAccountListResult 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 DeletedAccountListResult. + */ + public static DeletedAccountListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeletedAccountListResult deserializedDeletedAccountListResult = new DeletedAccountListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DeletedAccountInner.fromJson(reader1)); + deserializedDeletedAccountListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDeletedAccountListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDeletedAccountListResult; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedAccounts.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedAccounts.java new file mode 100644 index 0000000000000..c231b5b90500a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedAccounts.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 DeletedAccounts. + */ +public interface DeletedAccounts { + /** + * Lists deleted accounts under the subscription. + * + * @throws com.azure.core.management.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 from the List Deleted Accounts operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists deleted accounts under the subscription. + * + * @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 from the List Deleted Accounts operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Get properties of specified deleted account resource. + * + * @param deletedAccountName Name of the deleted storage account. + * @param location The location of the deleted storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of specified deleted account resource along with {@link Response}. + */ + Response getWithResponse(String deletedAccountName, String location, Context context); + + /** + * Get properties of specified deleted account resource. + * + * @param deletedAccountName Name of the deleted storage account. + * @param location The location of the deleted storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of specified deleted account resource. + */ + DeletedAccount get(String deletedAccountName, String location); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedShare.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedShare.java new file mode 100644 index 0000000000000..106228da39620 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedShare.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * The deleted share to be restored. + */ +@Fluent +public final class DeletedShare implements JsonSerializable { + /* + * Required. Identify the name of the deleted share that will be restored. + */ + private String deletedShareName; + + /* + * Required. Identify the version of the deleted share that will be restored. + */ + private String deletedShareVersion; + + /** + * Creates an instance of DeletedShare class. + */ + public DeletedShare() { + } + + /** + * Get the deletedShareName property: Required. Identify the name of the deleted share that will be restored. + * + * @return the deletedShareName value. + */ + public String deletedShareName() { + return this.deletedShareName; + } + + /** + * Set the deletedShareName property: Required. Identify the name of the deleted share that will be restored. + * + * @param deletedShareName the deletedShareName value to set. + * @return the DeletedShare object itself. + */ + public DeletedShare withDeletedShareName(String deletedShareName) { + this.deletedShareName = deletedShareName; + return this; + } + + /** + * Get the deletedShareVersion property: Required. Identify the version of the deleted share that will be restored. + * + * @return the deletedShareVersion value. + */ + public String deletedShareVersion() { + return this.deletedShareVersion; + } + + /** + * Set the deletedShareVersion property: Required. Identify the version of the deleted share that will be restored. + * + * @param deletedShareVersion the deletedShareVersion value to set. + * @return the DeletedShare object itself. + */ + public DeletedShare withDeletedShareVersion(String deletedShareVersion) { + this.deletedShareVersion = deletedShareVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (deletedShareName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property deletedShareName in model DeletedShare")); + } + if (deletedShareVersion() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property deletedShareVersion in model DeletedShare")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeletedShare.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deletedShareName", this.deletedShareName); + jsonWriter.writeStringField("deletedShareVersion", this.deletedShareVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeletedShare from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeletedShare 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 DeletedShare. + */ + public static DeletedShare fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeletedShare deserializedDeletedShare = new DeletedShare(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deletedShareName".equals(fieldName)) { + deserializedDeletedShare.deletedShareName = reader.getString(); + } else if ("deletedShareVersion".equals(fieldName)) { + deserializedDeletedShare.deletedShareVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDeletedShare; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Dimension.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Dimension.java new file mode 100644 index 0000000000000..77d0b22cc2049 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Dimension.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Dimension of blobs, possibly be blob type or access tier. + */ +@Fluent +public final class Dimension implements JsonSerializable { + /* + * Display name of dimension. + */ + private String name; + + /* + * Display name of dimension. + */ + private String displayName; + + /** + * Creates an instance of Dimension class. + */ + public Dimension() { + } + + /** + * Get the name property: Display name of dimension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Display name of dimension. + * + * @param name the name value to set. + * @return the Dimension object itself. + */ + public Dimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Display name of dimension. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of dimension. + * + * @param displayName the displayName value to set. + * @return the Dimension object itself. + */ + public Dimension withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("displayName", this.displayName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Dimension from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Dimension 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 Dimension. + */ + public static Dimension fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Dimension deserializedDimension = new Dimension(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDimension.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedDimension.displayName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDimension; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DirectoryServiceOptions.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DirectoryServiceOptions.java new file mode 100644 index 0000000000000..c6780d214f427 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DirectoryServiceOptions.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Indicates the directory service used. Note that this enum may be extended in the future. + */ +public final class DirectoryServiceOptions extends ExpandableStringEnum { + /** + * Static value None for DirectoryServiceOptions. + */ + public static final DirectoryServiceOptions NONE = fromString("None"); + + /** + * Static value AADDS for DirectoryServiceOptions. + */ + public static final DirectoryServiceOptions AADDS = fromString("AADDS"); + + /** + * Static value AD for DirectoryServiceOptions. + */ + public static final DirectoryServiceOptions AD = fromString("AD"); + + /** + * Static value AADKERB for DirectoryServiceOptions. + */ + public static final DirectoryServiceOptions AADKERB = fromString("AADKERB"); + + /** + * Creates a new instance of DirectoryServiceOptions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DirectoryServiceOptions() { + } + + /** + * Creates or finds a DirectoryServiceOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding DirectoryServiceOptions. + */ + public static DirectoryServiceOptions fromString(String name) { + return fromString(name, DirectoryServiceOptions.class); + } + + /** + * Gets known DirectoryServiceOptions values. + * + * @return known DirectoryServiceOptions values. + */ + public static Collection values() { + return values(DirectoryServiceOptions.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DnsEndpointType.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DnsEndpointType.java new file mode 100644 index 0000000000000..5f06e7625cced --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DnsEndpointType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single + * subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone + * identifier. + */ +public final class DnsEndpointType extends ExpandableStringEnum { + /** + * Static value Standard for DnsEndpointType. + */ + public static final DnsEndpointType STANDARD = fromString("Standard"); + + /** + * Static value AzureDnsZone for DnsEndpointType. + */ + public static final DnsEndpointType AZURE_DNS_ZONE = fromString("AzureDnsZone"); + + /** + * Creates a new instance of DnsEndpointType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DnsEndpointType() { + } + + /** + * Creates or finds a DnsEndpointType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DnsEndpointType. + */ + public static DnsEndpointType fromString(String name) { + return fromString(name, DnsEndpointType.class); + } + + /** + * Gets known DnsEndpointType values. + * + * @return known DnsEndpointType values. + */ + public static Collection values() { + return values(DnsEndpointType.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EnabledProtocols.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EnabledProtocols.java new file mode 100644 index 0000000000000..1d2804884552c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EnabledProtocols.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The authentication protocol that is used for the file share. Can only be specified when creating a share. + */ +public final class EnabledProtocols extends ExpandableStringEnum { + /** + * Static value SMB for EnabledProtocols. + */ + public static final EnabledProtocols SMB = fromString("SMB"); + + /** + * Static value NFS for EnabledProtocols. + */ + public static final EnabledProtocols NFS = fromString("NFS"); + + /** + * Creates a new instance of EnabledProtocols value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EnabledProtocols() { + } + + /** + * Creates or finds a EnabledProtocols from its string representation. + * + * @param name a name to look for. + * @return the corresponding EnabledProtocols. + */ + public static EnabledProtocols fromString(String name) { + return fromString(name, EnabledProtocols.class); + } + + /** + * Gets known EnabledProtocols values. + * + * @return known EnabledProtocols values. + */ + public static Collection values() { + return values(EnabledProtocols.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Encryption.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Encryption.java new file mode 100644 index 0000000000000..cf5253badde80 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Encryption.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 encryption settings on the storage account. + */ +@Fluent +public final class Encryption implements JsonSerializable { + /* + * List of services which support encryption. + */ + private EncryptionServices services; + + /* + * The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault + */ + private KeySource keySource; + + /* + * A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed + * keys for data at rest. + */ + private Boolean requireInfrastructureEncryption; + + /* + * Properties provided by key vault. + */ + private KeyVaultProperties keyVaultProperties; + + /* + * The identity to be used with service-side encryption at rest. + */ + private EncryptionIdentity encryptionIdentity; + + /** + * Creates an instance of Encryption class. + */ + public Encryption() { + } + + /** + * Get the services property: List of services which support encryption. + * + * @return the services value. + */ + public EncryptionServices services() { + return this.services; + } + + /** + * Set the services property: List of services which support encryption. + * + * @param services the services value to set. + * @return the Encryption object itself. + */ + public Encryption withServices(EncryptionServices services) { + this.services = services; + return this; + } + + /** + * Get the keySource property: The encryption keySource (provider). Possible values (case-insensitive): + * Microsoft.Storage, Microsoft.Keyvault. + * + * @return the keySource value. + */ + public KeySource keySource() { + return this.keySource; + } + + /** + * Set the keySource property: The encryption keySource (provider). Possible values (case-insensitive): + * Microsoft.Storage, Microsoft.Keyvault. + * + * @param keySource the keySource value to set. + * @return the Encryption object itself. + */ + public Encryption withKeySource(KeySource keySource) { + this.keySource = keySource; + return this; + } + + /** + * Get the requireInfrastructureEncryption property: A boolean indicating whether or not the service applies a + * secondary layer of encryption with platform managed keys for data at rest. + * + * @return the requireInfrastructureEncryption value. + */ + public Boolean requireInfrastructureEncryption() { + return this.requireInfrastructureEncryption; + } + + /** + * Set the requireInfrastructureEncryption property: A boolean indicating whether or not the service applies a + * secondary layer of encryption with platform managed keys for data at rest. + * + * @param requireInfrastructureEncryption the requireInfrastructureEncryption value to set. + * @return the Encryption object itself. + */ + public Encryption withRequireInfrastructureEncryption(Boolean requireInfrastructureEncryption) { + this.requireInfrastructureEncryption = requireInfrastructureEncryption; + return this; + } + + /** + * Get the keyVaultProperties property: Properties provided by key vault. + * + * @return the keyVaultProperties value. + */ + public KeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set the keyVaultProperties property: Properties provided by key vault. + * + * @param keyVaultProperties the keyVaultProperties value to set. + * @return the Encryption object itself. + */ + public Encryption withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + + /** + * Get the encryptionIdentity property: The identity to be used with service-side encryption at rest. + * + * @return the encryptionIdentity value. + */ + public EncryptionIdentity encryptionIdentity() { + return this.encryptionIdentity; + } + + /** + * Set the encryptionIdentity property: The identity to be used with service-side encryption at rest. + * + * @param encryptionIdentity the encryptionIdentity value to set. + * @return the Encryption object itself. + */ + public Encryption withEncryptionIdentity(EncryptionIdentity encryptionIdentity) { + this.encryptionIdentity = encryptionIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (services() != null) { + services().validate(); + } + if (keyVaultProperties() != null) { + keyVaultProperties().validate(); + } + if (encryptionIdentity() != null) { + encryptionIdentity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("services", this.services); + jsonWriter.writeStringField("keySource", this.keySource == null ? null : this.keySource.toString()); + jsonWriter.writeBooleanField("requireInfrastructureEncryption", this.requireInfrastructureEncryption); + jsonWriter.writeJsonField("keyvaultproperties", this.keyVaultProperties); + jsonWriter.writeJsonField("identity", this.encryptionIdentity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Encryption from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Encryption 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 Encryption. + */ + public static Encryption fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Encryption deserializedEncryption = new Encryption(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("services".equals(fieldName)) { + deserializedEncryption.services = EncryptionServices.fromJson(reader); + } else if ("keySource".equals(fieldName)) { + deserializedEncryption.keySource = KeySource.fromString(reader.getString()); + } else if ("requireInfrastructureEncryption".equals(fieldName)) { + deserializedEncryption.requireInfrastructureEncryption = reader.getNullable(JsonReader::getBoolean); + } else if ("keyvaultproperties".equals(fieldName)) { + deserializedEncryption.keyVaultProperties = KeyVaultProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedEncryption.encryptionIdentity = EncryptionIdentity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryption; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionIdentity.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionIdentity.java new file mode 100644 index 0000000000000..45a307b8cbe1d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionIdentity.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Encryption identity for the storage account. + */ +@Fluent +public final class EncryptionIdentity implements JsonSerializable { + /* + * Resource identifier of the UserAssigned identity to be associated with server-side encryption on the storage + * account. + */ + private String encryptionUserAssignedIdentity; + + /* + * ClientId of the multi-tenant application to be used in conjunction with the user-assigned identity for + * cross-tenant customer-managed-keys server-side encryption on the storage account. + */ + private String encryptionFederatedIdentityClientId; + + /** + * Creates an instance of EncryptionIdentity class. + */ + public EncryptionIdentity() { + } + + /** + * Get the encryptionUserAssignedIdentity property: Resource identifier of the UserAssigned identity to be + * associated with server-side encryption on the storage account. + * + * @return the encryptionUserAssignedIdentity value. + */ + public String encryptionUserAssignedIdentity() { + return this.encryptionUserAssignedIdentity; + } + + /** + * Set the encryptionUserAssignedIdentity property: Resource identifier of the UserAssigned identity to be + * associated with server-side encryption on the storage account. + * + * @param encryptionUserAssignedIdentity the encryptionUserAssignedIdentity value to set. + * @return the EncryptionIdentity object itself. + */ + public EncryptionIdentity withEncryptionUserAssignedIdentity(String encryptionUserAssignedIdentity) { + this.encryptionUserAssignedIdentity = encryptionUserAssignedIdentity; + return this; + } + + /** + * Get the encryptionFederatedIdentityClientId property: ClientId of the multi-tenant application to be used in + * conjunction with the user-assigned identity for cross-tenant customer-managed-keys server-side encryption on the + * storage account. + * + * @return the encryptionFederatedIdentityClientId value. + */ + public String encryptionFederatedIdentityClientId() { + return this.encryptionFederatedIdentityClientId; + } + + /** + * Set the encryptionFederatedIdentityClientId property: ClientId of the multi-tenant application to be used in + * conjunction with the user-assigned identity for cross-tenant customer-managed-keys server-side encryption on the + * storage account. + * + * @param encryptionFederatedIdentityClientId the encryptionFederatedIdentityClientId value to set. + * @return the EncryptionIdentity object itself. + */ + public EncryptionIdentity withEncryptionFederatedIdentityClientId(String encryptionFederatedIdentityClientId) { + this.encryptionFederatedIdentityClientId = encryptionFederatedIdentityClientId; + 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("userAssignedIdentity", this.encryptionUserAssignedIdentity); + jsonWriter.writeStringField("federatedIdentityClientId", this.encryptionFederatedIdentityClientId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionIdentity 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 EncryptionIdentity. + */ + public static EncryptionIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionIdentity deserializedEncryptionIdentity = new EncryptionIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("userAssignedIdentity".equals(fieldName)) { + deserializedEncryptionIdentity.encryptionUserAssignedIdentity = reader.getString(); + } else if ("federatedIdentityClientId".equals(fieldName)) { + deserializedEncryptionIdentity.encryptionFederatedIdentityClientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionIdentity; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScope.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScope.java new file mode 100644 index 0000000000000..4166e7d30ff33 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScope.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.EncryptionScopeInner; +import java.time.OffsetDateTime; + +/** + * An immutable client-side representation of EncryptionScope. + */ +public interface EncryptionScope { + /** + * 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 source property: The provider for the encryption scope. Possible values (case-insensitive): + * Microsoft.Storage, Microsoft.KeyVault. + * + * @return the source value. + */ + EncryptionScopeSource source(); + + /** + * Gets the state property: The state of the encryption scope. Possible values (case-insensitive): Enabled, + * Disabled. + * + * @return the state value. + */ + EncryptionScopeState state(); + + /** + * Gets the creationTime property: Gets the creation date and time of the encryption scope in UTC. + * + * @return the creationTime value. + */ + OffsetDateTime creationTime(); + + /** + * Gets the lastModifiedTime property: Gets the last modification date and time of the encryption scope in UTC. + * + * @return the lastModifiedTime value. + */ + OffsetDateTime lastModifiedTime(); + + /** + * Gets the keyVaultProperties property: The key vault properties for the encryption scope. This is a required field + * if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + * + * @return the keyVaultProperties value. + */ + EncryptionScopeKeyVaultProperties keyVaultProperties(); + + /** + * Gets the requireInfrastructureEncryption property: A boolean indicating whether or not the service applies a + * secondary layer of encryption with platform managed keys for data at rest. + * + * @return the requireInfrastructureEncryption value. + */ + Boolean requireInfrastructureEncryption(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.EncryptionScopeInner object. + * + * @return the inner object. + */ + EncryptionScopeInner innerModel(); + + /** + * The entirety of the EncryptionScope definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The EncryptionScope definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the EncryptionScope definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the EncryptionScope definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the EncryptionScope 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.WithSource, DefinitionStages.WithState, + DefinitionStages.WithKeyVaultProperties, DefinitionStages.WithRequireInfrastructureEncryption { + /** + * Executes the create request. + * + * @return the created resource. + */ + EncryptionScope create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + EncryptionScope create(Context context); + } + + /** + * The stage of the EncryptionScope definition allowing to specify source. + */ + interface WithSource { + /** + * Specifies the source property: The provider for the encryption scope. Possible values (case-insensitive): + * Microsoft.Storage, Microsoft.KeyVault.. + * + * @param source The provider for the encryption scope. Possible values (case-insensitive): + * Microsoft.Storage, Microsoft.KeyVault. + * @return the next definition stage. + */ + WithCreate withSource(EncryptionScopeSource source); + } + + /** + * The stage of the EncryptionScope definition allowing to specify state. + */ + interface WithState { + /** + * Specifies the state property: The state of the encryption scope. Possible values (case-insensitive): + * Enabled, Disabled.. + * + * @param state The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + * @return the next definition stage. + */ + WithCreate withState(EncryptionScopeState state); + } + + /** + * The stage of the EncryptionScope definition allowing to specify keyVaultProperties. + */ + interface WithKeyVaultProperties { + /** + * Specifies the keyVaultProperties property: The key vault properties for the encryption scope. This is a + * required field if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'.. + * + * @param keyVaultProperties The key vault properties for the encryption scope. This is a required field if + * encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + * @return the next definition stage. + */ + WithCreate withKeyVaultProperties(EncryptionScopeKeyVaultProperties keyVaultProperties); + } + + /** + * The stage of the EncryptionScope definition allowing to specify requireInfrastructureEncryption. + */ + interface WithRequireInfrastructureEncryption { + /** + * Specifies the requireInfrastructureEncryption property: A boolean indicating whether or not the service + * applies a secondary layer of encryption with platform managed keys for data at rest.. + * + * @param requireInfrastructureEncryption A boolean indicating whether or not the service applies a + * secondary layer of encryption with platform managed keys for data at rest. + * @return the next definition stage. + */ + WithCreate withRequireInfrastructureEncryption(Boolean requireInfrastructureEncryption); + } + } + + /** + * Begins update for the EncryptionScope resource. + * + * @return the stage of resource update. + */ + EncryptionScope.Update update(); + + /** + * The template for EncryptionScope update. + */ + interface Update extends UpdateStages.WithSource, UpdateStages.WithState, UpdateStages.WithKeyVaultProperties, + UpdateStages.WithRequireInfrastructureEncryption { + /** + * Executes the update request. + * + * @return the updated resource. + */ + EncryptionScope apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + EncryptionScope apply(Context context); + } + + /** + * The EncryptionScope update stages. + */ + interface UpdateStages { + /** + * The stage of the EncryptionScope update allowing to specify source. + */ + interface WithSource { + /** + * Specifies the source property: The provider for the encryption scope. Possible values (case-insensitive): + * Microsoft.Storage, Microsoft.KeyVault.. + * + * @param source The provider for the encryption scope. Possible values (case-insensitive): + * Microsoft.Storage, Microsoft.KeyVault. + * @return the next definition stage. + */ + Update withSource(EncryptionScopeSource source); + } + + /** + * The stage of the EncryptionScope update allowing to specify state. + */ + interface WithState { + /** + * Specifies the state property: The state of the encryption scope. Possible values (case-insensitive): + * Enabled, Disabled.. + * + * @param state The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + * @return the next definition stage. + */ + Update withState(EncryptionScopeState state); + } + + /** + * The stage of the EncryptionScope update allowing to specify keyVaultProperties. + */ + interface WithKeyVaultProperties { + /** + * Specifies the keyVaultProperties property: The key vault properties for the encryption scope. This is a + * required field if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'.. + * + * @param keyVaultProperties The key vault properties for the encryption scope. This is a required field if + * encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + * @return the next definition stage. + */ + Update withKeyVaultProperties(EncryptionScopeKeyVaultProperties keyVaultProperties); + } + + /** + * The stage of the EncryptionScope update allowing to specify requireInfrastructureEncryption. + */ + interface WithRequireInfrastructureEncryption { + /** + * Specifies the requireInfrastructureEncryption property: A boolean indicating whether or not the service + * applies a secondary layer of encryption with platform managed keys for data at rest.. + * + * @param requireInfrastructureEncryption A boolean indicating whether or not the service applies a + * secondary layer of encryption with platform managed keys for data at rest. + * @return the next definition stage. + */ + Update withRequireInfrastructureEncryption(Boolean requireInfrastructureEncryption); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + EncryptionScope refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + EncryptionScope refresh(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeKeyVaultProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeKeyVaultProperties.java new file mode 100644 index 0000000000000..b41df0bac230e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeKeyVaultProperties.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +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.time.OffsetDateTime; + +/** + * The key vault properties for the encryption scope. This is a required field if encryption scope 'source' attribute is + * set to 'Microsoft.KeyVault'. + */ +@Fluent +public final class EncryptionScopeKeyVaultProperties implements JsonSerializable { + /* + * The object identifier for a key vault key object. When applied, the encryption scope will use the key referenced + * by the identifier to enable customer-managed key support on this encryption scope. + */ + private String keyUri; + + /* + * The object identifier of the current versioned Key Vault Key in use. + */ + private String currentVersionedKeyIdentifier; + + /* + * Timestamp of last rotation of the Key Vault Key. + */ + private OffsetDateTime lastKeyRotationTimestamp; + + /** + * Creates an instance of EncryptionScopeKeyVaultProperties class. + */ + public EncryptionScopeKeyVaultProperties() { + } + + /** + * Get the keyUri property: The object identifier for a key vault key object. When applied, the encryption scope + * will use the key referenced by the identifier to enable customer-managed key support on this encryption scope. + * + * @return the keyUri value. + */ + public String keyUri() { + return this.keyUri; + } + + /** + * Set the keyUri property: The object identifier for a key vault key object. When applied, the encryption scope + * will use the key referenced by the identifier to enable customer-managed key support on this encryption scope. + * + * @param keyUri the keyUri value to set. + * @return the EncryptionScopeKeyVaultProperties object itself. + */ + public EncryptionScopeKeyVaultProperties withKeyUri(String keyUri) { + this.keyUri = keyUri; + return this; + } + + /** + * Get the currentVersionedKeyIdentifier property: The object identifier of the current versioned Key Vault Key in + * use. + * + * @return the currentVersionedKeyIdentifier value. + */ + public String currentVersionedKeyIdentifier() { + return this.currentVersionedKeyIdentifier; + } + + /** + * Get the lastKeyRotationTimestamp property: Timestamp of last rotation of the Key Vault Key. + * + * @return the lastKeyRotationTimestamp value. + */ + public OffsetDateTime lastKeyRotationTimestamp() { + return this.lastKeyRotationTimestamp; + } + + /** + * 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("keyUri", this.keyUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionScopeKeyVaultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionScopeKeyVaultProperties 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 EncryptionScopeKeyVaultProperties. + */ + public static EncryptionScopeKeyVaultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionScopeKeyVaultProperties deserializedEncryptionScopeKeyVaultProperties + = new EncryptionScopeKeyVaultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyUri".equals(fieldName)) { + deserializedEncryptionScopeKeyVaultProperties.keyUri = reader.getString(); + } else if ("currentVersionedKeyIdentifier".equals(fieldName)) { + deserializedEncryptionScopeKeyVaultProperties.currentVersionedKeyIdentifier = reader.getString(); + } else if ("lastKeyRotationTimestamp".equals(fieldName)) { + deserializedEncryptionScopeKeyVaultProperties.lastKeyRotationTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionScopeKeyVaultProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeListResult.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeListResult.java new file mode 100644 index 0000000000000..d10905ba95c09 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeListResult.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.models.EncryptionScopeInner; +import java.io.IOException; +import java.util.List; + +/** + * List of encryption scopes requested, and if paging is required, a URL to the next page of encryption scopes. + */ +@Immutable +public final class EncryptionScopeListResult implements JsonSerializable { + /* + * List of encryption scopes requested. + */ + private List value; + + /* + * Request URL that can be used to query next page of encryption scopes. Returned when total number of requested + * encryption scopes exceeds the maximum page size. + */ + private String nextLink; + + /** + * Creates an instance of EncryptionScopeListResult class. + */ + public EncryptionScopeListResult() { + } + + /** + * Get the value property: List of encryption scopes requested. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Request URL that can be used to query next page of encryption scopes. Returned when + * total number of requested encryption scopes exceeds the maximum page size. + * + * @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) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionScopeListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionScopeListResult 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 EncryptionScopeListResult. + */ + public static EncryptionScopeListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionScopeListResult deserializedEncryptionScopeListResult = new EncryptionScopeListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> EncryptionScopeInner.fromJson(reader1)); + deserializedEncryptionScopeListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEncryptionScopeListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionScopeListResult; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeSource.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeSource.java new file mode 100644 index 0000000000000..194a871c88a54 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeSource.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. + */ +public final class EncryptionScopeSource extends ExpandableStringEnum { + /** + * Static value Microsoft.Storage for EncryptionScopeSource. + */ + public static final EncryptionScopeSource MICROSOFT_STORAGE = fromString("Microsoft.Storage"); + + /** + * Static value Microsoft.KeyVault for EncryptionScopeSource. + */ + public static final EncryptionScopeSource MICROSOFT_KEY_VAULT = fromString("Microsoft.KeyVault"); + + /** + * Creates a new instance of EncryptionScopeSource value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EncryptionScopeSource() { + } + + /** + * Creates or finds a EncryptionScopeSource from its string representation. + * + * @param name a name to look for. + * @return the corresponding EncryptionScopeSource. + */ + public static EncryptionScopeSource fromString(String name) { + return fromString(name, EncryptionScopeSource.class); + } + + /** + * Gets known EncryptionScopeSource values. + * + * @return known EncryptionScopeSource values. + */ + public static Collection values() { + return values(EncryptionScopeSource.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeState.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeState.java new file mode 100644 index 0000000000000..19bfed6c7c26b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + */ +public final class EncryptionScopeState extends ExpandableStringEnum { + /** + * Static value Enabled for EncryptionScopeState. + */ + public static final EncryptionScopeState ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for EncryptionScopeState. + */ + public static final EncryptionScopeState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of EncryptionScopeState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EncryptionScopeState() { + } + + /** + * Creates or finds a EncryptionScopeState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EncryptionScopeState. + */ + public static EncryptionScopeState fromString(String name) { + return fromString(name, EncryptionScopeState.class); + } + + /** + * Gets known EncryptionScopeState values. + * + * @return known EncryptionScopeState values. + */ + public static Collection values() { + return values(EncryptionScopeState.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopes.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopes.java new file mode 100644 index 0000000000000..bfec3d912284c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopes.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 EncryptionScopes. + */ +public interface EncryptionScopes { + /** + * Returns the properties for the specified encryption scope. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption + * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + * Every dash (-) character must be immediately preceded and followed by a letter or number. + * @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 Encryption Scope resource along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String accountName, String encryptionScopeName, + Context context); + + /** + * Returns the properties for the specified encryption scope. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption + * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + * Every dash (-) character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 Encryption Scope resource. + */ + EncryptionScope get(String resourceGroupName, String accountName, String encryptionScopeName); + + /** + * Lists all the encryption scopes available under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Lists all the encryption scopes available under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of encryption scopes that will be included in the list + * response. + * @param filter Optional. When specified, only encryption scope names starting with the filter will be listed. + * @param include Optional, when specified, will list encryption scopes with the specific state. Defaults to All. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, Integer maxpagesize, + String filter, ListEncryptionScopesInclude include, Context context); + + /** + * Returns the properties for the specified encryption scope. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource along with {@link Response}. + */ + EncryptionScope getById(String id); + + /** + * Returns the properties for the specified encryption scope. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Encryption Scope resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new EncryptionScope resource. + * + * @param name resource name. + * @return the first stage of the new EncryptionScope definition. + */ + EncryptionScope.DefinitionStages.Blank define(String name); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionService.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionService.java new file mode 100644 index 0000000000000..73abc37c191d3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionService.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +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.time.OffsetDateTime; + +/** + * A service that allows server-side encryption to be used. + */ +@Fluent +public final class EncryptionService implements JsonSerializable { + /* + * A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled + * by default today and cannot be disabled. + */ + private Boolean enabled; + + /* + * Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at + * rest by default today and cannot be disabled. + */ + private OffsetDateTime lastEnabledTime; + + /* + * Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped + * encryption key will be used. 'Service' key type implies that a default service key is used. + */ + private KeyType keyType; + + /** + * Creates an instance of EncryptionService class. + */ + public EncryptionService() { + } + + /** + * Get the enabled property: A boolean indicating whether or not the service encrypts the data as it is stored. + * Encryption at rest is enabled by default today and cannot be disabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: A boolean indicating whether or not the service encrypts the data as it is stored. + * Encryption at rest is enabled by default today and cannot be disabled. + * + * @param enabled the enabled value to set. + * @return the EncryptionService object itself. + */ + public EncryptionService withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the lastEnabledTime property: Gets a rough estimate of the date/time when the encryption was last enabled by + * the user. Data is encrypted at rest by default today and cannot be disabled. + * + * @return the lastEnabledTime value. + */ + public OffsetDateTime lastEnabledTime() { + return this.lastEnabledTime; + } + + /** + * Get the keyType property: Encryption key type to be used for the encryption service. 'Account' key type implies + * that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is + * used. + * + * @return the keyType value. + */ + public KeyType keyType() { + return this.keyType; + } + + /** + * Set the keyType property: Encryption key type to be used for the encryption service. 'Account' key type implies + * that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is + * used. + * + * @param keyType the keyType value to set. + * @return the EncryptionService object itself. + */ + public EncryptionService withKeyType(KeyType keyType) { + this.keyType = keyType; + 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.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("keyType", this.keyType == null ? null : this.keyType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionService from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionService 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 EncryptionService. + */ + public static EncryptionService fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionService deserializedEncryptionService = new EncryptionService(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedEncryptionService.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("lastEnabledTime".equals(fieldName)) { + deserializedEncryptionService.lastEnabledTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("keyType".equals(fieldName)) { + deserializedEncryptionService.keyType = KeyType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionService; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionServices.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionServices.java new file mode 100644 index 0000000000000..b310c922e99bd --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionServices.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * A list of services that support encryption. + */ +@Fluent +public final class EncryptionServices implements JsonSerializable { + /* + * The encryption function of the blob storage service. + */ + private EncryptionService blob; + + /* + * The encryption function of the file storage service. + */ + private EncryptionService file; + + /* + * The encryption function of the table storage service. + */ + private EncryptionService table; + + /* + * The encryption function of the queue storage service. + */ + private EncryptionService queue; + + /** + * Creates an instance of EncryptionServices class. + */ + public EncryptionServices() { + } + + /** + * Get the blob property: The encryption function of the blob storage service. + * + * @return the blob value. + */ + public EncryptionService blob() { + return this.blob; + } + + /** + * Set the blob property: The encryption function of the blob storage service. + * + * @param blob the blob value to set. + * @return the EncryptionServices object itself. + */ + public EncryptionServices withBlob(EncryptionService blob) { + this.blob = blob; + return this; + } + + /** + * Get the file property: The encryption function of the file storage service. + * + * @return the file value. + */ + public EncryptionService file() { + return this.file; + } + + /** + * Set the file property: The encryption function of the file storage service. + * + * @param file the file value to set. + * @return the EncryptionServices object itself. + */ + public EncryptionServices withFile(EncryptionService file) { + this.file = file; + return this; + } + + /** + * Get the table property: The encryption function of the table storage service. + * + * @return the table value. + */ + public EncryptionService table() { + return this.table; + } + + /** + * Set the table property: The encryption function of the table storage service. + * + * @param table the table value to set. + * @return the EncryptionServices object itself. + */ + public EncryptionServices withTable(EncryptionService table) { + this.table = table; + return this; + } + + /** + * Get the queue property: The encryption function of the queue storage service. + * + * @return the queue value. + */ + public EncryptionService queue() { + return this.queue; + } + + /** + * Set the queue property: The encryption function of the queue storage service. + * + * @param queue the queue value to set. + * @return the EncryptionServices object itself. + */ + public EncryptionServices withQueue(EncryptionService queue) { + this.queue = queue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (blob() != null) { + blob().validate(); + } + if (file() != null) { + file().validate(); + } + if (table() != null) { + table().validate(); + } + if (queue() != null) { + queue().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("blob", this.blob); + jsonWriter.writeJsonField("file", this.file); + jsonWriter.writeJsonField("table", this.table); + jsonWriter.writeJsonField("queue", this.queue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionServices from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionServices 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 EncryptionServices. + */ + public static EncryptionServices fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionServices deserializedEncryptionServices = new EncryptionServices(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("blob".equals(fieldName)) { + deserializedEncryptionServices.blob = EncryptionService.fromJson(reader); + } else if ("file".equals(fieldName)) { + deserializedEncryptionServices.file = EncryptionService.fromJson(reader); + } else if ("table".equals(fieldName)) { + deserializedEncryptionServices.table = EncryptionService.fromJson(reader); + } else if ("queue".equals(fieldName)) { + deserializedEncryptionServices.queue = EncryptionService.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionServices; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Endpoints.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Endpoints.java new file mode 100644 index 0000000000000..a070c0141fa37 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Endpoints.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object. + */ +@Fluent +public final class Endpoints implements JsonSerializable { + /* + * Gets the blob endpoint. + */ + private String blob; + + /* + * Gets the queue endpoint. + */ + private String queue; + + /* + * Gets the table endpoint. + */ + private String table; + + /* + * Gets the file endpoint. + */ + private String file; + + /* + * Gets the web endpoint. + */ + private String web; + + /* + * Gets the dfs endpoint. + */ + private String dfs; + + /* + * Gets the microsoft routing storage endpoints. + */ + private StorageAccountMicrosoftEndpoints microsoftEndpoints; + + /* + * Gets the internet routing storage endpoints + */ + private StorageAccountInternetEndpoints internetEndpoints; + + /** + * Creates an instance of Endpoints class. + */ + public Endpoints() { + } + + /** + * Get the blob property: Gets the blob endpoint. + * + * @return the blob value. + */ + public String blob() { + return this.blob; + } + + /** + * Get the queue property: Gets the queue endpoint. + * + * @return the queue value. + */ + public String queue() { + return this.queue; + } + + /** + * Get the table property: Gets the table endpoint. + * + * @return the table value. + */ + public String table() { + return this.table; + } + + /** + * Get the file property: Gets the file endpoint. + * + * @return the file value. + */ + public String file() { + return this.file; + } + + /** + * Get the web property: Gets the web endpoint. + * + * @return the web value. + */ + public String web() { + return this.web; + } + + /** + * Get the dfs property: Gets the dfs endpoint. + * + * @return the dfs value. + */ + public String dfs() { + return this.dfs; + } + + /** + * Get the microsoftEndpoints property: Gets the microsoft routing storage endpoints. + * + * @return the microsoftEndpoints value. + */ + public StorageAccountMicrosoftEndpoints microsoftEndpoints() { + return this.microsoftEndpoints; + } + + /** + * Set the microsoftEndpoints property: Gets the microsoft routing storage endpoints. + * + * @param microsoftEndpoints the microsoftEndpoints value to set. + * @return the Endpoints object itself. + */ + public Endpoints withMicrosoftEndpoints(StorageAccountMicrosoftEndpoints microsoftEndpoints) { + this.microsoftEndpoints = microsoftEndpoints; + return this; + } + + /** + * Get the internetEndpoints property: Gets the internet routing storage endpoints. + * + * @return the internetEndpoints value. + */ + public StorageAccountInternetEndpoints internetEndpoints() { + return this.internetEndpoints; + } + + /** + * Set the internetEndpoints property: Gets the internet routing storage endpoints. + * + * @param internetEndpoints the internetEndpoints value to set. + * @return the Endpoints object itself. + */ + public Endpoints withInternetEndpoints(StorageAccountInternetEndpoints internetEndpoints) { + this.internetEndpoints = internetEndpoints; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (microsoftEndpoints() != null) { + microsoftEndpoints().validate(); + } + if (internetEndpoints() != null) { + internetEndpoints().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("microsoftEndpoints", this.microsoftEndpoints); + jsonWriter.writeJsonField("internetEndpoints", this.internetEndpoints); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Endpoints from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Endpoints 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 Endpoints. + */ + public static Endpoints fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Endpoints deserializedEndpoints = new Endpoints(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("blob".equals(fieldName)) { + deserializedEndpoints.blob = reader.getString(); + } else if ("queue".equals(fieldName)) { + deserializedEndpoints.queue = reader.getString(); + } else if ("table".equals(fieldName)) { + deserializedEndpoints.table = reader.getString(); + } else if ("file".equals(fieldName)) { + deserializedEndpoints.file = reader.getString(); + } else if ("web".equals(fieldName)) { + deserializedEndpoints.web = reader.getString(); + } else if ("dfs".equals(fieldName)) { + deserializedEndpoints.dfs = reader.getString(); + } else if ("microsoftEndpoints".equals(fieldName)) { + deserializedEndpoints.microsoftEndpoints = StorageAccountMicrosoftEndpoints.fromJson(reader); + } else if ("internetEndpoints".equals(fieldName)) { + deserializedEndpoints.internetEndpoints = StorageAccountInternetEndpoints.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEndpoints; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExecutionTarget.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExecutionTarget.java new file mode 100644 index 0000000000000..274a9a8586d7a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExecutionTarget.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.List; + +/** + * Target helps provide filter parameters for the objects in the storage account and forms the execution context for the + * storage task. + */ +@Fluent +public final class ExecutionTarget implements JsonSerializable { + /* + * Required list of object prefixes to be included for task execution + */ + private List prefix; + + /* + * List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude + * prefixes, the exclude prefix will be the determining factor + */ + private List excludePrefix; + + /** + * Creates an instance of ExecutionTarget class. + */ + public ExecutionTarget() { + } + + /** + * Get the prefix property: Required list of object prefixes to be included for task execution. + * + * @return the prefix value. + */ + public List prefix() { + return this.prefix; + } + + /** + * Set the prefix property: Required list of object prefixes to be included for task execution. + * + * @param prefix the prefix value to set. + * @return the ExecutionTarget object itself. + */ + public ExecutionTarget withPrefix(List prefix) { + this.prefix = prefix; + return this; + } + + /** + * Get the excludePrefix property: List of object prefixes to be excluded from task execution. If there is a + * conflict between include and exclude prefixes, the exclude prefix will be the determining factor. + * + * @return the excludePrefix value. + */ + public List excludePrefix() { + return this.excludePrefix; + } + + /** + * Set the excludePrefix property: List of object prefixes to be excluded from task execution. If there is a + * conflict between include and exclude prefixes, the exclude prefix will be the determining factor. + * + * @param excludePrefix the excludePrefix value to set. + * @return the ExecutionTarget object itself. + */ + public ExecutionTarget withExcludePrefix(List excludePrefix) { + this.excludePrefix = excludePrefix; + 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.writeArrayField("prefix", this.prefix, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("excludePrefix", this.excludePrefix, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExecutionTarget from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExecutionTarget 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 ExecutionTarget. + */ + public static ExecutionTarget fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExecutionTarget deserializedExecutionTarget = new ExecutionTarget(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("prefix".equals(fieldName)) { + List prefix = reader.readArray(reader1 -> reader1.getString()); + deserializedExecutionTarget.prefix = prefix; + } else if ("excludePrefix".equals(fieldName)) { + List excludePrefix = reader.readArray(reader1 -> reader1.getString()); + deserializedExecutionTarget.excludePrefix = excludePrefix; + } else { + reader.skipChildren(); + } + } + + return deserializedExecutionTarget; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExecutionTrigger.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExecutionTrigger.java new file mode 100644 index 0000000000000..058b448f1b842 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExecutionTrigger.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Execution trigger for storage task assignment. + */ +@Fluent +public final class ExecutionTrigger implements JsonSerializable { + /* + * The trigger type of the storage task assignment execution + */ + private TriggerType type; + + /* + * The trigger parameters of the storage task assignment execution + */ + private TriggerParameters parameters; + + /** + * Creates an instance of ExecutionTrigger class. + */ + public ExecutionTrigger() { + } + + /** + * Get the type property: The trigger type of the storage task assignment execution. + * + * @return the type value. + */ + public TriggerType type() { + return this.type; + } + + /** + * Set the type property: The trigger type of the storage task assignment execution. + * + * @param type the type value to set. + * @return the ExecutionTrigger object itself. + */ + public ExecutionTrigger withType(TriggerType type) { + this.type = type; + return this; + } + + /** + * Get the parameters property: The trigger parameters of the storage task assignment execution. + * + * @return the parameters value. + */ + public TriggerParameters parameters() { + return this.parameters; + } + + /** + * Set the parameters property: The trigger parameters of the storage task assignment execution. + * + * @param parameters the parameters value to set. + * @return the ExecutionTrigger object itself. + */ + public ExecutionTrigger withParameters(TriggerParameters parameters) { + this.parameters = parameters; + 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 ExecutionTrigger")); + } + if (parameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property parameters in model ExecutionTrigger")); + } else { + parameters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExecutionTrigger.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeJsonField("parameters", this.parameters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExecutionTrigger from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExecutionTrigger 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 ExecutionTrigger. + */ + public static ExecutionTrigger fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExecutionTrigger deserializedExecutionTrigger = new ExecutionTrigger(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedExecutionTrigger.type = TriggerType.fromString(reader.getString()); + } else if ("parameters".equals(fieldName)) { + deserializedExecutionTrigger.parameters = TriggerParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExecutionTrigger; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExecutionTriggerUpdate.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExecutionTriggerUpdate.java new file mode 100644 index 0000000000000..b71fdc0b76aea --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExecutionTriggerUpdate.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Execution trigger update for storage task assignment. + */ +@Fluent +public final class ExecutionTriggerUpdate implements JsonSerializable { + /* + * The trigger type of the storage task assignment execution + */ + private TriggerType type; + + /* + * The trigger parameters of the storage task assignment execution + */ + private TriggerParametersUpdate parameters; + + /** + * Creates an instance of ExecutionTriggerUpdate class. + */ + public ExecutionTriggerUpdate() { + } + + /** + * Get the type property: The trigger type of the storage task assignment execution. + * + * @return the type value. + */ + public TriggerType type() { + return this.type; + } + + /** + * Set the type property: The trigger type of the storage task assignment execution. + * + * @param type the type value to set. + * @return the ExecutionTriggerUpdate object itself. + */ + public ExecutionTriggerUpdate withType(TriggerType type) { + this.type = type; + return this; + } + + /** + * Get the parameters property: The trigger parameters of the storage task assignment execution. + * + * @return the parameters value. + */ + public TriggerParametersUpdate parameters() { + return this.parameters; + } + + /** + * Set the parameters property: The trigger parameters of the storage task assignment execution. + * + * @param parameters the parameters value to set. + * @return the ExecutionTriggerUpdate object itself. + */ + public ExecutionTriggerUpdate withParameters(TriggerParametersUpdate parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (parameters() != null) { + parameters().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeJsonField("parameters", this.parameters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExecutionTriggerUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExecutionTriggerUpdate 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 ExecutionTriggerUpdate. + */ + public static ExecutionTriggerUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExecutionTriggerUpdate deserializedExecutionTriggerUpdate = new ExecutionTriggerUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedExecutionTriggerUpdate.type = TriggerType.fromString(reader.getString()); + } else if ("parameters".equals(fieldName)) { + deserializedExecutionTriggerUpdate.parameters = TriggerParametersUpdate.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExecutionTriggerUpdate; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExpirationAction.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExpirationAction.java new file mode 100644 index 0000000000000..ffbe0165a35f9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExpirationAction.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The + * 'Log' action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS + * tokens that do not adhere to the sas policy expiration period. + */ +public final class ExpirationAction extends ExpandableStringEnum { + /** + * Static value Log for ExpirationAction. + */ + public static final ExpirationAction LOG = fromString("Log"); + + /** + * Static value Block for ExpirationAction. + */ + public static final ExpirationAction BLOCK = fromString("Block"); + + /** + * Creates a new instance of ExpirationAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExpirationAction() { + } + + /** + * Creates or finds a ExpirationAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpirationAction. + */ + public static ExpirationAction fromString(String name) { + return fromString(name, ExpirationAction.class); + } + + /** + * Gets known ExpirationAction values. + * + * @return known ExpirationAction values. + */ + public static Collection values() { + return values(ExpirationAction.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExtendedLocation.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExtendedLocation.java new file mode 100644 index 0000000000000..5c2f7e60c8b4c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExtendedLocation.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 complex type of the extended location. + */ +@Fluent +public final class ExtendedLocation implements JsonSerializable { + /* + * The name of the extended location. + */ + private String name; + + /* + * The type of the extended location. + */ + private ExtendedLocationTypes type; + + /** + * Creates an instance of ExtendedLocation class. + */ + public ExtendedLocation() { + } + + /** + * Get the name property: The name of the extended location. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the extended location. + * + * @param name the name value to set. + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of the extended location. + * + * @return the type value. + */ + public ExtendedLocationTypes type() { + return this.type; + } + + /** + * Set the type property: The type of the extended location. + * + * @param type the type value to set. + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withType(ExtendedLocationTypes type) { + this.type = type; + 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("name", this.name); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExtendedLocation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExtendedLocation 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 ExtendedLocation. + */ + public static ExtendedLocation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExtendedLocation deserializedExtendedLocation = new ExtendedLocation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedExtendedLocation.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExtendedLocation.type = ExtendedLocationTypes.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedExtendedLocation; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExtendedLocationTypes.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExtendedLocationTypes.java new file mode 100644 index 0000000000000..62a40aa7f502b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExtendedLocationTypes.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of extendedLocation. + */ +public final class ExtendedLocationTypes extends ExpandableStringEnum { + /** + * Static value EdgeZone for ExtendedLocationTypes. + */ + public static final ExtendedLocationTypes EDGE_ZONE = fromString("EdgeZone"); + + /** + * Creates a new instance of ExtendedLocationTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExtendedLocationTypes() { + } + + /** + * Creates or finds a ExtendedLocationTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExtendedLocationTypes. + */ + public static ExtendedLocationTypes fromString(String name) { + return fromString(name, ExtendedLocationTypes.class); + } + + /** + * Gets known ExtendedLocationTypes values. + * + * @return known ExtendedLocationTypes values. + */ + public static Collection values() { + return values(ExtendedLocationTypes.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FailoverType.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FailoverType.java new file mode 100644 index 0000000000000..d0f4e704b378f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FailoverType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +/** + * Defines values for FailoverType. + */ +public enum FailoverType { + /** + * Enum value Planned. + */ + PLANNED("Planned"); + + /** + * The actual serialized value for a FailoverType instance. + */ + private final String value; + + FailoverType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a FailoverType instance. + * + * @param value the serialized value to parse. + * @return the parsed FailoverType object, or null if unable to parse. + */ + public static FailoverType fromString(String value) { + if (value == null) { + return null; + } + FailoverType[] items = FailoverType.values(); + for (FailoverType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServiceItems.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServiceItems.java new file mode 100644 index 0000000000000..b6a387e241553 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServiceItems.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.FileServiceItemsInner; +import java.util.List; + +/** + * An immutable client-side representation of FileServiceItems. + */ +public interface FileServiceItems { + /** + * Gets the value property: List of file services returned. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.FileServiceItemsInner object. + * + * @return the inner object. + */ + FileServiceItemsInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServiceProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServiceProperties.java new file mode 100644 index 0000000000000..a38fc49b1ea3a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServiceProperties.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.FileServicePropertiesInner; + +/** + * An immutable client-side representation of FileServiceProperties. + */ +public interface FileServiceProperties { + /** + * 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 sku property: Sku name and tier. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the cors property: Specifies CORS rules for the File service. You can include up to five CorsRule elements + * in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and + * CORS will be disabled for the File service. + * + * @return the cors value. + */ + CorsRules cors(); + + /** + * Gets the shareDeleteRetentionPolicy property: The file service properties for share soft delete. + * + * @return the shareDeleteRetentionPolicy value. + */ + DeleteRetentionPolicy shareDeleteRetentionPolicy(); + + /** + * Gets the protocolSettings property: Protocol settings for file service. + * + * @return the protocolSettings value. + */ + ProtocolSettings protocolSettings(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.FileServicePropertiesInner object. + * + * @return the inner object. + */ + FileServicePropertiesInner innerModel(); + + /** + * The entirety of the FileServiceProperties definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The FileServiceProperties definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the FileServiceProperties definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the FileServiceProperties definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the FileServiceProperties 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.WithCors, DefinitionStages.WithShareDeleteRetentionPolicy, + DefinitionStages.WithProtocolSettings { + /** + * Executes the create request. + * + * @return the created resource. + */ + FileServiceProperties create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FileServiceProperties create(Context context); + } + + /** + * The stage of the FileServiceProperties definition allowing to specify cors. + */ + interface WithCors { + /** + * Specifies the cors property: Specifies CORS rules for the File service. You can include up to five + * CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS + * rules will be deleted, and CORS will be disabled for the File service.. + * + * @param cors Specifies CORS rules for the File service. You can include up to five CorsRule elements in + * the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, + * and CORS will be disabled for the File service. + * @return the next definition stage. + */ + WithCreate withCors(CorsRules cors); + } + + /** + * The stage of the FileServiceProperties definition allowing to specify shareDeleteRetentionPolicy. + */ + interface WithShareDeleteRetentionPolicy { + /** + * Specifies the shareDeleteRetentionPolicy property: The file service properties for share soft delete.. + * + * @param shareDeleteRetentionPolicy The file service properties for share soft delete. + * @return the next definition stage. + */ + WithCreate withShareDeleteRetentionPolicy(DeleteRetentionPolicy shareDeleteRetentionPolicy); + } + + /** + * The stage of the FileServiceProperties definition allowing to specify protocolSettings. + */ + interface WithProtocolSettings { + /** + * Specifies the protocolSettings property: Protocol settings for file service. + * + * @param protocolSettings Protocol settings for file service. + * @return the next definition stage. + */ + WithCreate withProtocolSettings(ProtocolSettings protocolSettings); + } + } + + /** + * Begins update for the FileServiceProperties resource. + * + * @return the stage of resource update. + */ + FileServiceProperties.Update update(); + + /** + * The template for FileServiceProperties update. + */ + interface Update + extends UpdateStages.WithCors, UpdateStages.WithShareDeleteRetentionPolicy, UpdateStages.WithProtocolSettings { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FileServiceProperties apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FileServiceProperties apply(Context context); + } + + /** + * The FileServiceProperties update stages. + */ + interface UpdateStages { + /** + * The stage of the FileServiceProperties update allowing to specify cors. + */ + interface WithCors { + /** + * Specifies the cors property: Specifies CORS rules for the File service. You can include up to five + * CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS + * rules will be deleted, and CORS will be disabled for the File service.. + * + * @param cors Specifies CORS rules for the File service. You can include up to five CorsRule elements in + * the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, + * and CORS will be disabled for the File service. + * @return the next definition stage. + */ + Update withCors(CorsRules cors); + } + + /** + * The stage of the FileServiceProperties update allowing to specify shareDeleteRetentionPolicy. + */ + interface WithShareDeleteRetentionPolicy { + /** + * Specifies the shareDeleteRetentionPolicy property: The file service properties for share soft delete.. + * + * @param shareDeleteRetentionPolicy The file service properties for share soft delete. + * @return the next definition stage. + */ + Update withShareDeleteRetentionPolicy(DeleteRetentionPolicy shareDeleteRetentionPolicy); + } + + /** + * The stage of the FileServiceProperties update allowing to specify protocolSettings. + */ + interface WithProtocolSettings { + /** + * Specifies the protocolSettings property: Protocol settings for file service. + * + * @param protocolSettings Protocol settings for file service. + * @return the next definition stage. + */ + Update withProtocolSettings(ProtocolSettings protocolSettings); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FileServiceProperties refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FileServiceProperties refresh(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServiceUsage.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServiceUsage.java new file mode 100644 index 0000000000000..45f9b5829d531 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServiceUsage.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.FileServiceUsageInner; + +/** + * An immutable client-side representation of FileServiceUsage. + */ +public interface FileServiceUsage { + /** + * 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 properties property: File service usage in storage account including account limits, file share limits + * and constants used in recommendations and bursting formula. + * + * @return the properties value. + */ + FileServiceUsageProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.FileServiceUsageInner object. + * + * @return the inner object. + */ + FileServiceUsageInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServiceUsageProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServiceUsageProperties.java new file mode 100644 index 0000000000000..12d8becd868ea --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServiceUsageProperties.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * File service usage in storage account including account limits, file share limits and constants used in + * recommendations and bursting formula. + */ +@Immutable +public final class FileServiceUsageProperties implements JsonSerializable { + /* + * Maximum provisioned storage, IOPS, bandwidth and number of file shares limits for the storage account. + */ + private AccountLimits storageAccountLimits; + + /* + * Minimum and maximum provisioned storage, IOPS and bandwidth limits for a file share in the storage account. + */ + private FileShareLimits fileShareLimits; + + /* + * Constants used for calculating recommended provisioned IOPS and bandwidth for a file share in the storage + * account. + */ + private FileShareRecommendations fileShareRecommendations; + + /* + * Constants used for calculating included burst IOPS and maximum burst credits for IOPS for a file share in the + * storage account. + */ + private BurstingConstants burstingConstants; + + /* + * Usage of provisioned storage, IOPS, bandwidth and number of file shares across all live shares and soft-deleted + * shares in the account. + */ + private AccountUsage storageAccountUsage; + + /** + * Creates an instance of FileServiceUsageProperties class. + */ + public FileServiceUsageProperties() { + } + + /** + * Get the storageAccountLimits property: Maximum provisioned storage, IOPS, bandwidth and number of file shares + * limits for the storage account. + * + * @return the storageAccountLimits value. + */ + public AccountLimits storageAccountLimits() { + return this.storageAccountLimits; + } + + /** + * Get the fileShareLimits property: Minimum and maximum provisioned storage, IOPS and bandwidth limits for a file + * share in the storage account. + * + * @return the fileShareLimits value. + */ + public FileShareLimits fileShareLimits() { + return this.fileShareLimits; + } + + /** + * Get the fileShareRecommendations property: Constants used for calculating recommended provisioned IOPS and + * bandwidth for a file share in the storage account. + * + * @return the fileShareRecommendations value. + */ + public FileShareRecommendations fileShareRecommendations() { + return this.fileShareRecommendations; + } + + /** + * Get the burstingConstants property: Constants used for calculating included burst IOPS and maximum burst credits + * for IOPS for a file share in the storage account. + * + * @return the burstingConstants value. + */ + public BurstingConstants burstingConstants() { + return this.burstingConstants; + } + + /** + * Get the storageAccountUsage property: Usage of provisioned storage, IOPS, bandwidth and number of file shares + * across all live shares and soft-deleted shares in the account. + * + * @return the storageAccountUsage value. + */ + public AccountUsage storageAccountUsage() { + return this.storageAccountUsage; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storageAccountLimits() != null) { + storageAccountLimits().validate(); + } + if (fileShareLimits() != null) { + fileShareLimits().validate(); + } + if (fileShareRecommendations() != null) { + fileShareRecommendations().validate(); + } + if (burstingConstants() != null) { + burstingConstants().validate(); + } + if (storageAccountUsage() != null) { + storageAccountUsage().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileServiceUsageProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileServiceUsageProperties 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 FileServiceUsageProperties. + */ + public static FileServiceUsageProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileServiceUsageProperties deserializedFileServiceUsageProperties = new FileServiceUsageProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storageAccountLimits".equals(fieldName)) { + deserializedFileServiceUsageProperties.storageAccountLimits = AccountLimits.fromJson(reader); + } else if ("fileShareLimits".equals(fieldName)) { + deserializedFileServiceUsageProperties.fileShareLimits = FileShareLimits.fromJson(reader); + } else if ("fileShareRecommendations".equals(fieldName)) { + deserializedFileServiceUsageProperties.fileShareRecommendations + = FileShareRecommendations.fromJson(reader); + } else if ("burstingConstants".equals(fieldName)) { + deserializedFileServiceUsageProperties.burstingConstants = BurstingConstants.fromJson(reader); + } else if ("storageAccountUsage".equals(fieldName)) { + deserializedFileServiceUsageProperties.storageAccountUsage = AccountUsage.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFileServiceUsageProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServiceUsages.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServiceUsages.java new file mode 100644 index 0000000000000..18be44f60516c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServiceUsages.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.models.FileServiceUsageInner; +import java.io.IOException; +import java.util.List; + +/** + * List file service usages schema. + */ +@Immutable +public final class FileServiceUsages implements JsonSerializable { + /* + * List of file service usages returned. + */ + private List value; + + /* + * Request URL that can be used to query next page of file service usages. Returned when total number of requested + * file service usages exceed maximum page size. + */ + private String nextLink; + + /** + * Creates an instance of FileServiceUsages class. + */ + public FileServiceUsages() { + } + + /** + * Get the value property: List of file service usages returned. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Request URL that can be used to query next page of file service usages. Returned when + * total number of requested file service usages exceed maximum page size. + * + * @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) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileServiceUsages from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileServiceUsages 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 FileServiceUsages. + */ + public static FileServiceUsages fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileServiceUsages deserializedFileServiceUsages = new FileServiceUsages(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> FileServiceUsageInner.fromJson(reader1)); + deserializedFileServiceUsages.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedFileServiceUsages.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFileServiceUsages; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServices.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServices.java new file mode 100644 index 0000000000000..97f41e7f88405 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServices.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 FileServices. + */ +public interface FileServices { + /** + * List all file services in storage accounts. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 body along with {@link Response}. + */ + Response listWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * List all file services in storage accounts. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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. + */ + FileServiceItems list(String resourceGroupName, String accountName); + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules + * along with {@link Response}. + */ + Response getServicePropertiesWithResponse(String resourceGroupName, String accountName, + Context context); + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) + * rules. + */ + FileServiceProperties getServiceProperties(String resourceGroupName, String accountName); + + /** + * Gets the usages of file service in storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 usages of file service in storage account as paginated response with {@link PagedIterable}. + */ + PagedIterable listServiceUsages(String resourceGroupName, String accountName); + + /** + * Gets the usages of file service in storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of file service usages to be included in the list + * response. + * @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 usages of file service in storage account as paginated response with {@link PagedIterable}. + */ + PagedIterable listServiceUsages(String resourceGroupName, String accountName, Integer maxpagesize, + Context context); + + /** + * Gets the usage of file service in storage account including account limits, file share limits and constants used + * in recommendations and bursting formula. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 usage of file service in storage account including account limits, file share limits and constants + * used in recommendations and bursting formula along with {@link Response}. + */ + Response getServiceUsageWithResponse(String resourceGroupName, String accountName, + Context context); + + /** + * Gets the usage of file service in storage account including account limits, file share limits and constants used + * in recommendations and bursting formula. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 usage of file service in storage account including account limits, file share limits and constants + * used in recommendations and bursting formula. + */ + FileServiceUsage getServiceUsage(String resourceGroupName, String accountName); + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules + * along with {@link Response}. + */ + FileServiceProperties getServicePropertiesById(String id); + + /** + * Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules + * along with {@link Response}. + */ + Response getServicePropertiesByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new FileServiceProperties resource. + * + * @return the first stage of the new FileServiceProperties definition. + */ + FileServiceProperties.DefinitionStages.Blank define(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShare.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShare.java new file mode 100644 index 0000000000000..4e78530392a10 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShare.java @@ -0,0 +1,686 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.FileShareInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of FileShare. + */ +public interface FileShare { + /** + * 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 etag property: Resource Etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the lastModifiedTime property: Returns the date and time the share was last modified. + * + * @return the lastModifiedTime value. + */ + OffsetDateTime lastModifiedTime(); + + /** + * Gets the metadata property: A name-value pair to associate with the share as metadata. + * + * @return the metadata value. + */ + Map metadata(); + + /** + * Gets the shareQuota property: The provisioned size of the share, in gibibytes. Must be greater than 0, and less + * than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. For file shares created under + * Files Provisioned v2 account type, please refer to the GetFileServiceUsage API response for the minimum and + * maximum allowed provisioned storage size. + * + * @return the shareQuota value. + */ + Integer shareQuota(); + + /** + * Gets the provisionedIops property: The provisioned IOPS of the share. This property is only for file shares + * created under Files Provisioned v2 account type. Please refer to the GetFileServiceUsage API response for the + * minimum and maximum allowed value for provisioned IOPS. + * + * @return the provisionedIops value. + */ + Integer provisionedIops(); + + /** + * Gets the provisionedBandwidthMibps property: The provisioned bandwidth of the share, in mebibytes per second. + * This property is only for file shares created under Files Provisioned v2 account type. Please refer to the + * GetFileServiceUsage API response for the minimum and maximum allowed value for provisioned bandwidth. + * + * @return the provisionedBandwidthMibps value. + */ + Integer provisionedBandwidthMibps(); + + /** + * Gets the includedBurstIops property: The calculated burst IOPS of the share. This property is only for file + * shares created under Files Provisioned v2 account type. + * + * @return the includedBurstIops value. + */ + Integer includedBurstIops(); + + /** + * Gets the maxBurstCreditsForIops property: The calculated maximum burst credits for the share. This property is + * only for file shares created under Files Provisioned v2 account type. + * + * @return the maxBurstCreditsForIops value. + */ + Long maxBurstCreditsForIops(); + + /** + * Gets the nextAllowedQuotaDowngradeTime property: Returns the next allowed provisioned storage size downgrade time + * for the share. This property is only for file shares created under Files Provisioned v1 SSD and Files Provisioned + * v2 account type. + * + * @return the nextAllowedQuotaDowngradeTime value. + */ + OffsetDateTime nextAllowedQuotaDowngradeTime(); + + /** + * Gets the nextAllowedProvisionedIopsDowngradeTime property: Returns the next allowed provisioned IOPS downgrade + * time for the share. This property is only for file shares created under Files Provisioned v2 account type. + * + * @return the nextAllowedProvisionedIopsDowngradeTime value. + */ + OffsetDateTime nextAllowedProvisionedIopsDowngradeTime(); + + /** + * Gets the nextAllowedProvisionedBandwidthDowngradeTime property: Returns the next allowed provisioned bandwidth + * downgrade time for the share. This property is only for file shares created under Files Provisioned v2 account + * type. + * + * @return the nextAllowedProvisionedBandwidthDowngradeTime value. + */ + OffsetDateTime nextAllowedProvisionedBandwidthDowngradeTime(); + + /** + * Gets the enabledProtocols property: The authentication protocol that is used for the file share. Can only be + * specified when creating a share. + * + * @return the enabledProtocols value. + */ + EnabledProtocols enabledProtocols(); + + /** + * Gets the rootSquash property: The property is for NFS share only. The default is NoRootSquash. + * + * @return the rootSquash value. + */ + RootSquashType rootSquash(); + + /** + * Gets the version property: The version of the share. + * + * @return the version value. + */ + String version(); + + /** + * Gets the deleted property: Indicates whether the share was deleted. + * + * @return the deleted value. + */ + Boolean deleted(); + + /** + * Gets the deletedTime property: The deleted time if the share was deleted. + * + * @return the deletedTime value. + */ + OffsetDateTime deletedTime(); + + /** + * Gets the remainingRetentionDays property: Remaining retention days for share that was soft deleted. + * + * @return the remainingRetentionDays value. + */ + Integer remainingRetentionDays(); + + /** + * Gets the accessTier property: Access tier for specific share. GpV2 account can choose between + * TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. + * + * @return the accessTier value. + */ + ShareAccessTier accessTier(); + + /** + * Gets the accessTierChangeTime property: Indicates the last modification time for share access tier. + * + * @return the accessTierChangeTime value. + */ + OffsetDateTime accessTierChangeTime(); + + /** + * Gets the accessTierStatus property: Indicates if there is a pending transition for access tier. + * + * @return the accessTierStatus value. + */ + String accessTierStatus(); + + /** + * Gets the shareUsageBytes property: The approximate size of the data stored on the share. Note that this value may + * not include all recently created or recently resized files. + * + * @return the shareUsageBytes value. + */ + Long shareUsageBytes(); + + /** + * Gets the leaseStatus property: The lease status of the share. + * + * @return the leaseStatus value. + */ + LeaseStatus leaseStatus(); + + /** + * Gets the leaseState property: Lease state of the share. + * + * @return the leaseState value. + */ + LeaseState leaseState(); + + /** + * Gets the leaseDuration property: Specifies whether the lease on a share is of infinite or fixed duration, only + * when the share is leased. + * + * @return the leaseDuration value. + */ + LeaseDuration leaseDuration(); + + /** + * Gets the signedIdentifiers property: List of stored access policies specified on the share. + * + * @return the signedIdentifiers value. + */ + List signedIdentifiers(); + + /** + * Gets the snapshotTime property: Creation time of share snapshot returned in the response of list shares with + * expand param "snapshots". + * + * @return the snapshotTime value. + */ + OffsetDateTime snapshotTime(); + + /** + * Gets the fileSharePaidBursting property: File Share Paid Bursting properties. + * + * @return the fileSharePaidBursting value. + */ + FileSharePropertiesFileSharePaidBursting fileSharePaidBursting(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.FileShareInner object. + * + * @return the inner object. + */ + FileShareInner innerModel(); + + /** + * The entirety of the FileShare definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The FileShare definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the FileShare definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the FileShare definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the FileShare 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.WithMetadata, DefinitionStages.WithShareQuota, + DefinitionStages.WithProvisionedIops, DefinitionStages.WithProvisionedBandwidthMibps, + DefinitionStages.WithEnabledProtocols, DefinitionStages.WithRootSquash, DefinitionStages.WithAccessTier, + DefinitionStages.WithSignedIdentifiers, DefinitionStages.WithFileSharePaidBursting, + DefinitionStages.WithExpand { + /** + * Executes the create request. + * + * @return the created resource. + */ + FileShare create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FileShare create(Context context); + } + + /** + * The stage of the FileShare definition allowing to specify metadata. + */ + interface WithMetadata { + /** + * Specifies the metadata property: A name-value pair to associate with the share as metadata.. + * + * @param metadata A name-value pair to associate with the share as metadata. + * @return the next definition stage. + */ + WithCreate withMetadata(Map metadata); + } + + /** + * The stage of the FileShare definition allowing to specify shareQuota. + */ + interface WithShareQuota { + /** + * Specifies the shareQuota property: The provisioned size of the share, in gibibytes. Must be greater than + * 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. For file + * shares created under Files Provisioned v2 account type, please refer to the GetFileServiceUsage API + * response for the minimum and maximum allowed provisioned storage size.. + * + * @param shareQuota The provisioned size of the share, in gibibytes. Must be greater than 0, and less than + * or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. For file shares created under + * Files Provisioned v2 account type, please refer to the GetFileServiceUsage API response for the minimum + * and maximum allowed provisioned storage size. + * @return the next definition stage. + */ + WithCreate withShareQuota(Integer shareQuota); + } + + /** + * The stage of the FileShare definition allowing to specify provisionedIops. + */ + interface WithProvisionedIops { + /** + * Specifies the provisionedIops property: The provisioned IOPS of the share. This property is only for file + * shares created under Files Provisioned v2 account type. Please refer to the GetFileServiceUsage API + * response for the minimum and maximum allowed value for provisioned IOPS.. + * + * @param provisionedIops The provisioned IOPS of the share. This property is only for file shares created + * under Files Provisioned v2 account type. Please refer to the GetFileServiceUsage API response for the + * minimum and maximum allowed value for provisioned IOPS. + * @return the next definition stage. + */ + WithCreate withProvisionedIops(Integer provisionedIops); + } + + /** + * The stage of the FileShare definition allowing to specify provisionedBandwidthMibps. + */ + interface WithProvisionedBandwidthMibps { + /** + * Specifies the provisionedBandwidthMibps property: The provisioned bandwidth of the share, in mebibytes + * per second. This property is only for file shares created under Files Provisioned v2 account type. Please + * refer to the GetFileServiceUsage API response for the minimum and maximum allowed value for provisioned + * bandwidth.. + * + * @param provisionedBandwidthMibps The provisioned bandwidth of the share, in mebibytes per second. This + * property is only for file shares created under Files Provisioned v2 account type. Please refer to the + * GetFileServiceUsage API response for the minimum and maximum allowed value for provisioned bandwidth. + * @return the next definition stage. + */ + WithCreate withProvisionedBandwidthMibps(Integer provisionedBandwidthMibps); + } + + /** + * The stage of the FileShare definition allowing to specify enabledProtocols. + */ + interface WithEnabledProtocols { + /** + * Specifies the enabledProtocols property: The authentication protocol that is used for the file share. Can + * only be specified when creating a share.. + * + * @param enabledProtocols The authentication protocol that is used for the file share. Can only be + * specified when creating a share. + * @return the next definition stage. + */ + WithCreate withEnabledProtocols(EnabledProtocols enabledProtocols); + } + + /** + * The stage of the FileShare definition allowing to specify rootSquash. + */ + interface WithRootSquash { + /** + * Specifies the rootSquash property: The property is for NFS share only. The default is NoRootSquash.. + * + * @param rootSquash The property is for NFS share only. The default is NoRootSquash. + * @return the next definition stage. + */ + WithCreate withRootSquash(RootSquashType rootSquash); + } + + /** + * The stage of the FileShare definition allowing to specify accessTier. + */ + interface WithAccessTier { + /** + * Specifies the accessTier property: Access tier for specific share. GpV2 account can choose between + * TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium.. + * + * @param accessTier Access tier for specific share. GpV2 account can choose between TransactionOptimized + * (default), Hot, and Cool. FileStorage account can choose Premium. + * @return the next definition stage. + */ + WithCreate withAccessTier(ShareAccessTier accessTier); + } + + /** + * The stage of the FileShare definition allowing to specify signedIdentifiers. + */ + interface WithSignedIdentifiers { + /** + * Specifies the signedIdentifiers property: List of stored access policies specified on the share.. + * + * @param signedIdentifiers List of stored access policies specified on the share. + * @return the next definition stage. + */ + WithCreate withSignedIdentifiers(List signedIdentifiers); + } + + /** + * The stage of the FileShare definition allowing to specify fileSharePaidBursting. + */ + interface WithFileSharePaidBursting { + /** + * Specifies the fileSharePaidBursting property: File Share Paid Bursting properties.. + * + * @param fileSharePaidBursting File Share Paid Bursting properties. + * @return the next definition stage. + */ + WithCreate withFileSharePaidBursting(FileSharePropertiesFileSharePaidBursting fileSharePaidBursting); + } + + /** + * The stage of the FileShare definition allowing to specify expand. + */ + interface WithExpand { + /** + * Specifies the expand property: Optional, used to expand the properties within share's properties. Valid + * values are: snapshots. Should be passed as a string with delimiter ','. + * + * @param expand Optional, used to expand the properties within share's properties. Valid values are: + * snapshots. Should be passed as a string with delimiter ','. + * @return the next definition stage. + */ + WithCreate withExpand(String expand); + } + } + + /** + * Begins update for the FileShare resource. + * + * @return the stage of resource update. + */ + FileShare.Update update(); + + /** + * The template for FileShare update. + */ + interface Update extends UpdateStages.WithMetadata, UpdateStages.WithShareQuota, UpdateStages.WithProvisionedIops, + UpdateStages.WithProvisionedBandwidthMibps, UpdateStages.WithRootSquash, UpdateStages.WithAccessTier, + UpdateStages.WithSignedIdentifiers, UpdateStages.WithFileSharePaidBursting { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FileShare apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FileShare apply(Context context); + } + + /** + * The FileShare update stages. + */ + interface UpdateStages { + /** + * The stage of the FileShare update allowing to specify metadata. + */ + interface WithMetadata { + /** + * Specifies the metadata property: A name-value pair to associate with the share as metadata.. + * + * @param metadata A name-value pair to associate with the share as metadata. + * @return the next definition stage. + */ + Update withMetadata(Map metadata); + } + + /** + * The stage of the FileShare update allowing to specify shareQuota. + */ + interface WithShareQuota { + /** + * Specifies the shareQuota property: The provisioned size of the share, in gibibytes. Must be greater than + * 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. For file + * shares created under Files Provisioned v2 account type, please refer to the GetFileServiceUsage API + * response for the minimum and maximum allowed provisioned storage size.. + * + * @param shareQuota The provisioned size of the share, in gibibytes. Must be greater than 0, and less than + * or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. For file shares created under + * Files Provisioned v2 account type, please refer to the GetFileServiceUsage API response for the minimum + * and maximum allowed provisioned storage size. + * @return the next definition stage. + */ + Update withShareQuota(Integer shareQuota); + } + + /** + * The stage of the FileShare update allowing to specify provisionedIops. + */ + interface WithProvisionedIops { + /** + * Specifies the provisionedIops property: The provisioned IOPS of the share. This property is only for file + * shares created under Files Provisioned v2 account type. Please refer to the GetFileServiceUsage API + * response for the minimum and maximum allowed value for provisioned IOPS.. + * + * @param provisionedIops The provisioned IOPS of the share. This property is only for file shares created + * under Files Provisioned v2 account type. Please refer to the GetFileServiceUsage API response for the + * minimum and maximum allowed value for provisioned IOPS. + * @return the next definition stage. + */ + Update withProvisionedIops(Integer provisionedIops); + } + + /** + * The stage of the FileShare update allowing to specify provisionedBandwidthMibps. + */ + interface WithProvisionedBandwidthMibps { + /** + * Specifies the provisionedBandwidthMibps property: The provisioned bandwidth of the share, in mebibytes + * per second. This property is only for file shares created under Files Provisioned v2 account type. Please + * refer to the GetFileServiceUsage API response for the minimum and maximum allowed value for provisioned + * bandwidth.. + * + * @param provisionedBandwidthMibps The provisioned bandwidth of the share, in mebibytes per second. This + * property is only for file shares created under Files Provisioned v2 account type. Please refer to the + * GetFileServiceUsage API response for the minimum and maximum allowed value for provisioned bandwidth. + * @return the next definition stage. + */ + Update withProvisionedBandwidthMibps(Integer provisionedBandwidthMibps); + } + + /** + * The stage of the FileShare update allowing to specify rootSquash. + */ + interface WithRootSquash { + /** + * Specifies the rootSquash property: The property is for NFS share only. The default is NoRootSquash.. + * + * @param rootSquash The property is for NFS share only. The default is NoRootSquash. + * @return the next definition stage. + */ + Update withRootSquash(RootSquashType rootSquash); + } + + /** + * The stage of the FileShare update allowing to specify accessTier. + */ + interface WithAccessTier { + /** + * Specifies the accessTier property: Access tier for specific share. GpV2 account can choose between + * TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium.. + * + * @param accessTier Access tier for specific share. GpV2 account can choose between TransactionOptimized + * (default), Hot, and Cool. FileStorage account can choose Premium. + * @return the next definition stage. + */ + Update withAccessTier(ShareAccessTier accessTier); + } + + /** + * The stage of the FileShare update allowing to specify signedIdentifiers. + */ + interface WithSignedIdentifiers { + /** + * Specifies the signedIdentifiers property: List of stored access policies specified on the share.. + * + * @param signedIdentifiers List of stored access policies specified on the share. + * @return the next definition stage. + */ + Update withSignedIdentifiers(List signedIdentifiers); + } + + /** + * The stage of the FileShare update allowing to specify fileSharePaidBursting. + */ + interface WithFileSharePaidBursting { + /** + * Specifies the fileSharePaidBursting property: File Share Paid Bursting properties.. + * + * @param fileSharePaidBursting File Share Paid Bursting properties. + * @return the next definition stage. + */ + Update withFileSharePaidBursting(FileSharePropertiesFileSharePaidBursting fileSharePaidBursting); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FileShare refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FileShare refresh(Context context); + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param deletedShare The deletedShare parameter. + * @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 Response}. + */ + Response restoreWithResponse(DeletedShare deletedShare, Context context); + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param deletedShare The deletedShare parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 restore(DeletedShare deletedShare); + + /** + * The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite. + * + * @param xMsSnapshot Optional. Specify the snapshot time to lease a snapshot. + * @param parameters Lease Share request body. + * @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 lease Share response schema. + */ + Response leaseWithResponse(String xMsSnapshot, LeaseShareRequest parameters, Context context); + + /** + * The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite. + * + * @throws com.azure.core.management.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 lease Share response schema. + */ + LeaseShareResponse lease(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShareItem.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShareItem.java new file mode 100644 index 0000000000000..defb2a7512c9d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShareItem.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.FileShareItemInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of FileShareItem. + */ +public interface FileShareItem { + /** + * 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 etag property: Resource Etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the lastModifiedTime property: Returns the date and time the share was last modified. + * + * @return the lastModifiedTime value. + */ + OffsetDateTime lastModifiedTime(); + + /** + * Gets the metadata property: A name-value pair to associate with the share as metadata. + * + * @return the metadata value. + */ + Map metadata(); + + /** + * Gets the shareQuota property: The provisioned size of the share, in gibibytes. Must be greater than 0, and less + * than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. For file shares created under + * Files Provisioned v2 account type, please refer to the GetFileServiceUsage API response for the minimum and + * maximum allowed provisioned storage size. + * + * @return the shareQuota value. + */ + Integer shareQuota(); + + /** + * Gets the provisionedIops property: The provisioned IOPS of the share. This property is only for file shares + * created under Files Provisioned v2 account type. Please refer to the GetFileServiceUsage API response for the + * minimum and maximum allowed value for provisioned IOPS. + * + * @return the provisionedIops value. + */ + Integer provisionedIops(); + + /** + * Gets the provisionedBandwidthMibps property: The provisioned bandwidth of the share, in mebibytes per second. + * This property is only for file shares created under Files Provisioned v2 account type. Please refer to the + * GetFileServiceUsage API response for the minimum and maximum allowed value for provisioned bandwidth. + * + * @return the provisionedBandwidthMibps value. + */ + Integer provisionedBandwidthMibps(); + + /** + * Gets the includedBurstIops property: The calculated burst IOPS of the share. This property is only for file + * shares created under Files Provisioned v2 account type. + * + * @return the includedBurstIops value. + */ + Integer includedBurstIops(); + + /** + * Gets the maxBurstCreditsForIops property: The calculated maximum burst credits for the share. This property is + * only for file shares created under Files Provisioned v2 account type. + * + * @return the maxBurstCreditsForIops value. + */ + Long maxBurstCreditsForIops(); + + /** + * Gets the nextAllowedQuotaDowngradeTime property: Returns the next allowed provisioned storage size downgrade time + * for the share. This property is only for file shares created under Files Provisioned v1 SSD and Files Provisioned + * v2 account type. + * + * @return the nextAllowedQuotaDowngradeTime value. + */ + OffsetDateTime nextAllowedQuotaDowngradeTime(); + + /** + * Gets the nextAllowedProvisionedIopsDowngradeTime property: Returns the next allowed provisioned IOPS downgrade + * time for the share. This property is only for file shares created under Files Provisioned v2 account type. + * + * @return the nextAllowedProvisionedIopsDowngradeTime value. + */ + OffsetDateTime nextAllowedProvisionedIopsDowngradeTime(); + + /** + * Gets the nextAllowedProvisionedBandwidthDowngradeTime property: Returns the next allowed provisioned bandwidth + * downgrade time for the share. This property is only for file shares created under Files Provisioned v2 account + * type. + * + * @return the nextAllowedProvisionedBandwidthDowngradeTime value. + */ + OffsetDateTime nextAllowedProvisionedBandwidthDowngradeTime(); + + /** + * Gets the enabledProtocols property: The authentication protocol that is used for the file share. Can only be + * specified when creating a share. + * + * @return the enabledProtocols value. + */ + EnabledProtocols enabledProtocols(); + + /** + * Gets the rootSquash property: The property is for NFS share only. The default is NoRootSquash. + * + * @return the rootSquash value. + */ + RootSquashType rootSquash(); + + /** + * Gets the version property: The version of the share. + * + * @return the version value. + */ + String version(); + + /** + * Gets the deleted property: Indicates whether the share was deleted. + * + * @return the deleted value. + */ + Boolean deleted(); + + /** + * Gets the deletedTime property: The deleted time if the share was deleted. + * + * @return the deletedTime value. + */ + OffsetDateTime deletedTime(); + + /** + * Gets the remainingRetentionDays property: Remaining retention days for share that was soft deleted. + * + * @return the remainingRetentionDays value. + */ + Integer remainingRetentionDays(); + + /** + * Gets the accessTier property: Access tier for specific share. GpV2 account can choose between + * TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium. + * + * @return the accessTier value. + */ + ShareAccessTier accessTier(); + + /** + * Gets the accessTierChangeTime property: Indicates the last modification time for share access tier. + * + * @return the accessTierChangeTime value. + */ + OffsetDateTime accessTierChangeTime(); + + /** + * Gets the accessTierStatus property: Indicates if there is a pending transition for access tier. + * + * @return the accessTierStatus value. + */ + String accessTierStatus(); + + /** + * Gets the shareUsageBytes property: The approximate size of the data stored on the share. Note that this value may + * not include all recently created or recently resized files. + * + * @return the shareUsageBytes value. + */ + Long shareUsageBytes(); + + /** + * Gets the leaseStatus property: The lease status of the share. + * + * @return the leaseStatus value. + */ + LeaseStatus leaseStatus(); + + /** + * Gets the leaseState property: Lease state of the share. + * + * @return the leaseState value. + */ + LeaseState leaseState(); + + /** + * Gets the leaseDuration property: Specifies whether the lease on a share is of infinite or fixed duration, only + * when the share is leased. + * + * @return the leaseDuration value. + */ + LeaseDuration leaseDuration(); + + /** + * Gets the signedIdentifiers property: List of stored access policies specified on the share. + * + * @return the signedIdentifiers value. + */ + List signedIdentifiers(); + + /** + * Gets the snapshotTime property: Creation time of share snapshot returned in the response of list shares with + * expand param "snapshots". + * + * @return the snapshotTime value. + */ + OffsetDateTime snapshotTime(); + + /** + * Gets the fileSharePaidBursting property: File Share Paid Bursting properties. + * + * @return the fileSharePaidBursting value. + */ + FileSharePropertiesFileSharePaidBursting fileSharePaidBursting(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.FileShareItemInner object. + * + * @return the inner object. + */ + FileShareItemInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShareItems.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShareItems.java new file mode 100644 index 0000000000000..074a176d63c44 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShareItems.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.models.FileShareItemInner; +import java.io.IOException; +import java.util.List; + +/** + * Response schema. Contains list of shares returned, and if paging is requested or required, a URL to next page of + * shares. + */ +@Immutable +public final class FileShareItems implements JsonSerializable { + /* + * List of file shares returned. + */ + private List value; + + /* + * Request URL that can be used to query next page of shares. Returned when total number of requested shares exceed + * maximum page size. + */ + private String nextLink; + + /** + * Creates an instance of FileShareItems class. + */ + public FileShareItems() { + } + + /** + * Get the value property: List of file shares returned. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Request URL that can be used to query next page of shares. Returned when total number + * of requested shares exceed maximum page size. + * + * @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) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareItems from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareItems 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 FileShareItems. + */ + public static FileShareItems fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareItems deserializedFileShareItems = new FileShareItems(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> FileShareItemInner.fromJson(reader1)); + deserializedFileShareItems.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedFileShareItems.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareItems; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShareLimits.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShareLimits.java new file mode 100644 index 0000000000000..fe84039b13499 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShareLimits.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Minimum and maximum provisioned storage, IOPS and bandwidth limits for a file share in the storage account. + */ +@Immutable +public final class FileShareLimits implements JsonSerializable { + /* + * The minimum provisioned storage quota limit in gibibytes for a file share in the storage account. + */ + private Integer minProvisionedStorageGiB; + + /* + * The maximum provisioned storage quota limit in gibibytes for a file share in the storage account. + */ + private Integer maxProvisionedStorageGiB; + + /* + * The minimum provisioned IOPS limit for a file share in the storage account. + */ + private Integer minProvisionedIops; + + /* + * The maximum provisioned IOPS limit for a file share in the storage account. + */ + private Integer maxProvisionedIops; + + /* + * The minimum provisioned bandwidth limit in mebibytes per second for a file share in the storage account. + */ + private Integer minProvisionedBandwidthMiBPerSec; + + /* + * The maximum provisioned bandwidth limit in mebibytes per second for a file share in the storage account. + */ + private Integer maxProvisionedBandwidthMiBPerSec; + + /** + * Creates an instance of FileShareLimits class. + */ + public FileShareLimits() { + } + + /** + * Get the minProvisionedStorageGiB property: The minimum provisioned storage quota limit in gibibytes for a file + * share in the storage account. + * + * @return the minProvisionedStorageGiB value. + */ + public Integer minProvisionedStorageGiB() { + return this.minProvisionedStorageGiB; + } + + /** + * Get the maxProvisionedStorageGiB property: The maximum provisioned storage quota limit in gibibytes for a file + * share in the storage account. + * + * @return the maxProvisionedStorageGiB value. + */ + public Integer maxProvisionedStorageGiB() { + return this.maxProvisionedStorageGiB; + } + + /** + * Get the minProvisionedIops property: The minimum provisioned IOPS limit for a file share in the storage account. + * + * @return the minProvisionedIops value. + */ + public Integer minProvisionedIops() { + return this.minProvisionedIops; + } + + /** + * Get the maxProvisionedIops property: The maximum provisioned IOPS limit for a file share in the storage account. + * + * @return the maxProvisionedIops value. + */ + public Integer maxProvisionedIops() { + return this.maxProvisionedIops; + } + + /** + * Get the minProvisionedBandwidthMiBPerSec property: The minimum provisioned bandwidth limit in mebibytes per + * second for a file share in the storage account. + * + * @return the minProvisionedBandwidthMiBPerSec value. + */ + public Integer minProvisionedBandwidthMiBPerSec() { + return this.minProvisionedBandwidthMiBPerSec; + } + + /** + * Get the maxProvisionedBandwidthMiBPerSec property: The maximum provisioned bandwidth limit in mebibytes per + * second for a file share in the storage account. + * + * @return the maxProvisionedBandwidthMiBPerSec value. + */ + public Integer maxProvisionedBandwidthMiBPerSec() { + return this.maxProvisionedBandwidthMiBPerSec; + } + + /** + * 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 FileShareLimits from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareLimits 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 FileShareLimits. + */ + public static FileShareLimits fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareLimits deserializedFileShareLimits = new FileShareLimits(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("minProvisionedStorageGiB".equals(fieldName)) { + deserializedFileShareLimits.minProvisionedStorageGiB = reader.getNullable(JsonReader::getInt); + } else if ("maxProvisionedStorageGiB".equals(fieldName)) { + deserializedFileShareLimits.maxProvisionedStorageGiB = reader.getNullable(JsonReader::getInt); + } else if ("minProvisionedIOPS".equals(fieldName)) { + deserializedFileShareLimits.minProvisionedIops = reader.getNullable(JsonReader::getInt); + } else if ("maxProvisionedIOPS".equals(fieldName)) { + deserializedFileShareLimits.maxProvisionedIops = reader.getNullable(JsonReader::getInt); + } else if ("minProvisionedBandwidthMiBPerSec".equals(fieldName)) { + deserializedFileShareLimits.minProvisionedBandwidthMiBPerSec + = reader.getNullable(JsonReader::getInt); + } else if ("maxProvisionedBandwidthMiBPerSec".equals(fieldName)) { + deserializedFileShareLimits.maxProvisionedBandwidthMiBPerSec + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareLimits; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileSharePropertiesFileSharePaidBursting.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileSharePropertiesFileSharePaidBursting.java new file mode 100644 index 0000000000000..ba92520a6b21d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileSharePropertiesFileSharePaidBursting.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * File Share Paid Bursting properties. + */ +@Fluent +public final class FileSharePropertiesFileSharePaidBursting + implements JsonSerializable { + /* + * Indicates whether paid bursting is enabled for the share. This property is only for file shares created under + * Files Provisioned v1 SSD account type. + */ + private Boolean paidBurstingEnabled; + + /* + * The maximum paid bursting IOPS for the share. This property is only for file shares created under Files + * Provisioned v1 SSD account type. The maximum allowed value is 102400 which is the maximum allowed IOPS for a + * share. + */ + private Integer paidBurstingMaxIops; + + /* + * The maximum paid bursting bandwidth for the share, in mebibytes per second. This property is only for file shares + * created under Files Provisioned v1 SSD account type. The maximum allowed value is 10340 which is the maximum + * allowed bandwidth for a share. + */ + private Integer paidBurstingMaxBandwidthMibps; + + /** + * Creates an instance of FileSharePropertiesFileSharePaidBursting class. + */ + public FileSharePropertiesFileSharePaidBursting() { + } + + /** + * Get the paidBurstingEnabled property: Indicates whether paid bursting is enabled for the share. This property is + * only for file shares created under Files Provisioned v1 SSD account type. + * + * @return the paidBurstingEnabled value. + */ + public Boolean paidBurstingEnabled() { + return this.paidBurstingEnabled; + } + + /** + * Set the paidBurstingEnabled property: Indicates whether paid bursting is enabled for the share. This property is + * only for file shares created under Files Provisioned v1 SSD account type. + * + * @param paidBurstingEnabled the paidBurstingEnabled value to set. + * @return the FileSharePropertiesFileSharePaidBursting object itself. + */ + public FileSharePropertiesFileSharePaidBursting withPaidBurstingEnabled(Boolean paidBurstingEnabled) { + this.paidBurstingEnabled = paidBurstingEnabled; + return this; + } + + /** + * Get the paidBurstingMaxIops property: The maximum paid bursting IOPS for the share. This property is only for + * file shares created under Files Provisioned v1 SSD account type. The maximum allowed value is 102400 which is the + * maximum allowed IOPS for a share. + * + * @return the paidBurstingMaxIops value. + */ + public Integer paidBurstingMaxIops() { + return this.paidBurstingMaxIops; + } + + /** + * Set the paidBurstingMaxIops property: The maximum paid bursting IOPS for the share. This property is only for + * file shares created under Files Provisioned v1 SSD account type. The maximum allowed value is 102400 which is the + * maximum allowed IOPS for a share. + * + * @param paidBurstingMaxIops the paidBurstingMaxIops value to set. + * @return the FileSharePropertiesFileSharePaidBursting object itself. + */ + public FileSharePropertiesFileSharePaidBursting withPaidBurstingMaxIops(Integer paidBurstingMaxIops) { + this.paidBurstingMaxIops = paidBurstingMaxIops; + return this; + } + + /** + * Get the paidBurstingMaxBandwidthMibps property: The maximum paid bursting bandwidth for the share, in mebibytes + * per second. This property is only for file shares created under Files Provisioned v1 SSD account type. The + * maximum allowed value is 10340 which is the maximum allowed bandwidth for a share. + * + * @return the paidBurstingMaxBandwidthMibps value. + */ + public Integer paidBurstingMaxBandwidthMibps() { + return this.paidBurstingMaxBandwidthMibps; + } + + /** + * Set the paidBurstingMaxBandwidthMibps property: The maximum paid bursting bandwidth for the share, in mebibytes + * per second. This property is only for file shares created under Files Provisioned v1 SSD account type. The + * maximum allowed value is 10340 which is the maximum allowed bandwidth for a share. + * + * @param paidBurstingMaxBandwidthMibps the paidBurstingMaxBandwidthMibps value to set. + * @return the FileSharePropertiesFileSharePaidBursting object itself. + */ + public FileSharePropertiesFileSharePaidBursting + withPaidBurstingMaxBandwidthMibps(Integer paidBurstingMaxBandwidthMibps) { + this.paidBurstingMaxBandwidthMibps = paidBurstingMaxBandwidthMibps; + 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.writeBooleanField("paidBurstingEnabled", this.paidBurstingEnabled); + jsonWriter.writeNumberField("paidBurstingMaxIops", this.paidBurstingMaxIops); + jsonWriter.writeNumberField("paidBurstingMaxBandwidthMibps", this.paidBurstingMaxBandwidthMibps); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileSharePropertiesFileSharePaidBursting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileSharePropertiesFileSharePaidBursting 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 FileSharePropertiesFileSharePaidBursting. + */ + public static FileSharePropertiesFileSharePaidBursting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileSharePropertiesFileSharePaidBursting deserializedFileSharePropertiesFileSharePaidBursting + = new FileSharePropertiesFileSharePaidBursting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("paidBurstingEnabled".equals(fieldName)) { + deserializedFileSharePropertiesFileSharePaidBursting.paidBurstingEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("paidBurstingMaxIops".equals(fieldName)) { + deserializedFileSharePropertiesFileSharePaidBursting.paidBurstingMaxIops + = reader.getNullable(JsonReader::getInt); + } else if ("paidBurstingMaxBandwidthMibps".equals(fieldName)) { + deserializedFileSharePropertiesFileSharePaidBursting.paidBurstingMaxBandwidthMibps + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedFileSharePropertiesFileSharePaidBursting; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShareRecommendations.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShareRecommendations.java new file mode 100644 index 0000000000000..470bff1f81b09 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShareRecommendations.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Constants used for calculating recommended provisioned IOPS and bandwidth for a file share in the storage account. + */ +@Immutable +public final class FileShareRecommendations implements JsonSerializable { + /* + * The base IOPS in the file share provisioned IOPS recommendation formula. + */ + private Integer baseIops; + + /* + * The scalar for IO in the file share provisioned IOPS recommendation formula. + */ + private Double ioScalar; + + /* + * The base bandwidth in the file share provisioned bandwidth recommendation formula. + */ + private Integer baseBandwidthMiBPerSec; + + /* + * The scalar for bandwidth in the file share provisioned bandwidth recommendation formula. + */ + private Double bandwidthScalar; + + /** + * Creates an instance of FileShareRecommendations class. + */ + public FileShareRecommendations() { + } + + /** + * Get the baseIops property: The base IOPS in the file share provisioned IOPS recommendation formula. + * + * @return the baseIops value. + */ + public Integer baseIops() { + return this.baseIops; + } + + /** + * Get the ioScalar property: The scalar for IO in the file share provisioned IOPS recommendation formula. + * + * @return the ioScalar value. + */ + public Double ioScalar() { + return this.ioScalar; + } + + /** + * Get the baseBandwidthMiBPerSec property: The base bandwidth in the file share provisioned bandwidth + * recommendation formula. + * + * @return the baseBandwidthMiBPerSec value. + */ + public Integer baseBandwidthMiBPerSec() { + return this.baseBandwidthMiBPerSec; + } + + /** + * Get the bandwidthScalar property: The scalar for bandwidth in the file share provisioned bandwidth recommendation + * formula. + * + * @return the bandwidthScalar value. + */ + public Double bandwidthScalar() { + return this.bandwidthScalar; + } + + /** + * 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 FileShareRecommendations from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareRecommendations 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 FileShareRecommendations. + */ + public static FileShareRecommendations fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareRecommendations deserializedFileShareRecommendations = new FileShareRecommendations(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("baseIOPS".equals(fieldName)) { + deserializedFileShareRecommendations.baseIops = reader.getNullable(JsonReader::getInt); + } else if ("ioScalar".equals(fieldName)) { + deserializedFileShareRecommendations.ioScalar = reader.getNullable(JsonReader::getDouble); + } else if ("baseBandwidthMiBPerSec".equals(fieldName)) { + deserializedFileShareRecommendations.baseBandwidthMiBPerSec + = reader.getNullable(JsonReader::getInt); + } else if ("bandwidthScalar".equals(fieldName)) { + deserializedFileShareRecommendations.bandwidthScalar = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareRecommendations; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShares.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShares.java new file mode 100644 index 0000000000000..b0299e2e7bda8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShares.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 FileShares. + */ +public interface FileShares { + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 response schema as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Lists all shares. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional. Specified maximum number of shares that can be included in the list. + * @param filter Optional. When specified, only share names starting with the filter will be listed. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: deleted, + * snapshots. Should be passed as a string with delimiter ','. + * @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 response schema as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, String maxpagesize, String filter, + String expand, Context context); + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: stats. Should + * be passed as a string with delimiter ','. + * @param xMsSnapshot Optional, used to retrieve properties of a snapshot. + * @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 properties of a specified share along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String accountName, String shareName, String expand, + String xMsSnapshot, Context context); + + /** + * Gets properties of a specified share. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 properties of a specified share. + */ + FileShare get(String resourceGroupName, String accountName, String shareName); + + /** + * Deletes specified share under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param xMsSnapshot Optional, used to delete a snapshot. + * @param include Optional. Valid values are: snapshots, leased-snapshots, none. The default value is snapshots. For + * 'snapshots', the file share is deleted including all of its file share snapshots. If the file share contains + * leased-snapshots, the deletion fails. For 'leased-snapshots', the file share is deleted included all of its file + * share snapshots (leased/unleased). For 'none', the file share is deleted if it has no share snapshots. If the + * file share contains any snapshots (leased or unleased), the deletion fails. + * @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 Response}. + */ + Response deleteWithResponse(String resourceGroupName, String accountName, String shareName, + String xMsSnapshot, String include, Context context); + + /** + * Deletes specified share under its account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String shareName); + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param deletedShare The deletedShare parameter. + * @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 Response}. + */ + Response restoreWithResponse(String resourceGroupName, String accountName, String shareName, + DeletedShare deletedShare, Context context); + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param deletedShare The deletedShare parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 restore(String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare); + + /** + * The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @param xMsSnapshot Optional. Specify the snapshot time to lease a snapshot. + * @param parameters Lease Share request body. + * @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 lease Share response schema. + */ + Response leaseWithResponse(String resourceGroupName, String accountName, String shareName, + String xMsSnapshot, LeaseShareRequest parameters, Context context); + + /** + * The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param shareName The name of the file share within the specified storage account. File share names must be + * between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) + * character must be immediately preceded and followed by a letter or number. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 lease Share response schema. + */ + LeaseShareResponse lease(String resourceGroupName, String accountName, String shareName); + + /** + * Gets properties of a specified share. + * + * @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 properties of a specified share along with {@link Response}. + */ + FileShare getById(String id); + + /** + * Gets properties of a specified share. + * + * @param id the resource ID. + * @param expand Optional, used to expand the properties within share's properties. Valid values are: stats. Should + * be passed as a string with delimiter ','. + * @param xMsSnapshot Optional, used to retrieve properties of a snapshot. + * @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 properties of a specified share along with {@link Response}. + */ + Response getByIdWithResponse(String id, String expand, String xMsSnapshot, Context context); + + /** + * Deletes specified share under its account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes specified share under its account. + * + * @param id the resource ID. + * @param xMsSnapshot Optional, used to delete a snapshot. + * @param include Optional. Valid values are: snapshots, leased-snapshots, none. The default value is snapshots. For + * 'snapshots', the file share is deleted including all of its file share snapshots. If the file share contains + * leased-snapshots, the deletion fails. For 'leased-snapshots', the file share is deleted included all of its file + * share snapshots (leased/unleased). For 'none', the file share is deleted if it has no share snapshots. If the + * file share contains any snapshots (leased or unleased), the deletion fails. + * @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 Response}. + */ + Response deleteByIdWithResponse(String id, String xMsSnapshot, String include, Context context); + + /** + * Begins definition for a new FileShare resource. + * + * @param name resource name. + * @return the first stage of the new FileShare definition. + */ + FileShare.DefinitionStages.Blank define(String name); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileSharesLeaseHeaders.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileSharesLeaseHeaders.java new file mode 100644 index 0000000000000..3ef91790792b1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileSharesLeaseHeaders.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; + +/** + * The FileSharesLeaseHeaders model. + */ +@Fluent +public final class FileSharesLeaseHeaders { + /* + * The Etag property. + */ + private String etag; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of FileSharesLeaseHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public FileSharesLeaseHeaders(HttpHeaders rawHeaders) { + this.etag = rawHeaders.getValue(HttpHeaderName.ETAG); + } + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the FileSharesLeaseHeaders object itself. + */ + public FileSharesLeaseHeaders withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileSharesLeaseResponse.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileSharesLeaseResponse.java new file mode 100644 index 0000000000000..f363966ff535b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileSharesLeaseResponse.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storage.generated.fluent.models.LeaseShareResponseInner; + +/** + * Contains all response data for the lease operation. + */ +public final class FileSharesLeaseResponse extends ResponseBase { + /** + * Creates an instance of FileSharesLeaseResponse. + * + * @param request the request which resulted in this FileSharesLeaseResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public FileSharesLeaseResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, + LeaseShareResponseInner value, FileSharesLeaseHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public LeaseShareResponseInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Format.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Format.java new file mode 100644 index 0000000000000..bb38f6b1e478b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Format.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * This is a required field, it specifies the format for the inventory files. + */ +public final class Format extends ExpandableStringEnum { + /** + * Static value Csv for Format. + */ + public static final Format CSV = fromString("Csv"); + + /** + * Static value Parquet for Format. + */ + public static final Format PARQUET = fromString("Parquet"); + + /** + * Creates a new instance of Format value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Format() { + } + + /** + * Creates or finds a Format from its string representation. + * + * @param name a name to look for. + * @return the corresponding Format. + */ + public static Format fromString(String name) { + return fromString(name, Format.class); + } + + /** + * Gets known Format values. + * + * @return known Format values. + */ + public static Collection values() { + return values(Format.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/GeoReplicationStats.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/GeoReplicationStats.java new file mode 100644 index 0000000000000..b53b3634e5608 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/GeoReplicationStats.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +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.time.OffsetDateTime; + +/** + * Statistics related to replication for storage account's Blob, Table, Queue and File services. It is only available + * when geo-redundant replication is enabled for the storage account. + */ +@Immutable +public final class GeoReplicationStats implements JsonSerializable { + /* + * The status of the secondary location. Possible values are: - Live: Indicates that the secondary location is + * active and operational. - Bootstrap: Indicates initial synchronization from the primary location to the secondary + * location is in progress.This typically occurs when replication is first enabled. - Unavailable: Indicates that + * the secondary location is temporarily unavailable. + */ + private GeoReplicationStatus status; + + /* + * All primary writes preceding this UTC date/time value are guaranteed to be available for read operations. Primary + * writes following this point in time may or may not be available for reads. Element may be default value if value + * of LastSyncTime is not available, this can happen if secondary is offline or we are in bootstrap. + */ + private OffsetDateTime lastSyncTime; + + /* + * A boolean flag which indicates whether or not account failover is supported for the account. + */ + private Boolean canFailover; + + /* + * A boolean flag which indicates whether or not planned account failover is supported for the account. + */ + private Boolean canPlannedFailover; + + /* + * The redundancy type of the account after an account failover is performed. + */ + private PostFailoverRedundancy postFailoverRedundancy; + + /* + * The redundancy type of the account after a planned account failover is performed. + */ + private PostPlannedFailoverRedundancy postPlannedFailoverRedundancy; + + /** + * Creates an instance of GeoReplicationStats class. + */ + public GeoReplicationStats() { + } + + /** + * Get the status property: The status of the secondary location. Possible values are: - Live: Indicates that the + * secondary location is active and operational. - Bootstrap: Indicates initial synchronization from the primary + * location to the secondary location is in progress.This typically occurs when replication is first enabled. - + * Unavailable: Indicates that the secondary location is temporarily unavailable. + * + * @return the status value. + */ + public GeoReplicationStatus status() { + return this.status; + } + + /** + * Get the lastSyncTime property: All primary writes preceding this UTC date/time value are guaranteed to be + * available for read operations. Primary writes following this point in time may or may not be available for reads. + * Element may be default value if value of LastSyncTime is not available, this can happen if secondary is offline + * or we are in bootstrap. + * + * @return the lastSyncTime value. + */ + public OffsetDateTime lastSyncTime() { + return this.lastSyncTime; + } + + /** + * Get the canFailover property: A boolean flag which indicates whether or not account failover is supported for the + * account. + * + * @return the canFailover value. + */ + public Boolean canFailover() { + return this.canFailover; + } + + /** + * Get the canPlannedFailover property: A boolean flag which indicates whether or not planned account failover is + * supported for the account. + * + * @return the canPlannedFailover value. + */ + public Boolean canPlannedFailover() { + return this.canPlannedFailover; + } + + /** + * Get the postFailoverRedundancy property: The redundancy type of the account after an account failover is + * performed. + * + * @return the postFailoverRedundancy value. + */ + public PostFailoverRedundancy postFailoverRedundancy() { + return this.postFailoverRedundancy; + } + + /** + * Get the postPlannedFailoverRedundancy property: The redundancy type of the account after a planned account + * failover is performed. + * + * @return the postPlannedFailoverRedundancy value. + */ + public PostPlannedFailoverRedundancy postPlannedFailoverRedundancy() { + return this.postPlannedFailoverRedundancy; + } + + /** + * 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 GeoReplicationStats from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GeoReplicationStats 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 GeoReplicationStats. + */ + public static GeoReplicationStats fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GeoReplicationStats deserializedGeoReplicationStats = new GeoReplicationStats(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedGeoReplicationStats.status = GeoReplicationStatus.fromString(reader.getString()); + } else if ("lastSyncTime".equals(fieldName)) { + deserializedGeoReplicationStats.lastSyncTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("canFailover".equals(fieldName)) { + deserializedGeoReplicationStats.canFailover = reader.getNullable(JsonReader::getBoolean); + } else if ("canPlannedFailover".equals(fieldName)) { + deserializedGeoReplicationStats.canPlannedFailover = reader.getNullable(JsonReader::getBoolean); + } else if ("postFailoverRedundancy".equals(fieldName)) { + deserializedGeoReplicationStats.postFailoverRedundancy + = PostFailoverRedundancy.fromString(reader.getString()); + } else if ("postPlannedFailoverRedundancy".equals(fieldName)) { + deserializedGeoReplicationStats.postPlannedFailoverRedundancy + = PostPlannedFailoverRedundancy.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedGeoReplicationStats; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/GeoReplicationStatus.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/GeoReplicationStatus.java new file mode 100644 index 0000000000000..7befc567f9082 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/GeoReplicationStatus.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The status of the secondary location. Possible values are: - Live: Indicates that the secondary location is active + * and operational. - Bootstrap: Indicates initial synchronization from the primary location to the secondary location + * is in progress.This typically occurs when replication is first enabled. - Unavailable: Indicates that the secondary + * location is temporarily unavailable. + */ +public final class GeoReplicationStatus extends ExpandableStringEnum { + /** + * Static value Live for GeoReplicationStatus. + */ + public static final GeoReplicationStatus LIVE = fromString("Live"); + + /** + * Static value Bootstrap for GeoReplicationStatus. + */ + public static final GeoReplicationStatus BOOTSTRAP = fromString("Bootstrap"); + + /** + * Static value Unavailable for GeoReplicationStatus. + */ + public static final GeoReplicationStatus UNAVAILABLE = fromString("Unavailable"); + + /** + * Creates a new instance of GeoReplicationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GeoReplicationStatus() { + } + + /** + * Creates or finds a GeoReplicationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding GeoReplicationStatus. + */ + public static GeoReplicationStatus fromString(String name) { + return fromString(name, GeoReplicationStatus.class); + } + + /** + * Gets known GeoReplicationStatus values. + * + * @return known GeoReplicationStatus values. + */ + public static Collection values() { + return values(GeoReplicationStatus.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/HttpProtocol.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/HttpProtocol.java new file mode 100644 index 0000000000000..691737fd05991 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/HttpProtocol.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +/** + * The protocol permitted for a request made with the account SAS. + */ +public enum HttpProtocol { + /** + * Enum value https,http. + */ + HTTPS_HTTP("https,http"), + + /** + * Enum value https. + */ + HTTPS("https"); + + /** + * The actual serialized value for a HttpProtocol instance. + */ + private final String value; + + HttpProtocol(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a HttpProtocol instance. + * + * @param value the serialized value to parse. + * @return the parsed HttpProtocol object, or null if unable to parse. + */ + public static HttpProtocol fromString(String value) { + if (value == null) { + return null; + } + HttpProtocol[] items = HttpProtocol.values(); + for (HttpProtocol item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Identity.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Identity.java new file mode 100644 index 0000000000000..dc33ac8417a7c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Identity.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Identity for the resource. + */ +@Fluent +public final class Identity implements JsonSerializable { + /* + * The principal ID of resource identity. + */ + private String principalId; + + /* + * The tenant ID of resource. + */ + private String tenantId; + + /* + * The identity type. + */ + private IdentityType type; + + /* + * Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with + * this storage account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is + * permitted here. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of Identity class. + */ + public Identity() { + } + + /** + * Get the principalId property: The principal ID of resource identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of resource. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The identity type. + * + * @return the type value. + */ + public IdentityType type() { + return this.type; + } + + /** + * Set the type property: The identity type. + * + * @param type the type value to set. + * @return the Identity object itself. + */ + public Identity withType(IdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: Gets or sets a list of key value pairs that describe the set of User + * Assigned identities that will be used with this storage account. The key is the ARM resource identifier of the + * identity. Only 1 User Assigned identity is permitted here. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: Gets or sets a list of key value pairs that describe the set of User + * Assigned identities that will be used with this storage account. The key is the ARM resource identifier of the + * identity. Only 1 User Assigned identity is permitted here. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the Identity object itself. + */ + public Identity 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 Identity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Identity.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 Identity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Identity 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 Identity. + */ + public static Identity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Identity deserializedIdentity = new Identity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedIdentity.type = IdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedIdentity.principalId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedIdentity.tenantId = reader.getString(); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedIdentity; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/IdentityType.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/IdentityType.java new file mode 100644 index 0000000000000..920d12f6fb40f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/IdentityType.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The identity type. + */ +public final class IdentityType extends ExpandableStringEnum { + /** + * Static value None for IdentityType. + */ + public static final IdentityType NONE = fromString("None"); + + /** + * Static value SystemAssigned for IdentityType. + */ + public static final IdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * Static value UserAssigned for IdentityType. + */ + public static final IdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * Static value SystemAssigned,UserAssigned for IdentityType. + */ + public static final IdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = fromString("SystemAssigned,UserAssigned"); + + /** + * Creates a new instance of IdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IdentityType() { + } + + /** + * Creates or finds a IdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IdentityType. + */ + public static IdentityType fromString(String name) { + return fromString(name, IdentityType.class); + } + + /** + * Gets known IdentityType values. + * + * @return known IdentityType values. + */ + public static Collection values() { + return values(IdentityType.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicy.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicy.java new file mode 100644 index 0000000000000..1b327012cccb8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicy.java @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner; + +/** + * An immutable client-side representation of ImmutabilityPolicy. + */ +public interface ImmutabilityPolicy { + /** + * 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 etag property: Resource Etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container + * since the policy creation, in days. + * + * @return the immutabilityPeriodSinceCreationInDays value. + */ + Integer immutabilityPeriodSinceCreationInDays(); + + /** + * Gets the state property: The ImmutabilityPolicy state of a blob container, possible values include: Locked and + * Unlocked. + * + * @return the state value. + */ + ImmutabilityPolicyState state(); + + /** + * Gets the allowProtectedAppendWrites property: This property can only be changed for unlocked time-based retention + * policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and + * compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property + * cannot be changed with ExtendImmutabilityPolicy API. + * + * @return the allowProtectedAppendWrites value. + */ + Boolean allowProtectedAppendWrites(); + + /** + * Gets the allowProtectedAppendWritesAll property: This property can only be changed for unlocked time-based + * retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining + * immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified + * or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' + * and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + * + * @return the allowProtectedAppendWritesAll value. + */ + Boolean allowProtectedAppendWritesAll(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner object. + * + * @return the inner object. + */ + ImmutabilityPolicyInner innerModel(); + + /** + * The entirety of the ImmutabilityPolicy definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The ImmutabilityPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ImmutabilityPolicy definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the ImmutabilityPolicy definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName, containerName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param containerName The name of the blob container within the specified storage account. Blob container + * names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) + * only. Every dash (-) character must be immediately preceded and followed by a letter or number. + * @return the next definition stage. + */ + WithCreate withExistingContainer(String resourceGroupName, String accountName, String containerName); + } + + /** + * The stage of the ImmutabilityPolicy 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.WithImmutabilityPeriodSinceCreationInDays, + DefinitionStages.WithAllowProtectedAppendWrites, DefinitionStages.WithAllowProtectedAppendWritesAll, + DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + ImmutabilityPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ImmutabilityPolicy create(Context context); + } + + /** + * The stage of the ImmutabilityPolicy definition allowing to specify immutabilityPeriodSinceCreationInDays. + */ + interface WithImmutabilityPeriodSinceCreationInDays { + /** + * Specifies the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in + * the container since the policy creation, in days.. + * + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since + * the policy creation, in days. + * @return the next definition stage. + */ + WithCreate withImmutabilityPeriodSinceCreationInDays(Integer immutabilityPeriodSinceCreationInDays); + } + + /** + * The stage of the ImmutabilityPolicy definition allowing to specify allowProtectedAppendWrites. + */ + interface WithAllowProtectedAppendWrites { + /** + * Specifies the allowProtectedAppendWrites property: This property can only be changed for unlocked + * time-based retention policies. When enabled, new blocks can be written to an append blob while + * maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks + * cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API.. + * + * @param allowProtectedAppendWrites This property can only be changed for unlocked time-based retention + * policies. When enabled, new blocks can be written to an append blob while maintaining immutability + * protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or + * deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + * @return the next definition stage. + */ + WithCreate withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites); + } + + /** + * The stage of the ImmutabilityPolicy definition allowing to specify allowProtectedAppendWritesAll. + */ + interface WithAllowProtectedAppendWritesAll { + /** + * Specifies the allowProtectedAppendWritesAll property: This property can only be changed for unlocked + * time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' + * while maintaining immutability protection and compliance. Only new blocks can be added and any existing + * blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + * The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive.. + * + * @param allowProtectedAppendWritesAll This property can only be changed for unlocked time-based retention + * policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining + * immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be + * modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The + * 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + * @return the next definition stage. + */ + WithCreate withAllowProtectedAppendWritesAll(Boolean allowProtectedAppendWritesAll); + } + + /** + * The stage of the ImmutabilityPolicy definition allowing to specify ifMatch. + */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: The entity state (ETag) version of the immutability policy to update must + * be returned to the server for all update operations. The ETag value must include the leading and trailing + * double quotes as returned by the service.. + * + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to + * the server for all update operations. The ETag value must include the leading and trailing double quotes + * as returned by the service. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + + /** + * Begins update for the ImmutabilityPolicy resource. + * + * @return the stage of resource update. + */ + ImmutabilityPolicy.Update update(); + + /** + * The template for ImmutabilityPolicy update. + */ + interface Update + extends UpdateStages.WithImmutabilityPeriodSinceCreationInDays, UpdateStages.WithAllowProtectedAppendWrites, + UpdateStages.WithAllowProtectedAppendWritesAll, UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ImmutabilityPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ImmutabilityPolicy apply(Context context); + } + + /** + * The ImmutabilityPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the ImmutabilityPolicy update allowing to specify immutabilityPeriodSinceCreationInDays. + */ + interface WithImmutabilityPeriodSinceCreationInDays { + /** + * Specifies the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in + * the container since the policy creation, in days.. + * + * @param immutabilityPeriodSinceCreationInDays The immutability period for the blobs in the container since + * the policy creation, in days. + * @return the next definition stage. + */ + Update withImmutabilityPeriodSinceCreationInDays(Integer immutabilityPeriodSinceCreationInDays); + } + + /** + * The stage of the ImmutabilityPolicy update allowing to specify allowProtectedAppendWrites. + */ + interface WithAllowProtectedAppendWrites { + /** + * Specifies the allowProtectedAppendWrites property: This property can only be changed for unlocked + * time-based retention policies. When enabled, new blocks can be written to an append blob while + * maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks + * cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API.. + * + * @param allowProtectedAppendWrites This property can only be changed for unlocked time-based retention + * policies. When enabled, new blocks can be written to an append blob while maintaining immutability + * protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or + * deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + * @return the next definition stage. + */ + Update withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites); + } + + /** + * The stage of the ImmutabilityPolicy update allowing to specify allowProtectedAppendWritesAll. + */ + interface WithAllowProtectedAppendWritesAll { + /** + * Specifies the allowProtectedAppendWritesAll property: This property can only be changed for unlocked + * time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' + * while maintaining immutability protection and compliance. Only new blocks can be added and any existing + * blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + * The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive.. + * + * @param allowProtectedAppendWritesAll This property can only be changed for unlocked time-based retention + * policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining + * immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be + * modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The + * 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + * @return the next definition stage. + */ + Update withAllowProtectedAppendWritesAll(Boolean allowProtectedAppendWritesAll); + } + + /** + * The stage of the ImmutabilityPolicy update allowing to specify ifMatch. + */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: The entity state (ETag) version of the immutability policy to update must + * be returned to the server for all update operations. The ETag value must include the leading and trailing + * double quotes as returned by the service.. + * + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to + * the server for all update operations. The ETag value must include the leading and trailing double quotes + * as returned by the service. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ImmutabilityPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ImmutabilityPolicy refresh(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicyProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicyProperties.java new file mode 100644 index 0000000000000..a1b49d595e8b3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicyProperties.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyProperty; +import java.io.IOException; +import java.util.List; + +/** + * The properties of an ImmutabilityPolicy of a blob container. + */ +@Fluent +public final class ImmutabilityPolicyProperties implements JsonSerializable { + /* + * The properties of an ImmutabilityPolicy of a blob container. + */ + private ImmutabilityPolicyProperty innerProperties; + + /* + * ImmutabilityPolicy Etag. + */ + private String etag; + + /* + * The ImmutabilityPolicy update history of the blob container. + */ + private List updateHistory; + + /** + * Creates an instance of ImmutabilityPolicyProperties class. + */ + public ImmutabilityPolicyProperties() { + } + + /** + * Get the innerProperties property: The properties of an ImmutabilityPolicy of a blob container. + * + * @return the innerProperties value. + */ + private ImmutabilityPolicyProperty innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: ImmutabilityPolicy Etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the updateHistory property: The ImmutabilityPolicy update history of the blob container. + * + * @return the updateHistory value. + */ + public List updateHistory() { + return this.updateHistory; + } + + /** + * Get the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container + * since the policy creation, in days. + * + * @return the immutabilityPeriodSinceCreationInDays value. + */ + public Integer immutabilityPeriodSinceCreationInDays() { + return this.innerProperties() == null ? null : this.innerProperties().immutabilityPeriodSinceCreationInDays(); + } + + /** + * Set the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container + * since the policy creation, in days. + * + * @param immutabilityPeriodSinceCreationInDays the immutabilityPeriodSinceCreationInDays value to set. + * @return the ImmutabilityPolicyProperties object itself. + */ + public ImmutabilityPolicyProperties + withImmutabilityPeriodSinceCreationInDays(Integer immutabilityPeriodSinceCreationInDays) { + if (this.innerProperties() == null) { + this.innerProperties = new ImmutabilityPolicyProperty(); + } + this.innerProperties().withImmutabilityPeriodSinceCreationInDays(immutabilityPeriodSinceCreationInDays); + return this; + } + + /** + * Get the state property: The ImmutabilityPolicy state of a blob container, possible values include: Locked and + * Unlocked. + * + * @return the state value. + */ + public ImmutabilityPolicyState state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Get the allowProtectedAppendWrites property: This property can only be changed for unlocked time-based retention + * policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and + * compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property + * cannot be changed with ExtendImmutabilityPolicy API. + * + * @return the allowProtectedAppendWrites value. + */ + public Boolean allowProtectedAppendWrites() { + return this.innerProperties() == null ? null : this.innerProperties().allowProtectedAppendWrites(); + } + + /** + * Set the allowProtectedAppendWrites property: This property can only be changed for unlocked time-based retention + * policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and + * compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property + * cannot be changed with ExtendImmutabilityPolicy API. + * + * @param allowProtectedAppendWrites the allowProtectedAppendWrites value to set. + * @return the ImmutabilityPolicyProperties object itself. + */ + public ImmutabilityPolicyProperties withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites) { + if (this.innerProperties() == null) { + this.innerProperties = new ImmutabilityPolicyProperty(); + } + this.innerProperties().withAllowProtectedAppendWrites(allowProtectedAppendWrites); + return this; + } + + /** + * Get the allowProtectedAppendWritesAll property: This property can only be changed for unlocked time-based + * retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining + * immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified + * or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' + * and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + * + * @return the allowProtectedAppendWritesAll value. + */ + public Boolean allowProtectedAppendWritesAll() { + return this.innerProperties() == null ? null : this.innerProperties().allowProtectedAppendWritesAll(); + } + + /** + * Set the allowProtectedAppendWritesAll property: This property can only be changed for unlocked time-based + * retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining + * immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified + * or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' + * and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + * + * @param allowProtectedAppendWritesAll the allowProtectedAppendWritesAll value to set. + * @return the ImmutabilityPolicyProperties object itself. + */ + public ImmutabilityPolicyProperties withAllowProtectedAppendWritesAll(Boolean allowProtectedAppendWritesAll) { + if (this.innerProperties() == null) { + this.innerProperties = new ImmutabilityPolicyProperty(); + } + this.innerProperties().withAllowProtectedAppendWritesAll(allowProtectedAppendWritesAll); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (updateHistory() != null) { + updateHistory().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImmutabilityPolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImmutabilityPolicyProperties 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 ImmutabilityPolicyProperties. + */ + public static ImmutabilityPolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImmutabilityPolicyProperties deserializedImmutabilityPolicyProperties = new ImmutabilityPolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedImmutabilityPolicyProperties.innerProperties + = ImmutabilityPolicyProperty.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedImmutabilityPolicyProperties.etag = reader.getString(); + } else if ("updateHistory".equals(fieldName)) { + List updateHistory + = reader.readArray(reader1 -> UpdateHistoryProperty.fromJson(reader1)); + deserializedImmutabilityPolicyProperties.updateHistory = updateHistory; + } else { + reader.skipChildren(); + } + } + + return deserializedImmutabilityPolicyProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicyState.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicyState.java new file mode 100644 index 0000000000000..d989c30369fe0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicyState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. + */ +public final class ImmutabilityPolicyState extends ExpandableStringEnum { + /** + * Static value Locked for ImmutabilityPolicyState. + */ + public static final ImmutabilityPolicyState LOCKED = fromString("Locked"); + + /** + * Static value Unlocked for ImmutabilityPolicyState. + */ + public static final ImmutabilityPolicyState UNLOCKED = fromString("Unlocked"); + + /** + * Creates a new instance of ImmutabilityPolicyState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ImmutabilityPolicyState() { + } + + /** + * Creates or finds a ImmutabilityPolicyState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImmutabilityPolicyState. + */ + public static ImmutabilityPolicyState fromString(String name) { + return fromString(name, ImmutabilityPolicyState.class); + } + + /** + * Gets known ImmutabilityPolicyState values. + * + * @return known ImmutabilityPolicyState values. + */ + public static Collection values() { + return values(ImmutabilityPolicyState.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicyUpdateType.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicyUpdateType.java new file mode 100644 index 0000000000000..2119a8e0fe98c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicyUpdateType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The ImmutabilityPolicy update type of a blob container, possible values include: put, lock and extend. + */ +public final class ImmutabilityPolicyUpdateType extends ExpandableStringEnum { + /** + * Static value put for ImmutabilityPolicyUpdateType. + */ + public static final ImmutabilityPolicyUpdateType PUT = fromString("put"); + + /** + * Static value lock for ImmutabilityPolicyUpdateType. + */ + public static final ImmutabilityPolicyUpdateType LOCK = fromString("lock"); + + /** + * Static value extend for ImmutabilityPolicyUpdateType. + */ + public static final ImmutabilityPolicyUpdateType EXTEND = fromString("extend"); + + /** + * Creates a new instance of ImmutabilityPolicyUpdateType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ImmutabilityPolicyUpdateType() { + } + + /** + * Creates or finds a ImmutabilityPolicyUpdateType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImmutabilityPolicyUpdateType. + */ + public static ImmutabilityPolicyUpdateType fromString(String name) { + return fromString(name, ImmutabilityPolicyUpdateType.class); + } + + /** + * Gets known ImmutabilityPolicyUpdateType values. + * + * @return known ImmutabilityPolicyUpdateType values. + */ + public static Collection values() { + return values(ImmutabilityPolicyUpdateType.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutableStorageAccount.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutableStorageAccount.java new file mode 100644 index 0000000000000..c2fe5cbbd8e9c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutableStorageAccount.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * This property enables and defines account-level immutability. Enabling the feature auto-enables Blob Versioning. + */ +@Fluent +public final class ImmutableStorageAccount implements JsonSerializable { + /* + * A boolean flag which enables account-level immutability. All the containers under such an account have + * object-level immutability enabled by default. + */ + private Boolean enabled; + + /* + * Specifies the default account-level immutability policy which is inherited and applied to objects that do not + * possess an explicit immutability policy at the object level. The object-level immutability policy has higher + * precedence than the container-level immutability policy, which has a higher precedence than the account-level + * immutability policy. + */ + private AccountImmutabilityPolicyProperties immutabilityPolicy; + + /** + * Creates an instance of ImmutableStorageAccount class. + */ + public ImmutableStorageAccount() { + } + + /** + * Get the enabled property: A boolean flag which enables account-level immutability. All the containers under such + * an account have object-level immutability enabled by default. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: A boolean flag which enables account-level immutability. All the containers under such + * an account have object-level immutability enabled by default. + * + * @param enabled the enabled value to set. + * @return the ImmutableStorageAccount object itself. + */ + public ImmutableStorageAccount withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the immutabilityPolicy property: Specifies the default account-level immutability policy which is inherited + * and applied to objects that do not possess an explicit immutability policy at the object level. The object-level + * immutability policy has higher precedence than the container-level immutability policy, which has a higher + * precedence than the account-level immutability policy. + * + * @return the immutabilityPolicy value. + */ + public AccountImmutabilityPolicyProperties immutabilityPolicy() { + return this.immutabilityPolicy; + } + + /** + * Set the immutabilityPolicy property: Specifies the default account-level immutability policy which is inherited + * and applied to objects that do not possess an explicit immutability policy at the object level. The object-level + * immutability policy has higher precedence than the container-level immutability policy, which has a higher + * precedence than the account-level immutability policy. + * + * @param immutabilityPolicy the immutabilityPolicy value to set. + * @return the ImmutableStorageAccount object itself. + */ + public ImmutableStorageAccount withImmutabilityPolicy(AccountImmutabilityPolicyProperties immutabilityPolicy) { + this.immutabilityPolicy = immutabilityPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (immutabilityPolicy() != null) { + immutabilityPolicy().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeJsonField("immutabilityPolicy", this.immutabilityPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImmutableStorageAccount from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImmutableStorageAccount 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 ImmutableStorageAccount. + */ + public static ImmutableStorageAccount fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImmutableStorageAccount deserializedImmutableStorageAccount = new ImmutableStorageAccount(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedImmutableStorageAccount.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("immutabilityPolicy".equals(fieldName)) { + deserializedImmutableStorageAccount.immutabilityPolicy + = AccountImmutabilityPolicyProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedImmutableStorageAccount; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutableStorageWithVersioning.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutableStorageWithVersioning.java new file mode 100644 index 0000000000000..dc1f13f9c56e8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutableStorageWithVersioning.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +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.time.OffsetDateTime; + +/** + * Object level immutability properties of the container. + */ +@Fluent +public final class ImmutableStorageWithVersioning implements JsonSerializable { + /* + * This is an immutable property, when set to true it enables object level immutability at the container level. + */ + private Boolean enabled; + + /* + * Returns the date and time the object level immutability was enabled. + */ + private OffsetDateTime timestamp; + + /* + * This property denotes the container level immutability to object level immutability migration state. + */ + private MigrationState migrationState; + + /** + * Creates an instance of ImmutableStorageWithVersioning class. + */ + public ImmutableStorageWithVersioning() { + } + + /** + * Get the enabled property: This is an immutable property, when set to true it enables object level immutability at + * the container level. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: This is an immutable property, when set to true it enables object level immutability at + * the container level. + * + * @param enabled the enabled value to set. + * @return the ImmutableStorageWithVersioning object itself. + */ + public ImmutableStorageWithVersioning withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the timestamp property: Returns the date and time the object level immutability was enabled. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Get the migrationState property: This property denotes the container level immutability to object level + * immutability migration state. + * + * @return the migrationState value. + */ + public MigrationState migrationState() { + return this.migrationState; + } + + /** + * 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.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImmutableStorageWithVersioning from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImmutableStorageWithVersioning 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 ImmutableStorageWithVersioning. + */ + public static ImmutableStorageWithVersioning fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImmutableStorageWithVersioning deserializedImmutableStorageWithVersioning + = new ImmutableStorageWithVersioning(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedImmutableStorageWithVersioning.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("timeStamp".equals(fieldName)) { + deserializedImmutableStorageWithVersioning.timestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("migrationState".equals(fieldName)) { + deserializedImmutableStorageWithVersioning.migrationState + = MigrationState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedImmutableStorageWithVersioning; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/IntervalUnit.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/IntervalUnit.java new file mode 100644 index 0000000000000..8613117c47166 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/IntervalUnit.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +/** + * Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; + * this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'. + */ +public enum IntervalUnit { + /** + * Enum value Days. + */ + DAYS("Days"); + + /** + * The actual serialized value for a IntervalUnit instance. + */ + private final String value; + + IntervalUnit(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a IntervalUnit instance. + * + * @param value the serialized value to parse. + * @return the parsed IntervalUnit object, or null if unable to parse. + */ + public static IntervalUnit fromString(String value) { + if (value == null) { + return null; + } + IntervalUnit[] items = IntervalUnit.values(); + for (IntervalUnit item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/InventoryRuleType.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/InventoryRuleType.java new file mode 100644 index 0000000000000..19c6add191ff3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/InventoryRuleType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The valid value is Inventory. + */ +public final class InventoryRuleType extends ExpandableStringEnum { + /** + * Static value Inventory for InventoryRuleType. + */ + public static final InventoryRuleType INVENTORY = fromString("Inventory"); + + /** + * Creates a new instance of InventoryRuleType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InventoryRuleType() { + } + + /** + * Creates or finds a InventoryRuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding InventoryRuleType. + */ + public static InventoryRuleType fromString(String name) { + return fromString(name, InventoryRuleType.class); + } + + /** + * Gets known InventoryRuleType values. + * + * @return known InventoryRuleType values. + */ + public static Collection values() { + return values(InventoryRuleType.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/IpRule.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/IpRule.java new file mode 100644 index 0000000000000..0c37134081eec --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/IpRule.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * IP rule with specific IP or IP range in CIDR format. + */ +@Fluent +public final class IpRule implements JsonSerializable { + /* + * Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + */ + private String ipAddressOrRange; + + /* + * The action of IP ACL rule. + */ + private Action action; + + /** + * Creates an instance of IpRule class. + */ + public IpRule() { + } + + /** + * Get the ipAddressOrRange property: Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + * + * @return the ipAddressOrRange value. + */ + public String ipAddressOrRange() { + return this.ipAddressOrRange; + } + + /** + * Set the ipAddressOrRange property: Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + * + * @param ipAddressOrRange the ipAddressOrRange value to set. + * @return the IpRule object itself. + */ + public IpRule withIpAddressOrRange(String ipAddressOrRange) { + this.ipAddressOrRange = ipAddressOrRange; + return this; + } + + /** + * Get the action property: The action of IP ACL rule. + * + * @return the action value. + */ + public Action action() { + return this.action; + } + + /** + * Set the action property: The action of IP ACL rule. + * + * @param action the action value to set. + * @return the IpRule object itself. + */ + public IpRule withAction(Action action) { + this.action = action; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipAddressOrRange() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property ipAddressOrRange in model IpRule")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IpRule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.ipAddressOrRange); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpRule 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 IpRule. + */ + public static IpRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpRule deserializedIpRule = new IpRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedIpRule.ipAddressOrRange = reader.getString(); + } else if ("action".equals(fieldName)) { + deserializedIpRule.action = Action.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIpRule; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/IssueType.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/IssueType.java new file mode 100644 index 0000000000000..8b0a0131447d2 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/IssueType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of issue. + */ +public final class IssueType extends ExpandableStringEnum { + /** + * Static value Unknown for IssueType. + */ + public static final IssueType UNKNOWN = fromString("Unknown"); + + /** + * Static value ConfigurationPropagationFailure for IssueType. + */ + public static final IssueType CONFIGURATION_PROPAGATION_FAILURE = fromString("ConfigurationPropagationFailure"); + + /** + * Creates a new instance of IssueType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IssueType() { + } + + /** + * Creates or finds a IssueType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IssueType. + */ + public static IssueType fromString(String name) { + return fromString(name, IssueType.class); + } + + /** + * Gets known IssueType values. + * + * @return known IssueType values. + */ + public static Collection values() { + return values(IssueType.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyCreationTime.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyCreationTime.java new file mode 100644 index 0000000000000..b61c7fd873a49 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyCreationTime.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +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.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Storage account keys creation time. + */ +@Fluent +public final class KeyCreationTime implements JsonSerializable { + /* + * The key1 property. + */ + private OffsetDateTime key1; + + /* + * The key2 property. + */ + private OffsetDateTime key2; + + /** + * Creates an instance of KeyCreationTime class. + */ + public KeyCreationTime() { + } + + /** + * Get the key1 property: The key1 property. + * + * @return the key1 value. + */ + public OffsetDateTime key1() { + return this.key1; + } + + /** + * Set the key1 property: The key1 property. + * + * @param key1 the key1 value to set. + * @return the KeyCreationTime object itself. + */ + public KeyCreationTime withKey1(OffsetDateTime key1) { + this.key1 = key1; + return this; + } + + /** + * Get the key2 property: The key2 property. + * + * @return the key2 value. + */ + public OffsetDateTime key2() { + return this.key2; + } + + /** + * Set the key2 property: The key2 property. + * + * @param key2 the key2 value to set. + * @return the KeyCreationTime object itself. + */ + public KeyCreationTime withKey2(OffsetDateTime key2) { + this.key2 = key2; + 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("key1", + this.key1 == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.key1)); + jsonWriter.writeStringField("key2", + this.key2 == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.key2)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyCreationTime from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyCreationTime 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 KeyCreationTime. + */ + public static KeyCreationTime fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyCreationTime deserializedKeyCreationTime = new KeyCreationTime(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key1".equals(fieldName)) { + deserializedKeyCreationTime.key1 = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("key2".equals(fieldName)) { + deserializedKeyCreationTime.key2 = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyCreationTime; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyPermission.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyPermission.java new file mode 100644 index 0000000000000..0db5ec3955774 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyPermission.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +/** + * Permissions for the key -- read-only or full permissions. + */ +public enum KeyPermission { + /** + * Enum value Read. + */ + READ("Read"), + + /** + * Enum value Full. + */ + FULL("Full"); + + /** + * The actual serialized value for a KeyPermission instance. + */ + private final String value; + + KeyPermission(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a KeyPermission instance. + * + * @param value the serialized value to parse. + * @return the parsed KeyPermission object, or null if unable to parse. + */ + public static KeyPermission fromString(String value) { + if (value == null) { + return null; + } + KeyPermission[] items = KeyPermission.values(); + for (KeyPermission item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyPolicy.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyPolicy.java new file mode 100644 index 0000000000000..ced57ebb71311 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyPolicy.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * KeyPolicy assigned to the storage account. + */ +@Fluent +public final class KeyPolicy implements JsonSerializable { + /* + * The key expiration period in days. + */ + private int keyExpirationPeriodInDays; + + /** + * Creates an instance of KeyPolicy class. + */ + public KeyPolicy() { + } + + /** + * Get the keyExpirationPeriodInDays property: The key expiration period in days. + * + * @return the keyExpirationPeriodInDays value. + */ + public int keyExpirationPeriodInDays() { + return this.keyExpirationPeriodInDays; + } + + /** + * Set the keyExpirationPeriodInDays property: The key expiration period in days. + * + * @param keyExpirationPeriodInDays the keyExpirationPeriodInDays value to set. + * @return the KeyPolicy object itself. + */ + public KeyPolicy withKeyExpirationPeriodInDays(int keyExpirationPeriodInDays) { + this.keyExpirationPeriodInDays = keyExpirationPeriodInDays; + 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.writeIntField("keyExpirationPeriodInDays", this.keyExpirationPeriodInDays); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyPolicy 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 KeyPolicy. + */ + public static KeyPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyPolicy deserializedKeyPolicy = new KeyPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyExpirationPeriodInDays".equals(fieldName)) { + deserializedKeyPolicy.keyExpirationPeriodInDays = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyPolicy; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeySource.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeySource.java new file mode 100644 index 0000000000000..427c2adf1f54c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeySource.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + */ +public final class KeySource extends ExpandableStringEnum { + /** + * Static value Microsoft.Storage for KeySource. + */ + public static final KeySource MICROSOFT_STORAGE = fromString("Microsoft.Storage"); + + /** + * Static value Microsoft.Keyvault for KeySource. + */ + public static final KeySource MICROSOFT_KEYVAULT = fromString("Microsoft.Keyvault"); + + /** + * Creates a new instance of KeySource value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KeySource() { + } + + /** + * Creates or finds a KeySource from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeySource. + */ + public static KeySource fromString(String name) { + return fromString(name, KeySource.class); + } + + /** + * Gets known KeySource values. + * + * @return known KeySource values. + */ + public static Collection values() { + return values(KeySource.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyType.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyType.java new file mode 100644 index 0000000000000..c6694c42d27f2 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyType.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped + * encryption key will be used. 'Service' key type implies that a default service key is used. + */ +public final class KeyType extends ExpandableStringEnum { + /** + * Static value Service for KeyType. + */ + public static final KeyType SERVICE = fromString("Service"); + + /** + * Static value Account for KeyType. + */ + public static final KeyType ACCOUNT = fromString("Account"); + + /** + * Creates a new instance of KeyType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KeyType() { + } + + /** + * Creates or finds a KeyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeyType. + */ + public static KeyType fromString(String name) { + return fromString(name, KeyType.class); + } + + /** + * Gets known KeyType values. + * + * @return known KeyType values. + */ + public static Collection values() { + return values(KeyType.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyVaultProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyVaultProperties.java new file mode 100644 index 0000000000000..41295897743e8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyVaultProperties.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +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.time.OffsetDateTime; + +/** + * Properties of key vault. + */ +@Fluent +public final class KeyVaultProperties implements JsonSerializable { + /* + * The name of KeyVault key. + */ + private String keyName; + + /* + * The version of KeyVault key. + */ + private String keyVersion; + + /* + * The Uri of KeyVault. + */ + private String keyVaultUri; + + /* + * The object identifier of the current versioned Key Vault Key in use. + */ + private String currentVersionedKeyIdentifier; + + /* + * Timestamp of last rotation of the Key Vault Key. + */ + private OffsetDateTime lastKeyRotationTimestamp; + + /* + * This is a read only property that represents the expiration time of the current version of the customer managed + * key used for encryption. + */ + private OffsetDateTime currentVersionedKeyExpirationTimestamp; + + /** + * Creates an instance of KeyVaultProperties class. + */ + public KeyVaultProperties() { + } + + /** + * Get the keyName property: The name of KeyVault key. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the keyName property: The name of KeyVault key. + * + * @param keyName the keyName value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the keyVersion property: The version of KeyVault key. + * + * @return the keyVersion value. + */ + public String keyVersion() { + return this.keyVersion; + } + + /** + * Set the keyVersion property: The version of KeyVault key. + * + * @param keyVersion the keyVersion value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVersion(String keyVersion) { + this.keyVersion = keyVersion; + return this; + } + + /** + * Get the keyVaultUri property: The Uri of KeyVault. + * + * @return the keyVaultUri value. + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set the keyVaultUri property: The Uri of KeyVault. + * + * @param keyVaultUri the keyVaultUri value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVaultUri(String keyVaultUri) { + this.keyVaultUri = keyVaultUri; + return this; + } + + /** + * Get the currentVersionedKeyIdentifier property: The object identifier of the current versioned Key Vault Key in + * use. + * + * @return the currentVersionedKeyIdentifier value. + */ + public String currentVersionedKeyIdentifier() { + return this.currentVersionedKeyIdentifier; + } + + /** + * Get the lastKeyRotationTimestamp property: Timestamp of last rotation of the Key Vault Key. + * + * @return the lastKeyRotationTimestamp value. + */ + public OffsetDateTime lastKeyRotationTimestamp() { + return this.lastKeyRotationTimestamp; + } + + /** + * Get the currentVersionedKeyExpirationTimestamp property: This is a read only property that represents the + * expiration time of the current version of the customer managed key used for encryption. + * + * @return the currentVersionedKeyExpirationTimestamp value. + */ + public OffsetDateTime currentVersionedKeyExpirationTimestamp() { + return this.currentVersionedKeyExpirationTimestamp; + } + + /** + * 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("keyname", this.keyName); + jsonWriter.writeStringField("keyversion", this.keyVersion); + jsonWriter.writeStringField("keyvaulturi", this.keyVaultUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyVaultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyVaultProperties 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 KeyVaultProperties. + */ + public static KeyVaultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyVaultProperties deserializedKeyVaultProperties = new KeyVaultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyname".equals(fieldName)) { + deserializedKeyVaultProperties.keyName = reader.getString(); + } else if ("keyversion".equals(fieldName)) { + deserializedKeyVaultProperties.keyVersion = reader.getString(); + } else if ("keyvaulturi".equals(fieldName)) { + deserializedKeyVaultProperties.keyVaultUri = reader.getString(); + } else if ("currentVersionedKeyIdentifier".equals(fieldName)) { + deserializedKeyVaultProperties.currentVersionedKeyIdentifier = reader.getString(); + } else if ("lastKeyRotationTimestamp".equals(fieldName)) { + deserializedKeyVaultProperties.lastKeyRotationTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("currentVersionedKeyExpirationTimestamp".equals(fieldName)) { + deserializedKeyVaultProperties.currentVersionedKeyExpirationTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyVaultProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Kind.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Kind.java new file mode 100644 index 0000000000000..b23a902027726 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Kind.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Indicates the type of storage account. + */ +public final class Kind extends ExpandableStringEnum { + /** + * Static value Storage for Kind. + */ + public static final Kind STORAGE = fromString("Storage"); + + /** + * Static value StorageV2 for Kind. + */ + public static final Kind STORAGE_V2 = fromString("StorageV2"); + + /** + * Static value BlobStorage for Kind. + */ + public static final Kind BLOB_STORAGE = fromString("BlobStorage"); + + /** + * Static value FileStorage for Kind. + */ + public static final Kind FILE_STORAGE = fromString("FileStorage"); + + /** + * Static value BlockBlobStorage for Kind. + */ + public static final Kind BLOCK_BLOB_STORAGE = fromString("BlockBlobStorage"); + + /** + * Creates a new instance of Kind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Kind() { + } + + /** + * Creates or finds a Kind from its string representation. + * + * @param name a name to look for. + * @return the corresponding Kind. + */ + public static Kind fromString(String name) { + return fromString(name, Kind.class); + } + + /** + * Gets known Kind values. + * + * @return known Kind values. + */ + public static Collection values() { + return values(Kind.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LargeFileSharesState.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LargeFileSharesState.java new file mode 100644 index 0000000000000..11cb05bfe8302 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LargeFileSharesState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + */ +public final class LargeFileSharesState extends ExpandableStringEnum { + /** + * Static value Disabled for LargeFileSharesState. + */ + public static final LargeFileSharesState DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for LargeFileSharesState. + */ + public static final LargeFileSharesState ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of LargeFileSharesState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LargeFileSharesState() { + } + + /** + * Creates or finds a LargeFileSharesState from its string representation. + * + * @param name a name to look for. + * @return the corresponding LargeFileSharesState. + */ + public static LargeFileSharesState fromString(String name) { + return fromString(name, LargeFileSharesState.class); + } + + /** + * Gets known LargeFileSharesState values. + * + * @return known LargeFileSharesState values. + */ + public static Collection values() { + return values(LargeFileSharesState.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LastAccessTimeTrackingPolicy.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LastAccessTimeTrackingPolicy.java new file mode 100644 index 0000000000000..836be03e641d1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LastAccessTimeTrackingPolicy.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.List; + +/** + * The blob service properties for Last access time based tracking policy. + */ +@Fluent +public final class LastAccessTimeTrackingPolicy implements JsonSerializable { + /* + * When set to true last access time based tracking is enabled. + */ + private boolean enable; + + /* + * Name of the policy. The valid value is AccessTimeTracking. This field is currently read only + */ + private Name name; + + /* + * The field specifies blob object tracking granularity in days, typically how often the blob object should be + * tracked.This field is currently read only with value as 1 + */ + private Integer trackingGranularityInDays; + + /* + * An array of predefined supported blob types. Only blockBlob is the supported value. This field is currently read + * only + */ + private List blobType; + + /** + * Creates an instance of LastAccessTimeTrackingPolicy class. + */ + public LastAccessTimeTrackingPolicy() { + } + + /** + * Get the enable property: When set to true last access time based tracking is enabled. + * + * @return the enable value. + */ + public boolean enable() { + return this.enable; + } + + /** + * Set the enable property: When set to true last access time based tracking is enabled. + * + * @param enable the enable value to set. + * @return the LastAccessTimeTrackingPolicy object itself. + */ + public LastAccessTimeTrackingPolicy withEnable(boolean enable) { + this.enable = enable; + return this; + } + + /** + * Get the name property: Name of the policy. The valid value is AccessTimeTracking. This field is currently read + * only. + * + * @return the name value. + */ + public Name name() { + return this.name; + } + + /** + * Set the name property: Name of the policy. The valid value is AccessTimeTracking. This field is currently read + * only. + * + * @param name the name value to set. + * @return the LastAccessTimeTrackingPolicy object itself. + */ + public LastAccessTimeTrackingPolicy withName(Name name) { + this.name = name; + return this; + } + + /** + * Get the trackingGranularityInDays property: The field specifies blob object tracking granularity in days, + * typically how often the blob object should be tracked.This field is currently read only with value as 1. + * + * @return the trackingGranularityInDays value. + */ + public Integer trackingGranularityInDays() { + return this.trackingGranularityInDays; + } + + /** + * Set the trackingGranularityInDays property: The field specifies blob object tracking granularity in days, + * typically how often the blob object should be tracked.This field is currently read only with value as 1. + * + * @param trackingGranularityInDays the trackingGranularityInDays value to set. + * @return the LastAccessTimeTrackingPolicy object itself. + */ + public LastAccessTimeTrackingPolicy withTrackingGranularityInDays(Integer trackingGranularityInDays) { + this.trackingGranularityInDays = trackingGranularityInDays; + return this; + } + + /** + * Get the blobType property: An array of predefined supported blob types. Only blockBlob is the supported value. + * This field is currently read only. + * + * @return the blobType value. + */ + public List blobType() { + return this.blobType; + } + + /** + * Set the blobType property: An array of predefined supported blob types. Only blockBlob is the supported value. + * This field is currently read only. + * + * @param blobType the blobType value to set. + * @return the LastAccessTimeTrackingPolicy object itself. + */ + public LastAccessTimeTrackingPolicy withBlobType(List blobType) { + this.blobType = blobType; + 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.writeBooleanField("enable", this.enable); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + jsonWriter.writeNumberField("trackingGranularityInDays", this.trackingGranularityInDays); + jsonWriter.writeArrayField("blobType", this.blobType, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LastAccessTimeTrackingPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LastAccessTimeTrackingPolicy 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 LastAccessTimeTrackingPolicy. + */ + public static LastAccessTimeTrackingPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LastAccessTimeTrackingPolicy deserializedLastAccessTimeTrackingPolicy = new LastAccessTimeTrackingPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enable".equals(fieldName)) { + deserializedLastAccessTimeTrackingPolicy.enable = reader.getBoolean(); + } else if ("name".equals(fieldName)) { + deserializedLastAccessTimeTrackingPolicy.name = Name.fromString(reader.getString()); + } else if ("trackingGranularityInDays".equals(fieldName)) { + deserializedLastAccessTimeTrackingPolicy.trackingGranularityInDays + = reader.getNullable(JsonReader::getInt); + } else if ("blobType".equals(fieldName)) { + List blobType = reader.readArray(reader1 -> reader1.getString()); + deserializedLastAccessTimeTrackingPolicy.blobType = blobType; + } else { + reader.skipChildren(); + } + } + + return deserializedLastAccessTimeTrackingPolicy; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseContainerRequest.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseContainerRequest.java new file mode 100644 index 0000000000000..ee84609190c42 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseContainerRequest.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Lease Container request schema. + */ +@Fluent +public final class LeaseContainerRequest implements JsonSerializable { + /* + * Specifies the lease action. Can be one of the available actions. + */ + private LeaseContainerRequestAction action; + + /* + * Identifies the lease. Can be specified in any valid GUID string format. + */ + private String leaseId; + + /* + * Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, + * between 0 and 60. + */ + private Integer breakPeriod; + + /* + * Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that + * never expires. + */ + private Integer leaseDuration; + + /* + * Optional for acquire, required for change. Proposed lease ID, in a GUID string format. + */ + private String proposedLeaseId; + + /** + * Creates an instance of LeaseContainerRequest class. + */ + public LeaseContainerRequest() { + } + + /** + * Get the action property: Specifies the lease action. Can be one of the available actions. + * + * @return the action value. + */ + public LeaseContainerRequestAction action() { + return this.action; + } + + /** + * Set the action property: Specifies the lease action. Can be one of the available actions. + * + * @param action the action value to set. + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withAction(LeaseContainerRequestAction action) { + this.action = action; + return this; + } + + /** + * Get the leaseId property: Identifies the lease. Can be specified in any valid GUID string format. + * + * @return the leaseId value. + */ + public String leaseId() { + return this.leaseId; + } + + /** + * Set the leaseId property: Identifies the lease. Can be specified in any valid GUID string format. + * + * @param leaseId the leaseId value to set. + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withLeaseId(String leaseId) { + this.leaseId = leaseId; + return this; + } + + /** + * Get the breakPeriod property: Optional. For a break action, proposed duration the lease should continue before it + * is broken, in seconds, between 0 and 60. + * + * @return the breakPeriod value. + */ + public Integer breakPeriod() { + return this.breakPeriod; + } + + /** + * Set the breakPeriod property: Optional. For a break action, proposed duration the lease should continue before it + * is broken, in seconds, between 0 and 60. + * + * @param breakPeriod the breakPeriod value to set. + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withBreakPeriod(Integer breakPeriod) { + this.breakPeriod = breakPeriod; + return this; + } + + /** + * Get the leaseDuration property: Required for acquire. Specifies the duration of the lease, in seconds, or + * negative one (-1) for a lease that never expires. + * + * @return the leaseDuration value. + */ + public Integer leaseDuration() { + return this.leaseDuration; + } + + /** + * Set the leaseDuration property: Required for acquire. Specifies the duration of the lease, in seconds, or + * negative one (-1) for a lease that never expires. + * + * @param leaseDuration the leaseDuration value to set. + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withLeaseDuration(Integer leaseDuration) { + this.leaseDuration = leaseDuration; + return this; + } + + /** + * Get the proposedLeaseId property: Optional for acquire, required for change. Proposed lease ID, in a GUID string + * format. + * + * @return the proposedLeaseId value. + */ + public String proposedLeaseId() { + return this.proposedLeaseId; + } + + /** + * Set the proposedLeaseId property: Optional for acquire, required for change. Proposed lease ID, in a GUID string + * format. + * + * @param proposedLeaseId the proposedLeaseId value to set. + * @return the LeaseContainerRequest object itself. + */ + public LeaseContainerRequest withProposedLeaseId(String proposedLeaseId) { + this.proposedLeaseId = proposedLeaseId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (action() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property action in model LeaseContainerRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LeaseContainerRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + jsonWriter.writeStringField("leaseId", this.leaseId); + jsonWriter.writeNumberField("breakPeriod", this.breakPeriod); + jsonWriter.writeNumberField("leaseDuration", this.leaseDuration); + jsonWriter.writeStringField("proposedLeaseId", this.proposedLeaseId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LeaseContainerRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LeaseContainerRequest 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 LeaseContainerRequest. + */ + public static LeaseContainerRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LeaseContainerRequest deserializedLeaseContainerRequest = new LeaseContainerRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("action".equals(fieldName)) { + deserializedLeaseContainerRequest.action + = LeaseContainerRequestAction.fromString(reader.getString()); + } else if ("leaseId".equals(fieldName)) { + deserializedLeaseContainerRequest.leaseId = reader.getString(); + } else if ("breakPeriod".equals(fieldName)) { + deserializedLeaseContainerRequest.breakPeriod = reader.getNullable(JsonReader::getInt); + } else if ("leaseDuration".equals(fieldName)) { + deserializedLeaseContainerRequest.leaseDuration = reader.getNullable(JsonReader::getInt); + } else if ("proposedLeaseId".equals(fieldName)) { + deserializedLeaseContainerRequest.proposedLeaseId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLeaseContainerRequest; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseContainerRequestAction.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseContainerRequestAction.java new file mode 100644 index 0000000000000..b8c341094ea1c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseContainerRequestAction.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the lease action. Can be one of the available actions. + */ +public final class LeaseContainerRequestAction extends ExpandableStringEnum { + /** + * Static value Acquire for LeaseContainerRequestAction. + */ + public static final LeaseContainerRequestAction ACQUIRE = fromString("Acquire"); + + /** + * Static value Renew for LeaseContainerRequestAction. + */ + public static final LeaseContainerRequestAction RENEW = fromString("Renew"); + + /** + * Static value Change for LeaseContainerRequestAction. + */ + public static final LeaseContainerRequestAction CHANGE = fromString("Change"); + + /** + * Static value Release for LeaseContainerRequestAction. + */ + public static final LeaseContainerRequestAction RELEASE = fromString("Release"); + + /** + * Static value Break for LeaseContainerRequestAction. + */ + public static final LeaseContainerRequestAction BREAK = fromString("Break"); + + /** + * Creates a new instance of LeaseContainerRequestAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LeaseContainerRequestAction() { + } + + /** + * Creates or finds a LeaseContainerRequestAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding LeaseContainerRequestAction. + */ + public static LeaseContainerRequestAction fromString(String name) { + return fromString(name, LeaseContainerRequestAction.class); + } + + /** + * Gets known LeaseContainerRequestAction values. + * + * @return known LeaseContainerRequestAction values. + */ + public static Collection values() { + return values(LeaseContainerRequestAction.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseContainerResponse.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseContainerResponse.java new file mode 100644 index 0000000000000..e0b193ee68ae9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseContainerResponse.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.LeaseContainerResponseInner; + +/** + * An immutable client-side representation of LeaseContainerResponse. + */ +public interface LeaseContainerResponse { + /** + * Gets the leaseId property: Returned unique lease ID that must be included with any request to delete the + * container, or to renew, change, or release the lease. + * + * @return the leaseId value. + */ + String leaseId(); + + /** + * Gets the leaseTimeSeconds property: Approximate time remaining in the lease period, in seconds. + * + * @return the leaseTimeSeconds value. + */ + String leaseTimeSeconds(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.LeaseContainerResponseInner object. + * + * @return the inner object. + */ + LeaseContainerResponseInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseDuration.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseDuration.java new file mode 100644 index 0000000000000..031cd2912b6ea --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseDuration.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. + */ +public final class LeaseDuration extends ExpandableStringEnum { + /** + * Static value Infinite for LeaseDuration. + */ + public static final LeaseDuration INFINITE = fromString("Infinite"); + + /** + * Static value Fixed for LeaseDuration. + */ + public static final LeaseDuration FIXED = fromString("Fixed"); + + /** + * Creates a new instance of LeaseDuration value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LeaseDuration() { + } + + /** + * Creates or finds a LeaseDuration from its string representation. + * + * @param name a name to look for. + * @return the corresponding LeaseDuration. + */ + public static LeaseDuration fromString(String name) { + return fromString(name, LeaseDuration.class); + } + + /** + * Gets known LeaseDuration values. + * + * @return known LeaseDuration values. + */ + public static Collection values() { + return values(LeaseDuration.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseShareAction.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseShareAction.java new file mode 100644 index 0000000000000..c30ac05616721 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseShareAction.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the lease action. Can be one of the available actions. + */ +public final class LeaseShareAction extends ExpandableStringEnum { + /** + * Static value Acquire for LeaseShareAction. + */ + public static final LeaseShareAction ACQUIRE = fromString("Acquire"); + + /** + * Static value Renew for LeaseShareAction. + */ + public static final LeaseShareAction RENEW = fromString("Renew"); + + /** + * Static value Change for LeaseShareAction. + */ + public static final LeaseShareAction CHANGE = fromString("Change"); + + /** + * Static value Release for LeaseShareAction. + */ + public static final LeaseShareAction RELEASE = fromString("Release"); + + /** + * Static value Break for LeaseShareAction. + */ + public static final LeaseShareAction BREAK = fromString("Break"); + + /** + * Creates a new instance of LeaseShareAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LeaseShareAction() { + } + + /** + * Creates or finds a LeaseShareAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding LeaseShareAction. + */ + public static LeaseShareAction fromString(String name) { + return fromString(name, LeaseShareAction.class); + } + + /** + * Gets known LeaseShareAction values. + * + * @return known LeaseShareAction values. + */ + public static Collection values() { + return values(LeaseShareAction.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseShareRequest.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseShareRequest.java new file mode 100644 index 0000000000000..987bd0f03cd75 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseShareRequest.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Lease Share request schema. + */ +@Fluent +public final class LeaseShareRequest implements JsonSerializable { + /* + * Specifies the lease action. Can be one of the available actions. + */ + private LeaseShareAction action; + + /* + * Identifies the lease. Can be specified in any valid GUID string format. + */ + private String leaseId; + + /* + * Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, + * between 0 and 60. + */ + private Integer breakPeriod; + + /* + * Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that + * never expires. + */ + private Integer leaseDuration; + + /* + * Optional for acquire, required for change. Proposed lease ID, in a GUID string format. + */ + private String proposedLeaseId; + + /** + * Creates an instance of LeaseShareRequest class. + */ + public LeaseShareRequest() { + } + + /** + * Get the action property: Specifies the lease action. Can be one of the available actions. + * + * @return the action value. + */ + public LeaseShareAction action() { + return this.action; + } + + /** + * Set the action property: Specifies the lease action. Can be one of the available actions. + * + * @param action the action value to set. + * @return the LeaseShareRequest object itself. + */ + public LeaseShareRequest withAction(LeaseShareAction action) { + this.action = action; + return this; + } + + /** + * Get the leaseId property: Identifies the lease. Can be specified in any valid GUID string format. + * + * @return the leaseId value. + */ + public String leaseId() { + return this.leaseId; + } + + /** + * Set the leaseId property: Identifies the lease. Can be specified in any valid GUID string format. + * + * @param leaseId the leaseId value to set. + * @return the LeaseShareRequest object itself. + */ + public LeaseShareRequest withLeaseId(String leaseId) { + this.leaseId = leaseId; + return this; + } + + /** + * Get the breakPeriod property: Optional. For a break action, proposed duration the lease should continue before it + * is broken, in seconds, between 0 and 60. + * + * @return the breakPeriod value. + */ + public Integer breakPeriod() { + return this.breakPeriod; + } + + /** + * Set the breakPeriod property: Optional. For a break action, proposed duration the lease should continue before it + * is broken, in seconds, between 0 and 60. + * + * @param breakPeriod the breakPeriod value to set. + * @return the LeaseShareRequest object itself. + */ + public LeaseShareRequest withBreakPeriod(Integer breakPeriod) { + this.breakPeriod = breakPeriod; + return this; + } + + /** + * Get the leaseDuration property: Required for acquire. Specifies the duration of the lease, in seconds, or + * negative one (-1) for a lease that never expires. + * + * @return the leaseDuration value. + */ + public Integer leaseDuration() { + return this.leaseDuration; + } + + /** + * Set the leaseDuration property: Required for acquire. Specifies the duration of the lease, in seconds, or + * negative one (-1) for a lease that never expires. + * + * @param leaseDuration the leaseDuration value to set. + * @return the LeaseShareRequest object itself. + */ + public LeaseShareRequest withLeaseDuration(Integer leaseDuration) { + this.leaseDuration = leaseDuration; + return this; + } + + /** + * Get the proposedLeaseId property: Optional for acquire, required for change. Proposed lease ID, in a GUID string + * format. + * + * @return the proposedLeaseId value. + */ + public String proposedLeaseId() { + return this.proposedLeaseId; + } + + /** + * Set the proposedLeaseId property: Optional for acquire, required for change. Proposed lease ID, in a GUID string + * format. + * + * @param proposedLeaseId the proposedLeaseId value to set. + * @return the LeaseShareRequest object itself. + */ + public LeaseShareRequest withProposedLeaseId(String proposedLeaseId) { + this.proposedLeaseId = proposedLeaseId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (action() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property action in model LeaseShareRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LeaseShareRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + jsonWriter.writeStringField("leaseId", this.leaseId); + jsonWriter.writeNumberField("breakPeriod", this.breakPeriod); + jsonWriter.writeNumberField("leaseDuration", this.leaseDuration); + jsonWriter.writeStringField("proposedLeaseId", this.proposedLeaseId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LeaseShareRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LeaseShareRequest 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 LeaseShareRequest. + */ + public static LeaseShareRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LeaseShareRequest deserializedLeaseShareRequest = new LeaseShareRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("action".equals(fieldName)) { + deserializedLeaseShareRequest.action = LeaseShareAction.fromString(reader.getString()); + } else if ("leaseId".equals(fieldName)) { + deserializedLeaseShareRequest.leaseId = reader.getString(); + } else if ("breakPeriod".equals(fieldName)) { + deserializedLeaseShareRequest.breakPeriod = reader.getNullable(JsonReader::getInt); + } else if ("leaseDuration".equals(fieldName)) { + deserializedLeaseShareRequest.leaseDuration = reader.getNullable(JsonReader::getInt); + } else if ("proposedLeaseId".equals(fieldName)) { + deserializedLeaseShareRequest.proposedLeaseId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLeaseShareRequest; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseShareResponse.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseShareResponse.java new file mode 100644 index 0000000000000..2c4aaac7bf9f3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseShareResponse.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.LeaseShareResponseInner; + +/** + * An immutable client-side representation of LeaseShareResponse. + */ +public interface LeaseShareResponse { + /** + * Gets the leaseId property: Returned unique lease ID that must be included with any request to delete the share, + * or to renew, change, or release the lease. + * + * @return the leaseId value. + */ + String leaseId(); + + /** + * Gets the leaseTimeSeconds property: Approximate time remaining in the lease period, in seconds. + * + * @return the leaseTimeSeconds value. + */ + String leaseTimeSeconds(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.LeaseShareResponseInner object. + * + * @return the inner object. + */ + LeaseShareResponseInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseState.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseState.java new file mode 100644 index 0000000000000..53c1fa4f02d42 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseState.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Lease state of the container. + */ +public final class LeaseState extends ExpandableStringEnum { + /** + * Static value Available for LeaseState. + */ + public static final LeaseState AVAILABLE = fromString("Available"); + + /** + * Static value Leased for LeaseState. + */ + public static final LeaseState LEASED = fromString("Leased"); + + /** + * Static value Expired for LeaseState. + */ + public static final LeaseState EXPIRED = fromString("Expired"); + + /** + * Static value Breaking for LeaseState. + */ + public static final LeaseState BREAKING = fromString("Breaking"); + + /** + * Static value Broken for LeaseState. + */ + public static final LeaseState BROKEN = fromString("Broken"); + + /** + * Creates a new instance of LeaseState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LeaseState() { + } + + /** + * Creates or finds a LeaseState from its string representation. + * + * @param name a name to look for. + * @return the corresponding LeaseState. + */ + public static LeaseState fromString(String name) { + return fromString(name, LeaseState.class); + } + + /** + * Gets known LeaseState values. + * + * @return known LeaseState values. + */ + public static Collection values() { + return values(LeaseState.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseStatus.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseStatus.java new file mode 100644 index 0000000000000..835c403a5c5d7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The lease status of the container. + */ +public final class LeaseStatus extends ExpandableStringEnum { + /** + * Static value Locked for LeaseStatus. + */ + public static final LeaseStatus LOCKED = fromString("Locked"); + + /** + * Static value Unlocked for LeaseStatus. + */ + public static final LeaseStatus UNLOCKED = fromString("Unlocked"); + + /** + * Creates a new instance of LeaseStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LeaseStatus() { + } + + /** + * Creates or finds a LeaseStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding LeaseStatus. + */ + public static LeaseStatus fromString(String name) { + return fromString(name, LeaseStatus.class); + } + + /** + * Gets known LeaseStatus values. + * + * @return known LeaseStatus values. + */ + public static Collection values() { + return values(LeaseStatus.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LegalHold.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LegalHold.java new file mode 100644 index 0000000000000..c2c87ee1c3f96 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LegalHold.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.LegalHoldInner; +import java.util.List; + +/** + * An immutable client-side representation of LegalHold. + */ +public interface LegalHold { + /** + * Gets the hasLegalHold property: The hasLegalHold public property is set to true by SRP if there are at least one + * existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared + * out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. + * + * @return the hasLegalHold value. + */ + Boolean hasLegalHold(); + + /** + * Gets the tags property: Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at + * SRP. + * + * @return the tags value. + */ + List tags(); + + /** + * Gets the allowProtectedAppendWritesAll property: When enabled, new blocks can be written to both 'Append and Bock + * Blobs' while maintaining legal hold protection and compliance. Only new blocks can be added and any existing + * blocks cannot be modified or deleted. + * + * @return the allowProtectedAppendWritesAll value. + */ + Boolean allowProtectedAppendWritesAll(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.LegalHoldInner object. + * + * @return the inner object. + */ + LegalHoldInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LegalHoldProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LegalHoldProperties.java new file mode 100644 index 0000000000000..15cd1748db86c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LegalHoldProperties.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.List; + +/** + * The LegalHold property of a blob container. + */ +@Fluent +public final class LegalHoldProperties implements JsonSerializable { + /* + * The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold + * public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of + * 1000 blob containers with hasLegalHold=true for a given account. + */ + private Boolean hasLegalHold; + + /* + * The list of LegalHold tags of a blob container. + */ + private List tags; + + /* + * Protected append blob writes history. + */ + private ProtectedAppendWritesHistory protectedAppendWritesHistory; + + /** + * Creates an instance of LegalHoldProperties class. + */ + public LegalHoldProperties() { + } + + /** + * Get the hasLegalHold property: The hasLegalHold public property is set to true by SRP if there are at least one + * existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared + * out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. + * + * @return the hasLegalHold value. + */ + public Boolean hasLegalHold() { + return this.hasLegalHold; + } + + /** + * Get the tags property: The list of LegalHold tags of a blob container. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: The list of LegalHold tags of a blob container. + * + * @param tags the tags value to set. + * @return the LegalHoldProperties object itself. + */ + public LegalHoldProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the protectedAppendWritesHistory property: Protected append blob writes history. + * + * @return the protectedAppendWritesHistory value. + */ + public ProtectedAppendWritesHistory protectedAppendWritesHistory() { + return this.protectedAppendWritesHistory; + } + + /** + * Set the protectedAppendWritesHistory property: Protected append blob writes history. + * + * @param protectedAppendWritesHistory the protectedAppendWritesHistory value to set. + * @return the LegalHoldProperties object itself. + */ + public LegalHoldProperties + withProtectedAppendWritesHistory(ProtectedAppendWritesHistory protectedAppendWritesHistory) { + this.protectedAppendWritesHistory = protectedAppendWritesHistory; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + if (protectedAppendWritesHistory() != null) { + protectedAppendWritesHistory().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("protectedAppendWritesHistory", this.protectedAppendWritesHistory); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LegalHoldProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LegalHoldProperties 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 LegalHoldProperties. + */ + public static LegalHoldProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LegalHoldProperties deserializedLegalHoldProperties = new LegalHoldProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hasLegalHold".equals(fieldName)) { + deserializedLegalHoldProperties.hasLegalHold = reader.getNullable(JsonReader::getBoolean); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagProperty.fromJson(reader1)); + deserializedLegalHoldProperties.tags = tags; + } else if ("protectedAppendWritesHistory".equals(fieldName)) { + deserializedLegalHoldProperties.protectedAppendWritesHistory + = ProtectedAppendWritesHistory.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLegalHoldProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListAccountSasResponse.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListAccountSasResponse.java new file mode 100644 index 0000000000000..9d2babaf80719 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListAccountSasResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.ListAccountSasResponseInner; + +/** + * An immutable client-side representation of ListAccountSasResponse. + */ +public interface ListAccountSasResponse { + /** + * Gets the accountSasToken property: List SAS credentials of storage account. + * + * @return the accountSasToken value. + */ + String accountSasToken(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.ListAccountSasResponseInner object. + * + * @return the inner object. + */ + ListAccountSasResponseInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListBlobInventoryPolicy.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListBlobInventoryPolicy.java new file mode 100644 index 0000000000000..6152361f6c833 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListBlobInventoryPolicy.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.models.BlobInventoryPolicyInner; +import java.io.IOException; +import java.util.List; + +/** + * List of blob inventory policies returned. + */ +@Immutable +public final class ListBlobInventoryPolicy implements JsonSerializable { + /* + * List of blob inventory policies. + */ + private List value; + + /** + * Creates an instance of ListBlobInventoryPolicy class. + */ + public ListBlobInventoryPolicy() { + } + + /** + * Get the value property: List of blob inventory policies. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListBlobInventoryPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListBlobInventoryPolicy 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 ListBlobInventoryPolicy. + */ + public static ListBlobInventoryPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListBlobInventoryPolicy deserializedListBlobInventoryPolicy = new ListBlobInventoryPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> BlobInventoryPolicyInner.fromJson(reader1)); + deserializedListBlobInventoryPolicy.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedListBlobInventoryPolicy; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListContainerItem.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListContainerItem.java new file mode 100644 index 0000000000000..9893515e9a80e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListContainerItem.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.ListContainerItemInner; +import java.time.OffsetDateTime; +import java.util.Map; + +/** + * An immutable client-side representation of ListContainerItem. + */ +public interface ListContainerItem { + /** + * 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 etag property: Resource Etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the version property: The version of the deleted blob container. + * + * @return the version value. + */ + String version(); + + /** + * Gets the deleted property: Indicates whether the blob container was deleted. + * + * @return the deleted value. + */ + Boolean deleted(); + + /** + * Gets the deletedTime property: Blob container deletion time. + * + * @return the deletedTime value. + */ + OffsetDateTime deletedTime(); + + /** + * Gets the remainingRetentionDays property: Remaining retention days for soft deleted blob container. + * + * @return the remainingRetentionDays value. + */ + Integer remainingRetentionDays(); + + /** + * Gets the defaultEncryptionScope property: Default the container to use specified encryption scope for all writes. + * + * @return the defaultEncryptionScope value. + */ + String defaultEncryptionScope(); + + /** + * Gets the denyEncryptionScopeOverride property: Block override of encryption scope from the container default. + * + * @return the denyEncryptionScopeOverride value. + */ + Boolean denyEncryptionScopeOverride(); + + /** + * Gets the publicAccess property: Specifies whether data in the container may be accessed publicly and the level of + * access. + * + * @return the publicAccess value. + */ + PublicAccess publicAccess(); + + /** + * Gets the lastModifiedTime property: Returns the date and time the container was last modified. + * + * @return the lastModifiedTime value. + */ + OffsetDateTime lastModifiedTime(); + + /** + * Gets the leaseStatus property: The lease status of the container. + * + * @return the leaseStatus value. + */ + LeaseStatus leaseStatus(); + + /** + * Gets the leaseState property: Lease state of the container. + * + * @return the leaseState value. + */ + LeaseState leaseState(); + + /** + * Gets the leaseDuration property: Specifies whether the lease on a container is of infinite or fixed duration, + * only when the container is leased. + * + * @return the leaseDuration value. + */ + LeaseDuration leaseDuration(); + + /** + * Gets the metadata property: A name-value pair to associate with the container as metadata. + * + * @return the metadata value. + */ + Map metadata(); + + /** + * Gets the immutabilityPolicy property: The ImmutabilityPolicy property of the container. + * + * @return the immutabilityPolicy value. + */ + ImmutabilityPolicyProperties immutabilityPolicy(); + + /** + * Gets the legalHold property: The LegalHold property of the container. + * + * @return the legalHold value. + */ + LegalHoldProperties legalHold(); + + /** + * Gets the hasLegalHold property: The hasLegalHold public property is set to true by SRP if there are at least one + * existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared + * out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. + * + * @return the hasLegalHold value. + */ + Boolean hasLegalHold(); + + /** + * Gets the hasImmutabilityPolicy property: The hasImmutabilityPolicy public property is set to true by SRP if + * ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false + * by SRP if ImmutabilityPolicy has not been created for this container. + * + * @return the hasImmutabilityPolicy value. + */ + Boolean hasImmutabilityPolicy(); + + /** + * Gets the immutableStorageWithVersioning property: The object level immutability property of the container. The + * property is immutable and can only be set to true at the container creation time. Existing containers must + * undergo a migration process. + * + * @return the immutableStorageWithVersioning value. + */ + ImmutableStorageWithVersioning immutableStorageWithVersioning(); + + /** + * Gets the enableNfsV3RootSquash property: Enable NFSv3 root squash on blob container. + * + * @return the enableNfsV3RootSquash value. + */ + Boolean enableNfsV3RootSquash(); + + /** + * Gets the enableNfsV3AllSquash property: Enable NFSv3 all squash on blob container. + * + * @return the enableNfsV3AllSquash value. + */ + Boolean enableNfsV3AllSquash(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.ListContainerItemInner object. + * + * @return the inner object. + */ + ListContainerItemInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListContainerItems.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListContainerItems.java new file mode 100644 index 0000000000000..86da2c6ef8048 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListContainerItems.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.models.ListContainerItemInner; +import java.io.IOException; +import java.util.List; + +/** + * Response schema. Contains list of blobs returned, and if paging is requested or required, a URL to next page of + * containers. + */ +@Immutable +public final class ListContainerItems implements JsonSerializable { + /* + * List of blobs containers returned. + */ + private List value; + + /* + * Request URL that can be used to query next page of containers. Returned when total number of requested containers + * exceed maximum page size. + */ + private String nextLink; + + /** + * Creates an instance of ListContainerItems class. + */ + public ListContainerItems() { + } + + /** + * Get the value property: List of blobs containers returned. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Request URL that can be used to query next page of containers. Returned when total + * number of requested containers exceed maximum page size. + * + * @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) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListContainerItems from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListContainerItems 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 ListContainerItems. + */ + public static ListContainerItems fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListContainerItems deserializedListContainerItems = new ListContainerItems(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ListContainerItemInner.fromJson(reader1)); + deserializedListContainerItems.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListContainerItems.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListContainerItems; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListContainersInclude.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListContainersInclude.java new file mode 100644 index 0000000000000..263407219c4ba --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListContainersInclude.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for ListContainersInclude. + */ +public final class ListContainersInclude extends ExpandableStringEnum { + /** + * Static value deleted for ListContainersInclude. + */ + public static final ListContainersInclude DELETED = fromString("deleted"); + + /** + * Creates a new instance of ListContainersInclude value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ListContainersInclude() { + } + + /** + * Creates or finds a ListContainersInclude from its string representation. + * + * @param name a name to look for. + * @return the corresponding ListContainersInclude. + */ + public static ListContainersInclude fromString(String name) { + return fromString(name, ListContainersInclude.class); + } + + /** + * Gets known ListContainersInclude values. + * + * @return known ListContainersInclude values. + */ + public static Collection values() { + return values(ListContainersInclude.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListEncryptionScopesInclude.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListEncryptionScopesInclude.java new file mode 100644 index 0000000000000..54635b1199e66 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListEncryptionScopesInclude.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for ListEncryptionScopesInclude. + */ +public final class ListEncryptionScopesInclude extends ExpandableStringEnum { + /** + * Static value All for ListEncryptionScopesInclude. + */ + public static final ListEncryptionScopesInclude ALL = fromString("All"); + + /** + * Static value Enabled for ListEncryptionScopesInclude. + */ + public static final ListEncryptionScopesInclude ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for ListEncryptionScopesInclude. + */ + public static final ListEncryptionScopesInclude DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of ListEncryptionScopesInclude value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ListEncryptionScopesInclude() { + } + + /** + * Creates or finds a ListEncryptionScopesInclude from its string representation. + * + * @param name a name to look for. + * @return the corresponding ListEncryptionScopesInclude. + */ + public static ListEncryptionScopesInclude fromString(String name) { + return fromString(name, ListEncryptionScopesInclude.class); + } + + /** + * Gets known ListEncryptionScopesInclude values. + * + * @return known ListEncryptionScopesInclude values. + */ + public static Collection values() { + return values(ListEncryptionScopesInclude.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListKeyExpand.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListKeyExpand.java new file mode 100644 index 0000000000000..efbb99b1605fb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListKeyExpand.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +/** + * Defines values for ListKeyExpand. + */ +public enum ListKeyExpand { + /** + * Enum value kerb. + */ + KERB("kerb"); + + /** + * The actual serialized value for a ListKeyExpand instance. + */ + private final String value; + + ListKeyExpand(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ListKeyExpand instance. + * + * @param value the serialized value to parse. + * @return the parsed ListKeyExpand object, or null if unable to parse. + */ + public static ListKeyExpand fromString(String value) { + if (value == null) { + return null; + } + ListKeyExpand[] items = ListKeyExpand.values(); + for (ListKeyExpand item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListLocalUserIncludeParam.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListLocalUserIncludeParam.java new file mode 100644 index 0000000000000..56d55361b85fd --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListLocalUserIncludeParam.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for ListLocalUserIncludeParam. + */ +public final class ListLocalUserIncludeParam extends ExpandableStringEnum { + /** + * Static value nfsv3 for ListLocalUserIncludeParam. + */ + public static final ListLocalUserIncludeParam NFSV3 = fromString("nfsv3"); + + /** + * Creates a new instance of ListLocalUserIncludeParam value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ListLocalUserIncludeParam() { + } + + /** + * Creates or finds a ListLocalUserIncludeParam from its string representation. + * + * @param name a name to look for. + * @return the corresponding ListLocalUserIncludeParam. + */ + public static ListLocalUserIncludeParam fromString(String name) { + return fromString(name, ListLocalUserIncludeParam.class); + } + + /** + * Gets known ListLocalUserIncludeParam values. + * + * @return known ListLocalUserIncludeParam values. + */ + public static Collection values() { + return values(ListLocalUserIncludeParam.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListQueue.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListQueue.java new file mode 100644 index 0000000000000..6fa4f25b72b9e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListQueue.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.ListQueueInner; +import java.util.Map; + +/** + * An immutable client-side representation of ListQueue. + */ +public interface ListQueue { + /** + * 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 metadata property: A name-value pair that represents queue metadata. + * + * @return the metadata value. + */ + Map metadata(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.ListQueueInner object. + * + * @return the inner object. + */ + ListQueueInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListQueueResource.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListQueueResource.java new file mode 100644 index 0000000000000..8ff172833d7f7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListQueueResource.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.models.ListQueueInner; +import java.io.IOException; +import java.util.List; + +/** + * Response schema. Contains list of queues returned. + */ +@Immutable +public final class ListQueueResource implements JsonSerializable { + /* + * List of queues returned. + */ + private List value; + + /* + * Request URL that can be used to list next page of queues + */ + private String nextLink; + + /** + * Creates an instance of ListQueueResource class. + */ + public ListQueueResource() { + } + + /** + * Get the value property: List of queues returned. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Request URL that can be used to list next page of queues. + * + * @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) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListQueueResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListQueueResource 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 ListQueueResource. + */ + public static ListQueueResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListQueueResource deserializedListQueueResource = new ListQueueResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ListQueueInner.fromJson(reader1)); + deserializedListQueueResource.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListQueueResource.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListQueueResource; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListQueueServices.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListQueueServices.java new file mode 100644 index 0000000000000..17159c9e4e989 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListQueueServices.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.ListQueueServicesInner; +import java.util.List; + +/** + * An immutable client-side representation of ListQueueServices. + */ +public interface ListQueueServices { + /** + * Gets the value property: List of queue services returned. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.ListQueueServicesInner object. + * + * @return the inner object. + */ + ListQueueServicesInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListServiceSasResponse.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListServiceSasResponse.java new file mode 100644 index 0000000000000..15af4be4891dc --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListServiceSasResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.ListServiceSasResponseInner; + +/** + * An immutable client-side representation of ListServiceSasResponse. + */ +public interface ListServiceSasResponse { + /** + * Gets the serviceSasToken property: List service SAS credentials of specific resource. + * + * @return the serviceSasToken value. + */ + String serviceSasToken(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.ListServiceSasResponseInner object. + * + * @return the inner object. + */ + ListServiceSasResponseInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListTableResource.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListTableResource.java new file mode 100644 index 0000000000000..4f981877296da --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListTableResource.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.models.TableInner; +import java.io.IOException; +import java.util.List; + +/** + * Response schema. Contains list of tables returned. + */ +@Immutable +public final class ListTableResource implements JsonSerializable { + /* + * List of tables returned. + */ + private List value; + + /* + * Request URL that can be used to query next page of tables + */ + private String nextLink; + + /** + * Creates an instance of ListTableResource class. + */ + public ListTableResource() { + } + + /** + * Get the value property: List of tables returned. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Request URL that can be used to query next page of tables. + * + * @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) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListTableResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListTableResource 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 ListTableResource. + */ + public static ListTableResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListTableResource deserializedListTableResource = new ListTableResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> TableInner.fromJson(reader1)); + deserializedListTableResource.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListTableResource.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListTableResource; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListTableServices.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListTableServices.java new file mode 100644 index 0000000000000..6daaa0ff95f52 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListTableServices.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.ListTableServicesInner; +import java.util.List; + +/** + * An immutable client-side representation of ListTableServices. + */ +public interface ListTableServices { + /** + * Gets the value property: List of table services returned. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.ListTableServicesInner object. + * + * @return the inner object. + */ + ListTableServicesInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUser.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUser.java new file mode 100644 index 0000000000000..7b1c77edd6422 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUser.java @@ -0,0 +1,573 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserInner; +import java.util.List; + +/** + * An immutable client-side representation of LocalUser. + */ +public interface LocalUser { + /** + * 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the permissionScopes property: The permission scopes of the local user. + * + * @return the permissionScopes value. + */ + List permissionScopes(); + + /** + * Gets the homeDirectory property: Optional, local user home directory. + * + * @return the homeDirectory value. + */ + String homeDirectory(); + + /** + * Gets the sshAuthorizedKeys property: Optional, local user ssh authorized keys for SFTP. + * + * @return the sshAuthorizedKeys value. + */ + List sshAuthorizedKeys(); + + /** + * Gets the sid property: A unique Security Identifier that is generated by the server. + * + * @return the sid value. + */ + String sid(); + + /** + * Gets the hasSharedKey property: Indicates whether shared key exists. Set it to false to remove existing shared + * key. + * + * @return the hasSharedKey value. + */ + Boolean hasSharedKey(); + + /** + * Gets the hasSshKey property: Indicates whether ssh key exists. Set it to false to remove existing SSH key. + * + * @return the hasSshKey value. + */ + Boolean hasSshKey(); + + /** + * Gets the hasSshPassword property: Indicates whether ssh password exists. Set it to false to remove existing SSH + * password. + * + * @return the hasSshPassword value. + */ + Boolean hasSshPassword(); + + /** + * Gets the userId property: A unique Identifier that is generated by the server. + * + * @return the userId value. + */ + Integer userId(); + + /** + * Gets the groupId property: An identifier for associating a group of users. + * + * @return the groupId value. + */ + Integer groupId(); + + /** + * Gets the allowAclAuthorization property: Indicates whether ACL authorization is allowed for this user. Set it to + * false to disallow using ACL authorization. + * + * @return the allowAclAuthorization value. + */ + Boolean allowAclAuthorization(); + + /** + * Gets the extendedGroups property: Supplementary group membership. Only applicable for local users enabled for + * NFSv3 access. + * + * @return the extendedGroups value. + */ + List extendedGroups(); + + /** + * Gets the isNFSv3Enabled property: Indicates if the local user is enabled for access with NFSv3 protocol. + * + * @return the isNFSv3Enabled value. + */ + Boolean isNFSv3Enabled(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.LocalUserInner object. + * + * @return the inner object. + */ + LocalUserInner innerModel(); + + /** + * The entirety of the LocalUser definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The LocalUser definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the LocalUser definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the LocalUser definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the LocalUser 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.WithPermissionScopes, DefinitionStages.WithHomeDirectory, + DefinitionStages.WithSshAuthorizedKeys, DefinitionStages.WithHasSharedKey, DefinitionStages.WithHasSshKey, + DefinitionStages.WithHasSshPassword, DefinitionStages.WithGroupId, + DefinitionStages.WithAllowAclAuthorization, DefinitionStages.WithExtendedGroups, + DefinitionStages.WithIsNFSv3Enabled { + /** + * Executes the create request. + * + * @return the created resource. + */ + LocalUser create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LocalUser create(Context context); + } + + /** + * The stage of the LocalUser definition allowing to specify permissionScopes. + */ + interface WithPermissionScopes { + /** + * Specifies the permissionScopes property: The permission scopes of the local user.. + * + * @param permissionScopes The permission scopes of the local user. + * @return the next definition stage. + */ + WithCreate withPermissionScopes(List permissionScopes); + } + + /** + * The stage of the LocalUser definition allowing to specify homeDirectory. + */ + interface WithHomeDirectory { + /** + * Specifies the homeDirectory property: Optional, local user home directory.. + * + * @param homeDirectory Optional, local user home directory. + * @return the next definition stage. + */ + WithCreate withHomeDirectory(String homeDirectory); + } + + /** + * The stage of the LocalUser definition allowing to specify sshAuthorizedKeys. + */ + interface WithSshAuthorizedKeys { + /** + * Specifies the sshAuthorizedKeys property: Optional, local user ssh authorized keys for SFTP.. + * + * @param sshAuthorizedKeys Optional, local user ssh authorized keys for SFTP. + * @return the next definition stage. + */ + WithCreate withSshAuthorizedKeys(List sshAuthorizedKeys); + } + + /** + * The stage of the LocalUser definition allowing to specify hasSharedKey. + */ + interface WithHasSharedKey { + /** + * Specifies the hasSharedKey property: Indicates whether shared key exists. Set it to false to remove + * existing shared key.. + * + * @param hasSharedKey Indicates whether shared key exists. Set it to false to remove existing shared key. + * @return the next definition stage. + */ + WithCreate withHasSharedKey(Boolean hasSharedKey); + } + + /** + * The stage of the LocalUser definition allowing to specify hasSshKey. + */ + interface WithHasSshKey { + /** + * Specifies the hasSshKey property: Indicates whether ssh key exists. Set it to false to remove existing + * SSH key.. + * + * @param hasSshKey Indicates whether ssh key exists. Set it to false to remove existing SSH key. + * @return the next definition stage. + */ + WithCreate withHasSshKey(Boolean hasSshKey); + } + + /** + * The stage of the LocalUser definition allowing to specify hasSshPassword. + */ + interface WithHasSshPassword { + /** + * Specifies the hasSshPassword property: Indicates whether ssh password exists. Set it to false to remove + * existing SSH password.. + * + * @param hasSshPassword Indicates whether ssh password exists. Set it to false to remove existing SSH + * password. + * @return the next definition stage. + */ + WithCreate withHasSshPassword(Boolean hasSshPassword); + } + + /** + * The stage of the LocalUser definition allowing to specify groupId. + */ + interface WithGroupId { + /** + * Specifies the groupId property: An identifier for associating a group of users.. + * + * @param groupId An identifier for associating a group of users. + * @return the next definition stage. + */ + WithCreate withGroupId(Integer groupId); + } + + /** + * The stage of the LocalUser definition allowing to specify allowAclAuthorization. + */ + interface WithAllowAclAuthorization { + /** + * Specifies the allowAclAuthorization property: Indicates whether ACL authorization is allowed for this + * user. Set it to false to disallow using ACL authorization.. + * + * @param allowAclAuthorization Indicates whether ACL authorization is allowed for this user. Set it to + * false to disallow using ACL authorization. + * @return the next definition stage. + */ + WithCreate withAllowAclAuthorization(Boolean allowAclAuthorization); + } + + /** + * The stage of the LocalUser definition allowing to specify extendedGroups. + */ + interface WithExtendedGroups { + /** + * Specifies the extendedGroups property: Supplementary group membership. Only applicable for local users + * enabled for NFSv3 access.. + * + * @param extendedGroups Supplementary group membership. Only applicable for local users enabled for NFSv3 + * access. + * @return the next definition stage. + */ + WithCreate withExtendedGroups(List extendedGroups); + } + + /** + * The stage of the LocalUser definition allowing to specify isNFSv3Enabled. + */ + interface WithIsNFSv3Enabled { + /** + * Specifies the isNFSv3Enabled property: Indicates if the local user is enabled for access with NFSv3 + * protocol.. + * + * @param isNFSv3Enabled Indicates if the local user is enabled for access with NFSv3 protocol. + * @return the next definition stage. + */ + WithCreate withIsNFSv3Enabled(Boolean isNFSv3Enabled); + } + } + + /** + * Begins update for the LocalUser resource. + * + * @return the stage of resource update. + */ + LocalUser.Update update(); + + /** + * The template for LocalUser update. + */ + interface Update extends UpdateStages.WithPermissionScopes, UpdateStages.WithHomeDirectory, + UpdateStages.WithSshAuthorizedKeys, UpdateStages.WithHasSharedKey, UpdateStages.WithHasSshKey, + UpdateStages.WithHasSshPassword, UpdateStages.WithGroupId, UpdateStages.WithAllowAclAuthorization, + UpdateStages.WithExtendedGroups, UpdateStages.WithIsNFSv3Enabled { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LocalUser apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LocalUser apply(Context context); + } + + /** + * The LocalUser update stages. + */ + interface UpdateStages { + /** + * The stage of the LocalUser update allowing to specify permissionScopes. + */ + interface WithPermissionScopes { + /** + * Specifies the permissionScopes property: The permission scopes of the local user.. + * + * @param permissionScopes The permission scopes of the local user. + * @return the next definition stage. + */ + Update withPermissionScopes(List permissionScopes); + } + + /** + * The stage of the LocalUser update allowing to specify homeDirectory. + */ + interface WithHomeDirectory { + /** + * Specifies the homeDirectory property: Optional, local user home directory.. + * + * @param homeDirectory Optional, local user home directory. + * @return the next definition stage. + */ + Update withHomeDirectory(String homeDirectory); + } + + /** + * The stage of the LocalUser update allowing to specify sshAuthorizedKeys. + */ + interface WithSshAuthorizedKeys { + /** + * Specifies the sshAuthorizedKeys property: Optional, local user ssh authorized keys for SFTP.. + * + * @param sshAuthorizedKeys Optional, local user ssh authorized keys for SFTP. + * @return the next definition stage. + */ + Update withSshAuthorizedKeys(List sshAuthorizedKeys); + } + + /** + * The stage of the LocalUser update allowing to specify hasSharedKey. + */ + interface WithHasSharedKey { + /** + * Specifies the hasSharedKey property: Indicates whether shared key exists. Set it to false to remove + * existing shared key.. + * + * @param hasSharedKey Indicates whether shared key exists. Set it to false to remove existing shared key. + * @return the next definition stage. + */ + Update withHasSharedKey(Boolean hasSharedKey); + } + + /** + * The stage of the LocalUser update allowing to specify hasSshKey. + */ + interface WithHasSshKey { + /** + * Specifies the hasSshKey property: Indicates whether ssh key exists. Set it to false to remove existing + * SSH key.. + * + * @param hasSshKey Indicates whether ssh key exists. Set it to false to remove existing SSH key. + * @return the next definition stage. + */ + Update withHasSshKey(Boolean hasSshKey); + } + + /** + * The stage of the LocalUser update allowing to specify hasSshPassword. + */ + interface WithHasSshPassword { + /** + * Specifies the hasSshPassword property: Indicates whether ssh password exists. Set it to false to remove + * existing SSH password.. + * + * @param hasSshPassword Indicates whether ssh password exists. Set it to false to remove existing SSH + * password. + * @return the next definition stage. + */ + Update withHasSshPassword(Boolean hasSshPassword); + } + + /** + * The stage of the LocalUser update allowing to specify groupId. + */ + interface WithGroupId { + /** + * Specifies the groupId property: An identifier for associating a group of users.. + * + * @param groupId An identifier for associating a group of users. + * @return the next definition stage. + */ + Update withGroupId(Integer groupId); + } + + /** + * The stage of the LocalUser update allowing to specify allowAclAuthorization. + */ + interface WithAllowAclAuthorization { + /** + * Specifies the allowAclAuthorization property: Indicates whether ACL authorization is allowed for this + * user. Set it to false to disallow using ACL authorization.. + * + * @param allowAclAuthorization Indicates whether ACL authorization is allowed for this user. Set it to + * false to disallow using ACL authorization. + * @return the next definition stage. + */ + Update withAllowAclAuthorization(Boolean allowAclAuthorization); + } + + /** + * The stage of the LocalUser update allowing to specify extendedGroups. + */ + interface WithExtendedGroups { + /** + * Specifies the extendedGroups property: Supplementary group membership. Only applicable for local users + * enabled for NFSv3 access.. + * + * @param extendedGroups Supplementary group membership. Only applicable for local users enabled for NFSv3 + * access. + * @return the next definition stage. + */ + Update withExtendedGroups(List extendedGroups); + } + + /** + * The stage of the LocalUser update allowing to specify isNFSv3Enabled. + */ + interface WithIsNFSv3Enabled { + /** + * Specifies the isNFSv3Enabled property: Indicates if the local user is enabled for access with NFSv3 + * protocol.. + * + * @param isNFSv3Enabled Indicates if the local user is enabled for access with NFSv3 protocol. + * @return the next definition stage. + */ + Update withIsNFSv3Enabled(Boolean isNFSv3Enabled); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LocalUser refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LocalUser refresh(Context context); + + /** + * List SSH authorized keys and shared key of the local user. + * + * @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 Storage Account Local User keys along with {@link Response}. + */ + Response listKeysWithResponse(Context context); + + /** + * List SSH authorized keys and shared key of the local user. + * + * @throws com.azure.core.management.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 Storage Account Local User keys. + */ + LocalUserKeys listKeys(); + + /** + * Regenerate the local user SSH password. + * + * @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 secrets of Storage Account Local User along with {@link Response}. + */ + Response regeneratePasswordWithResponse(Context context); + + /** + * Regenerate the local user SSH password. + * + * @throws com.azure.core.management.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 secrets of Storage Account Local User. + */ + LocalUserRegeneratePasswordResult regeneratePassword(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUserKeys.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUserKeys.java new file mode 100644 index 0000000000000..e221d1acb4df6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUserKeys.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserKeysInner; +import java.util.List; + +/** + * An immutable client-side representation of LocalUserKeys. + */ +public interface LocalUserKeys { + /** + * Gets the sshAuthorizedKeys property: Optional, local user ssh authorized keys for SFTP. + * + * @return the sshAuthorizedKeys value. + */ + List sshAuthorizedKeys(); + + /** + * Gets the sharedKey property: Auto generated by the server for SMB authentication. + * + * @return the sharedKey value. + */ + String sharedKey(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.LocalUserKeysInner object. + * + * @return the inner object. + */ + LocalUserKeysInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUserRegeneratePasswordResult.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUserRegeneratePasswordResult.java new file mode 100644 index 0000000000000..4ce0aad8e295b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUserRegeneratePasswordResult.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.LocalUserRegeneratePasswordResultInner; + +/** + * An immutable client-side representation of LocalUserRegeneratePasswordResult. + */ +public interface LocalUserRegeneratePasswordResult { + /** + * Gets the sshPassword property: Auto generated password by the server for SSH authentication if hasSshPassword is + * set to true on the creation of local user. + * + * @return the sshPassword value. + */ + String sshPassword(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.LocalUserRegeneratePasswordResultInner + * object. + * + * @return the inner object. + */ + LocalUserRegeneratePasswordResultInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUsers.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUsers.java new file mode 100644 index 0000000000000..fb4c8ffeb6d65 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUsers.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 com.azure.resourcemanager.storage.generated.fluent.models.LocalUserInner; +import java.io.IOException; +import java.util.List; + +/** + * List of local users requested, and if paging is required, a URL to the next page of local users. + */ +@Fluent +public final class LocalUsers implements JsonSerializable { + /* + * The list of local users associated with the storage account. + */ + private List value; + + /* + * Request URL that can be used to query next page of local users. Returned when total number of requested local + * users exceeds the maximum page size. + */ + private String nextLink; + + /** + * Creates an instance of LocalUsers class. + */ + public LocalUsers() { + } + + /** + * Get the value property: The list of local users associated with the storage account. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of local users associated with the storage account. + * + * @param value the value value to set. + * @return the LocalUsers object itself. + */ + public LocalUsers withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Request URL that can be used to query next page of local users. Returned when total + * number of requested local users exceeds the maximum page size. + * + * @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) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LocalUsers from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LocalUsers 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 LocalUsers. + */ + public static LocalUsers fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LocalUsers deserializedLocalUsers = new LocalUsers(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> LocalUserInner.fromJson(reader1)); + deserializedLocalUsers.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLocalUsers.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLocalUsers; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUsersOperations.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUsersOperations.java new file mode 100644 index 0000000000000..7680f129518cf --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LocalUsersOperations.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 LocalUsersOperations. + */ +public interface LocalUsersOperations { + /** + * List the local users associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of local users requested, and if paging is required, a URL to the next page of local users as + * paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List the local users associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of local users that will be included in the list + * response. + * @param filter Optional. When specified, only local user names starting with the filter will be listed. + * @param include Optional, when specified, will list local users enabled for the specific protocol. Lists all users + * by default. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of local users requested, and if paging is required, a URL to the next page of local users as + * paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, Integer maxpagesize, String filter, + ListLocalUserIncludeParam include, Context context); + + /** + * Get the local user of the storage account by username. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user of the storage account by username along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String accountName, String username, Context context); + + /** + * Get the local user of the storage account by username. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user of the storage account by username. + */ + LocalUser get(String resourceGroupName, String accountName, String username); + + /** + * Deletes the local user associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String accountName, String username, Context context); + + /** + * Deletes the local user associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String username); + + /** + * List SSH authorized keys and shared key of the local user. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Storage Account Local User keys along with {@link Response}. + */ + Response listKeysWithResponse(String resourceGroupName, String accountName, String username, + Context context); + + /** + * List SSH authorized keys and shared key of the local user. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Storage Account Local User keys. + */ + LocalUserKeys listKeys(String resourceGroupName, String accountName, String username); + + /** + * Regenerate the local user SSH password. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secrets of Storage Account Local User along with {@link Response}. + */ + Response regeneratePasswordWithResponse(String resourceGroupName, + String accountName, String username, Context context); + + /** + * Regenerate the local user SSH password. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param username The name of local user. The username must contain lowercase letters and numbers only. It must be + * unique only within the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the secrets of Storage Account Local User. + */ + LocalUserRegeneratePasswordResult regeneratePassword(String resourceGroupName, String accountName, String username); + + /** + * Get the local user of the storage account by username. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user of the storage account by username along with {@link Response}. + */ + LocalUser getById(String id); + + /** + * Get the local user of the storage account by username. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the local user of the storage account by username along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the local user associated with the specified storage account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the local user associated with the specified storage account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new LocalUser resource. + * + * @param name resource name. + * @return the first stage of the new LocalUser definition. + */ + LocalUser.DefinitionStages.Blank define(String name); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicies.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicies.java new file mode 100644 index 0000000000000..6d658962daa18 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicies.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ManagementPolicies. + */ +public interface ManagementPolicies { + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @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 managementpolicy associated with the specified storage account along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String accountName, + ManagementPolicyName managementPolicyName, Context context); + + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 managementpolicy associated with the specified storage account. + */ + ManagementPolicy get(String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName); + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @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 Response}. + */ + Response deleteWithResponse(String resourceGroupName, String accountName, + ManagementPolicyName managementPolicyName, Context context); + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName); + + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managementpolicy associated with the specified storage account along with {@link Response}. + */ + ManagementPolicy getById(String id); + + /** + * Gets the managementpolicy associated with the specified storage account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managementpolicy associated with the specified storage account along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the managementpolicy associated with the specified storage account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ManagementPolicy resource. + * + * @param name resource name. + * @return the first stage of the new ManagementPolicy definition. + */ + ManagementPolicy.DefinitionStages.Blank define(ManagementPolicyName name); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicy.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicy.java new file mode 100644 index 0000000000000..29dfd139819c2 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicy.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.ManagementPolicyInner; +import java.time.OffsetDateTime; + +/** + * An immutable client-side representation of ManagementPolicy. + */ +public interface ManagementPolicy { + /** + * 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 lastModifiedTime property: Returns the date and time the ManagementPolicies was last modified. + * + * @return the lastModifiedTime value. + */ + OffsetDateTime lastModifiedTime(); + + /** + * Gets the policy property: The Storage Account ManagementPolicy, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @return the policy value. + */ + ManagementPolicySchema policy(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.ManagementPolicyInner object. + * + * @return the inner object. + */ + ManagementPolicyInner innerModel(); + + /** + * The entirety of the ManagementPolicy definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The ManagementPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ManagementPolicy definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the ManagementPolicy definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the ManagementPolicy 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.WithPolicy { + /** + * Executes the create request. + * + * @return the created resource. + */ + ManagementPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ManagementPolicy create(Context context); + } + + /** + * The stage of the ManagementPolicy definition allowing to specify policy. + */ + interface WithPolicy { + /** + * Specifies the policy property: The Storage Account ManagementPolicy, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.. + * + * @param policy The Storage Account ManagementPolicy, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * @return the next definition stage. + */ + WithCreate withPolicy(ManagementPolicySchema policy); + } + } + + /** + * Begins update for the ManagementPolicy resource. + * + * @return the stage of resource update. + */ + ManagementPolicy.Update update(); + + /** + * The template for ManagementPolicy update. + */ + interface Update extends UpdateStages.WithPolicy { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ManagementPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ManagementPolicy apply(Context context); + } + + /** + * The ManagementPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the ManagementPolicy update allowing to specify policy. + */ + interface WithPolicy { + /** + * Specifies the policy property: The Storage Account ManagementPolicy, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.. + * + * @param policy The Storage Account ManagementPolicy, in JSON format. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * @return the next definition stage. + */ + Update withPolicy(ManagementPolicySchema policy); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ManagementPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ManagementPolicy refresh(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyAction.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyAction.java new file mode 100644 index 0000000000000..da39f0c4ff283 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyAction.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Actions are applied to the filtered blobs when the execution condition is met. + */ +@Fluent +public final class ManagementPolicyAction implements JsonSerializable { + /* + * The management policy action for base blob + */ + private ManagementPolicyBaseBlob baseBlob; + + /* + * The management policy action for snapshot + */ + private ManagementPolicySnapShot snapshot; + + /* + * The management policy action for version + */ + private ManagementPolicyVersion version; + + /** + * Creates an instance of ManagementPolicyAction class. + */ + public ManagementPolicyAction() { + } + + /** + * Get the baseBlob property: The management policy action for base blob. + * + * @return the baseBlob value. + */ + public ManagementPolicyBaseBlob baseBlob() { + return this.baseBlob; + } + + /** + * Set the baseBlob property: The management policy action for base blob. + * + * @param baseBlob the baseBlob value to set. + * @return the ManagementPolicyAction object itself. + */ + public ManagementPolicyAction withBaseBlob(ManagementPolicyBaseBlob baseBlob) { + this.baseBlob = baseBlob; + return this; + } + + /** + * Get the snapshot property: The management policy action for snapshot. + * + * @return the snapshot value. + */ + public ManagementPolicySnapShot snapshot() { + return this.snapshot; + } + + /** + * Set the snapshot property: The management policy action for snapshot. + * + * @param snapshot the snapshot value to set. + * @return the ManagementPolicyAction object itself. + */ + public ManagementPolicyAction withSnapshot(ManagementPolicySnapShot snapshot) { + this.snapshot = snapshot; + return this; + } + + /** + * Get the version property: The management policy action for version. + * + * @return the version value. + */ + public ManagementPolicyVersion version() { + return this.version; + } + + /** + * Set the version property: The management policy action for version. + * + * @param version the version value to set. + * @return the ManagementPolicyAction object itself. + */ + public ManagementPolicyAction withVersion(ManagementPolicyVersion version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (baseBlob() != null) { + baseBlob().validate(); + } + if (snapshot() != null) { + snapshot().validate(); + } + if (version() != null) { + version().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("baseBlob", this.baseBlob); + jsonWriter.writeJsonField("snapshot", this.snapshot); + jsonWriter.writeJsonField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagementPolicyAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementPolicyAction 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 ManagementPolicyAction. + */ + public static ManagementPolicyAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementPolicyAction deserializedManagementPolicyAction = new ManagementPolicyAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("baseBlob".equals(fieldName)) { + deserializedManagementPolicyAction.baseBlob = ManagementPolicyBaseBlob.fromJson(reader); + } else if ("snapshot".equals(fieldName)) { + deserializedManagementPolicyAction.snapshot = ManagementPolicySnapShot.fromJson(reader); + } else if ("version".equals(fieldName)) { + deserializedManagementPolicyAction.version = ManagementPolicyVersion.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagementPolicyAction; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyBaseBlob.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyBaseBlob.java new file mode 100644 index 0000000000000..ef96696f6a09c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyBaseBlob.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Management policy action for base blob. + */ +@Fluent +public final class ManagementPolicyBaseBlob implements JsonSerializable { + /* + * The function to tier blobs to cool storage. + */ + private DateAfterModification tierToCool; + + /* + * The function to tier blobs to archive storage. + */ + private DateAfterModification tierToArchive; + + /* + * The function to tier blobs to cold storage. + */ + private DateAfterModification tierToCold; + + /* + * The function to tier blobs to hot storage. This action can only be used with Premium Block Blob Storage Accounts + */ + private DateAfterModification tierToHot; + + /* + * The function to delete the blob + */ + private DateAfterModification delete; + + /* + * This property enables auto tiering of a blob from cool to hot on a blob access. This property requires + * tierToCool.daysAfterLastAccessTimeGreaterThan. + */ + private Boolean enableAutoTierToHotFromCool; + + /** + * Creates an instance of ManagementPolicyBaseBlob class. + */ + public ManagementPolicyBaseBlob() { + } + + /** + * Get the tierToCool property: The function to tier blobs to cool storage. + * + * @return the tierToCool value. + */ + public DateAfterModification tierToCool() { + return this.tierToCool; + } + + /** + * Set the tierToCool property: The function to tier blobs to cool storage. + * + * @param tierToCool the tierToCool value to set. + * @return the ManagementPolicyBaseBlob object itself. + */ + public ManagementPolicyBaseBlob withTierToCool(DateAfterModification tierToCool) { + this.tierToCool = tierToCool; + return this; + } + + /** + * Get the tierToArchive property: The function to tier blobs to archive storage. + * + * @return the tierToArchive value. + */ + public DateAfterModification tierToArchive() { + return this.tierToArchive; + } + + /** + * Set the tierToArchive property: The function to tier blobs to archive storage. + * + * @param tierToArchive the tierToArchive value to set. + * @return the ManagementPolicyBaseBlob object itself. + */ + public ManagementPolicyBaseBlob withTierToArchive(DateAfterModification tierToArchive) { + this.tierToArchive = tierToArchive; + return this; + } + + /** + * Get the tierToCold property: The function to tier blobs to cold storage. + * + * @return the tierToCold value. + */ + public DateAfterModification tierToCold() { + return this.tierToCold; + } + + /** + * Set the tierToCold property: The function to tier blobs to cold storage. + * + * @param tierToCold the tierToCold value to set. + * @return the ManagementPolicyBaseBlob object itself. + */ + public ManagementPolicyBaseBlob withTierToCold(DateAfterModification tierToCold) { + this.tierToCold = tierToCold; + return this; + } + + /** + * Get the tierToHot property: The function to tier blobs to hot storage. This action can only be used with Premium + * Block Blob Storage Accounts. + * + * @return the tierToHot value. + */ + public DateAfterModification tierToHot() { + return this.tierToHot; + } + + /** + * Set the tierToHot property: The function to tier blobs to hot storage. This action can only be used with Premium + * Block Blob Storage Accounts. + * + * @param tierToHot the tierToHot value to set. + * @return the ManagementPolicyBaseBlob object itself. + */ + public ManagementPolicyBaseBlob withTierToHot(DateAfterModification tierToHot) { + this.tierToHot = tierToHot; + return this; + } + + /** + * Get the delete property: The function to delete the blob. + * + * @return the delete value. + */ + public DateAfterModification delete() { + return this.delete; + } + + /** + * Set the delete property: The function to delete the blob. + * + * @param delete the delete value to set. + * @return the ManagementPolicyBaseBlob object itself. + */ + public ManagementPolicyBaseBlob withDelete(DateAfterModification delete) { + this.delete = delete; + return this; + } + + /** + * Get the enableAutoTierToHotFromCool property: This property enables auto tiering of a blob from cool to hot on a + * blob access. This property requires tierToCool.daysAfterLastAccessTimeGreaterThan. + * + * @return the enableAutoTierToHotFromCool value. + */ + public Boolean enableAutoTierToHotFromCool() { + return this.enableAutoTierToHotFromCool; + } + + /** + * Set the enableAutoTierToHotFromCool property: This property enables auto tiering of a blob from cool to hot on a + * blob access. This property requires tierToCool.daysAfterLastAccessTimeGreaterThan. + * + * @param enableAutoTierToHotFromCool the enableAutoTierToHotFromCool value to set. + * @return the ManagementPolicyBaseBlob object itself. + */ + public ManagementPolicyBaseBlob withEnableAutoTierToHotFromCool(Boolean enableAutoTierToHotFromCool) { + this.enableAutoTierToHotFromCool = enableAutoTierToHotFromCool; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tierToCool() != null) { + tierToCool().validate(); + } + if (tierToArchive() != null) { + tierToArchive().validate(); + } + if (tierToCold() != null) { + tierToCold().validate(); + } + if (tierToHot() != null) { + tierToHot().validate(); + } + if (delete() != null) { + delete().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("tierToCool", this.tierToCool); + jsonWriter.writeJsonField("tierToArchive", this.tierToArchive); + jsonWriter.writeJsonField("tierToCold", this.tierToCold); + jsonWriter.writeJsonField("tierToHot", this.tierToHot); + jsonWriter.writeJsonField("delete", this.delete); + jsonWriter.writeBooleanField("enableAutoTierToHotFromCool", this.enableAutoTierToHotFromCool); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagementPolicyBaseBlob from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementPolicyBaseBlob 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 ManagementPolicyBaseBlob. + */ + public static ManagementPolicyBaseBlob fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementPolicyBaseBlob deserializedManagementPolicyBaseBlob = new ManagementPolicyBaseBlob(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tierToCool".equals(fieldName)) { + deserializedManagementPolicyBaseBlob.tierToCool = DateAfterModification.fromJson(reader); + } else if ("tierToArchive".equals(fieldName)) { + deserializedManagementPolicyBaseBlob.tierToArchive = DateAfterModification.fromJson(reader); + } else if ("tierToCold".equals(fieldName)) { + deserializedManagementPolicyBaseBlob.tierToCold = DateAfterModification.fromJson(reader); + } else if ("tierToHot".equals(fieldName)) { + deserializedManagementPolicyBaseBlob.tierToHot = DateAfterModification.fromJson(reader); + } else if ("delete".equals(fieldName)) { + deserializedManagementPolicyBaseBlob.delete = DateAfterModification.fromJson(reader); + } else if ("enableAutoTierToHotFromCool".equals(fieldName)) { + deserializedManagementPolicyBaseBlob.enableAutoTierToHotFromCool + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedManagementPolicyBaseBlob; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyDefinition.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyDefinition.java new file mode 100644 index 0000000000000..2578d1f60f1d0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyDefinition.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * An object that defines the Lifecycle rule. Each definition is made up with a filters set and an actions set. + */ +@Fluent +public final class ManagementPolicyDefinition implements JsonSerializable { + /* + * An object that defines the action set. + */ + private ManagementPolicyAction actions; + + /* + * An object that defines the filter set. + */ + private ManagementPolicyFilter filters; + + /** + * Creates an instance of ManagementPolicyDefinition class. + */ + public ManagementPolicyDefinition() { + } + + /** + * Get the actions property: An object that defines the action set. + * + * @return the actions value. + */ + public ManagementPolicyAction actions() { + return this.actions; + } + + /** + * Set the actions property: An object that defines the action set. + * + * @param actions the actions value to set. + * @return the ManagementPolicyDefinition object itself. + */ + public ManagementPolicyDefinition withActions(ManagementPolicyAction actions) { + this.actions = actions; + return this; + } + + /** + * Get the filters property: An object that defines the filter set. + * + * @return the filters value. + */ + public ManagementPolicyFilter filters() { + return this.filters; + } + + /** + * Set the filters property: An object that defines the filter set. + * + * @param filters the filters value to set. + * @return the ManagementPolicyDefinition object itself. + */ + public ManagementPolicyDefinition withFilters(ManagementPolicyFilter filters) { + this.filters = filters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (actions() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property actions in model ManagementPolicyDefinition")); + } else { + actions().validate(); + } + if (filters() != null) { + filters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagementPolicyDefinition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("actions", this.actions); + jsonWriter.writeJsonField("filters", this.filters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagementPolicyDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementPolicyDefinition 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 ManagementPolicyDefinition. + */ + public static ManagementPolicyDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementPolicyDefinition deserializedManagementPolicyDefinition = new ManagementPolicyDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("actions".equals(fieldName)) { + deserializedManagementPolicyDefinition.actions = ManagementPolicyAction.fromJson(reader); + } else if ("filters".equals(fieldName)) { + deserializedManagementPolicyDefinition.filters = ManagementPolicyFilter.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagementPolicyDefinition; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyFilter.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyFilter.java new file mode 100644 index 0000000000000..94657e7e9ba21 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyFilter.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.List; + +/** + * Filters limit rule actions to a subset of blobs within the storage account. If multiple filters are defined, a + * logical AND is performed on all filters. + */ +@Fluent +public final class ManagementPolicyFilter implements JsonSerializable { + /* + * An array of strings for prefixes to be match. + */ + private List prefixMatch; + + /* + * An array of predefined enum values. Currently blockBlob supports all tiering and delete actions. Only delete + * actions are supported for appendBlob. + */ + private List blobTypes; + + /* + * An array of blob index tag based filters, there can be at most 10 tag filters + */ + private List blobIndexMatch; + + /** + * Creates an instance of ManagementPolicyFilter class. + */ + public ManagementPolicyFilter() { + } + + /** + * Get the prefixMatch property: An array of strings for prefixes to be match. + * + * @return the prefixMatch value. + */ + public List prefixMatch() { + return this.prefixMatch; + } + + /** + * Set the prefixMatch property: An array of strings for prefixes to be match. + * + * @param prefixMatch the prefixMatch value to set. + * @return the ManagementPolicyFilter object itself. + */ + public ManagementPolicyFilter withPrefixMatch(List prefixMatch) { + this.prefixMatch = prefixMatch; + return this; + } + + /** + * Get the blobTypes property: An array of predefined enum values. Currently blockBlob supports all tiering and + * delete actions. Only delete actions are supported for appendBlob. + * + * @return the blobTypes value. + */ + public List blobTypes() { + return this.blobTypes; + } + + /** + * Set the blobTypes property: An array of predefined enum values. Currently blockBlob supports all tiering and + * delete actions. Only delete actions are supported for appendBlob. + * + * @param blobTypes the blobTypes value to set. + * @return the ManagementPolicyFilter object itself. + */ + public ManagementPolicyFilter withBlobTypes(List blobTypes) { + this.blobTypes = blobTypes; + return this; + } + + /** + * Get the blobIndexMatch property: An array of blob index tag based filters, there can be at most 10 tag filters. + * + * @return the blobIndexMatch value. + */ + public List blobIndexMatch() { + return this.blobIndexMatch; + } + + /** + * Set the blobIndexMatch property: An array of blob index tag based filters, there can be at most 10 tag filters. + * + * @param blobIndexMatch the blobIndexMatch value to set. + * @return the ManagementPolicyFilter object itself. + */ + public ManagementPolicyFilter withBlobIndexMatch(List blobIndexMatch) { + this.blobIndexMatch = blobIndexMatch; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (blobTypes() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property blobTypes in model ManagementPolicyFilter")); + } + if (blobIndexMatch() != null) { + blobIndexMatch().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagementPolicyFilter.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("blobTypes", this.blobTypes, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("prefixMatch", this.prefixMatch, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("blobIndexMatch", this.blobIndexMatch, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagementPolicyFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementPolicyFilter 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 ManagementPolicyFilter. + */ + public static ManagementPolicyFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementPolicyFilter deserializedManagementPolicyFilter = new ManagementPolicyFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("blobTypes".equals(fieldName)) { + List blobTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedManagementPolicyFilter.blobTypes = blobTypes; + } else if ("prefixMatch".equals(fieldName)) { + List prefixMatch = reader.readArray(reader1 -> reader1.getString()); + deserializedManagementPolicyFilter.prefixMatch = prefixMatch; + } else if ("blobIndexMatch".equals(fieldName)) { + List blobIndexMatch = reader.readArray(reader1 -> TagFilter.fromJson(reader1)); + deserializedManagementPolicyFilter.blobIndexMatch = blobIndexMatch; + } else { + reader.skipChildren(); + } + } + + return deserializedManagementPolicyFilter; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyName.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyName.java new file mode 100644 index 0000000000000..15cf73bb03b3e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyName.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for ManagementPolicyName. + */ +public final class ManagementPolicyName extends ExpandableStringEnum { + /** + * Static value default for ManagementPolicyName. + */ + public static final ManagementPolicyName DEFAULT = fromString("default"); + + /** + * Creates a new instance of ManagementPolicyName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagementPolicyName() { + } + + /** + * Creates or finds a ManagementPolicyName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagementPolicyName. + */ + public static ManagementPolicyName fromString(String name) { + return fromString(name, ManagementPolicyName.class); + } + + /** + * Gets known ManagementPolicyName values. + * + * @return known ManagementPolicyName values. + */ + public static Collection values() { + return values(ManagementPolicyName.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyRule.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyRule.java new file mode 100644 index 0000000000000..ac712300a581a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyRule.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * An object that wraps the Lifecycle rule. Each rule is uniquely defined by name. + */ +@Fluent +public final class ManagementPolicyRule implements JsonSerializable { + /* + * Rule is enabled if set to true. + */ + private Boolean enabled; + + /* + * A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be + * unique within a policy. + */ + private String name; + + /* + * The valid value is Lifecycle + */ + private RuleType type; + + /* + * An object that defines the Lifecycle rule. + */ + private ManagementPolicyDefinition definition; + + /** + * Creates an instance of ManagementPolicyRule class. + */ + public ManagementPolicyRule() { + } + + /** + * Get the enabled property: Rule is enabled if set to true. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Rule is enabled if set to true. + * + * @param enabled the enabled value to set. + * @return the ManagementPolicyRule object itself. + */ + public ManagementPolicyRule withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the name property: A rule name can contain any combination of alpha numeric characters. Rule name is + * case-sensitive. It must be unique within a policy. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A rule name can contain any combination of alpha numeric characters. Rule name is + * case-sensitive. It must be unique within a policy. + * + * @param name the name value to set. + * @return the ManagementPolicyRule object itself. + */ + public ManagementPolicyRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The valid value is Lifecycle. + * + * @return the type value. + */ + public RuleType type() { + return this.type; + } + + /** + * Set the type property: The valid value is Lifecycle. + * + * @param type the type value to set. + * @return the ManagementPolicyRule object itself. + */ + public ManagementPolicyRule withType(RuleType type) { + this.type = type; + return this; + } + + /** + * Get the definition property: An object that defines the Lifecycle rule. + * + * @return the definition value. + */ + public ManagementPolicyDefinition definition() { + return this.definition; + } + + /** + * Set the definition property: An object that defines the Lifecycle rule. + * + * @param definition the definition value to set. + * @return the ManagementPolicyRule object itself. + */ + public ManagementPolicyRule withDefinition(ManagementPolicyDefinition definition) { + this.definition = definition; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model ManagementPolicyRule")); + } + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model ManagementPolicyRule")); + } + if (definition() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property definition in model ManagementPolicyRule")); + } else { + definition().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagementPolicyRule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeJsonField("definition", this.definition); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagementPolicyRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementPolicyRule 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 ManagementPolicyRule. + */ + public static ManagementPolicyRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementPolicyRule deserializedManagementPolicyRule = new ManagementPolicyRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedManagementPolicyRule.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedManagementPolicyRule.type = RuleType.fromString(reader.getString()); + } else if ("definition".equals(fieldName)) { + deserializedManagementPolicyRule.definition = ManagementPolicyDefinition.fromJson(reader); + } else if ("enabled".equals(fieldName)) { + deserializedManagementPolicyRule.enabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedManagementPolicyRule; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicySchema.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicySchema.java new file mode 100644 index 0000000000000..1314ab5bf16bc --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicySchema.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.List; + +/** + * The Storage Account ManagementPolicies Rules. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + */ +@Fluent +public final class ManagementPolicySchema implements JsonSerializable { + /* + * The Storage Account ManagementPolicies Rules. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + */ + private List rules; + + /** + * Creates an instance of ManagementPolicySchema class. + */ + public ManagementPolicySchema() { + } + + /** + * Get the rules property: The Storage Account ManagementPolicies Rules. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: The Storage Account ManagementPolicies Rules. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + * + * @param rules the rules value to set. + * @return the ManagementPolicySchema object itself. + */ + public ManagementPolicySchema withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property rules in model ManagementPolicySchema")); + } else { + rules().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagementPolicySchema.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagementPolicySchema from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementPolicySchema 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 ManagementPolicySchema. + */ + public static ManagementPolicySchema fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementPolicySchema deserializedManagementPolicySchema = new ManagementPolicySchema(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("rules".equals(fieldName)) { + List rules + = reader.readArray(reader1 -> ManagementPolicyRule.fromJson(reader1)); + deserializedManagementPolicySchema.rules = rules; + } else { + reader.skipChildren(); + } + } + + return deserializedManagementPolicySchema; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicySnapShot.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicySnapShot.java new file mode 100644 index 0000000000000..0a9d3a56ba9bd --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicySnapShot.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Management policy action for snapshot. + */ +@Fluent +public final class ManagementPolicySnapShot implements JsonSerializable { + /* + * The function to tier blob snapshot to cool storage. + */ + private DateAfterCreation tierToCool; + + /* + * The function to tier blob snapshot to archive storage. + */ + private DateAfterCreation tierToArchive; + + /* + * The function to tier blobs to cold storage. + */ + private DateAfterCreation tierToCold; + + /* + * The function to tier blobs to hot storage. This action can only be used with Premium Block Blob Storage Accounts + */ + private DateAfterCreation tierToHot; + + /* + * The function to delete the blob snapshot + */ + private DateAfterCreation delete; + + /** + * Creates an instance of ManagementPolicySnapShot class. + */ + public ManagementPolicySnapShot() { + } + + /** + * Get the tierToCool property: The function to tier blob snapshot to cool storage. + * + * @return the tierToCool value. + */ + public DateAfterCreation tierToCool() { + return this.tierToCool; + } + + /** + * Set the tierToCool property: The function to tier blob snapshot to cool storage. + * + * @param tierToCool the tierToCool value to set. + * @return the ManagementPolicySnapShot object itself. + */ + public ManagementPolicySnapShot withTierToCool(DateAfterCreation tierToCool) { + this.tierToCool = tierToCool; + return this; + } + + /** + * Get the tierToArchive property: The function to tier blob snapshot to archive storage. + * + * @return the tierToArchive value. + */ + public DateAfterCreation tierToArchive() { + return this.tierToArchive; + } + + /** + * Set the tierToArchive property: The function to tier blob snapshot to archive storage. + * + * @param tierToArchive the tierToArchive value to set. + * @return the ManagementPolicySnapShot object itself. + */ + public ManagementPolicySnapShot withTierToArchive(DateAfterCreation tierToArchive) { + this.tierToArchive = tierToArchive; + return this; + } + + /** + * Get the tierToCold property: The function to tier blobs to cold storage. + * + * @return the tierToCold value. + */ + public DateAfterCreation tierToCold() { + return this.tierToCold; + } + + /** + * Set the tierToCold property: The function to tier blobs to cold storage. + * + * @param tierToCold the tierToCold value to set. + * @return the ManagementPolicySnapShot object itself. + */ + public ManagementPolicySnapShot withTierToCold(DateAfterCreation tierToCold) { + this.tierToCold = tierToCold; + return this; + } + + /** + * Get the tierToHot property: The function to tier blobs to hot storage. This action can only be used with Premium + * Block Blob Storage Accounts. + * + * @return the tierToHot value. + */ + public DateAfterCreation tierToHot() { + return this.tierToHot; + } + + /** + * Set the tierToHot property: The function to tier blobs to hot storage. This action can only be used with Premium + * Block Blob Storage Accounts. + * + * @param tierToHot the tierToHot value to set. + * @return the ManagementPolicySnapShot object itself. + */ + public ManagementPolicySnapShot withTierToHot(DateAfterCreation tierToHot) { + this.tierToHot = tierToHot; + return this; + } + + /** + * Get the delete property: The function to delete the blob snapshot. + * + * @return the delete value. + */ + public DateAfterCreation delete() { + return this.delete; + } + + /** + * Set the delete property: The function to delete the blob snapshot. + * + * @param delete the delete value to set. + * @return the ManagementPolicySnapShot object itself. + */ + public ManagementPolicySnapShot withDelete(DateAfterCreation delete) { + this.delete = delete; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tierToCool() != null) { + tierToCool().validate(); + } + if (tierToArchive() != null) { + tierToArchive().validate(); + } + if (tierToCold() != null) { + tierToCold().validate(); + } + if (tierToHot() != null) { + tierToHot().validate(); + } + if (delete() != null) { + delete().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("tierToCool", this.tierToCool); + jsonWriter.writeJsonField("tierToArchive", this.tierToArchive); + jsonWriter.writeJsonField("tierToCold", this.tierToCold); + jsonWriter.writeJsonField("tierToHot", this.tierToHot); + jsonWriter.writeJsonField("delete", this.delete); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagementPolicySnapShot from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementPolicySnapShot 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 ManagementPolicySnapShot. + */ + public static ManagementPolicySnapShot fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementPolicySnapShot deserializedManagementPolicySnapShot = new ManagementPolicySnapShot(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tierToCool".equals(fieldName)) { + deserializedManagementPolicySnapShot.tierToCool = DateAfterCreation.fromJson(reader); + } else if ("tierToArchive".equals(fieldName)) { + deserializedManagementPolicySnapShot.tierToArchive = DateAfterCreation.fromJson(reader); + } else if ("tierToCold".equals(fieldName)) { + deserializedManagementPolicySnapShot.tierToCold = DateAfterCreation.fromJson(reader); + } else if ("tierToHot".equals(fieldName)) { + deserializedManagementPolicySnapShot.tierToHot = DateAfterCreation.fromJson(reader); + } else if ("delete".equals(fieldName)) { + deserializedManagementPolicySnapShot.delete = DateAfterCreation.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagementPolicySnapShot; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyVersion.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyVersion.java new file mode 100644 index 0000000000000..3436a3b3dfcf8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyVersion.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Management policy action for blob version. + */ +@Fluent +public final class ManagementPolicyVersion implements JsonSerializable { + /* + * The function to tier blob version to cool storage. + */ + private DateAfterCreation tierToCool; + + /* + * The function to tier blob version to archive storage. + */ + private DateAfterCreation tierToArchive; + + /* + * The function to tier blobs to cold storage. + */ + private DateAfterCreation tierToCold; + + /* + * The function to tier blobs to hot storage. This action can only be used with Premium Block Blob Storage Accounts + */ + private DateAfterCreation tierToHot; + + /* + * The function to delete the blob version + */ + private DateAfterCreation delete; + + /** + * Creates an instance of ManagementPolicyVersion class. + */ + public ManagementPolicyVersion() { + } + + /** + * Get the tierToCool property: The function to tier blob version to cool storage. + * + * @return the tierToCool value. + */ + public DateAfterCreation tierToCool() { + return this.tierToCool; + } + + /** + * Set the tierToCool property: The function to tier blob version to cool storage. + * + * @param tierToCool the tierToCool value to set. + * @return the ManagementPolicyVersion object itself. + */ + public ManagementPolicyVersion withTierToCool(DateAfterCreation tierToCool) { + this.tierToCool = tierToCool; + return this; + } + + /** + * Get the tierToArchive property: The function to tier blob version to archive storage. + * + * @return the tierToArchive value. + */ + public DateAfterCreation tierToArchive() { + return this.tierToArchive; + } + + /** + * Set the tierToArchive property: The function to tier blob version to archive storage. + * + * @param tierToArchive the tierToArchive value to set. + * @return the ManagementPolicyVersion object itself. + */ + public ManagementPolicyVersion withTierToArchive(DateAfterCreation tierToArchive) { + this.tierToArchive = tierToArchive; + return this; + } + + /** + * Get the tierToCold property: The function to tier blobs to cold storage. + * + * @return the tierToCold value. + */ + public DateAfterCreation tierToCold() { + return this.tierToCold; + } + + /** + * Set the tierToCold property: The function to tier blobs to cold storage. + * + * @param tierToCold the tierToCold value to set. + * @return the ManagementPolicyVersion object itself. + */ + public ManagementPolicyVersion withTierToCold(DateAfterCreation tierToCold) { + this.tierToCold = tierToCold; + return this; + } + + /** + * Get the tierToHot property: The function to tier blobs to hot storage. This action can only be used with Premium + * Block Blob Storage Accounts. + * + * @return the tierToHot value. + */ + public DateAfterCreation tierToHot() { + return this.tierToHot; + } + + /** + * Set the tierToHot property: The function to tier blobs to hot storage. This action can only be used with Premium + * Block Blob Storage Accounts. + * + * @param tierToHot the tierToHot value to set. + * @return the ManagementPolicyVersion object itself. + */ + public ManagementPolicyVersion withTierToHot(DateAfterCreation tierToHot) { + this.tierToHot = tierToHot; + return this; + } + + /** + * Get the delete property: The function to delete the blob version. + * + * @return the delete value. + */ + public DateAfterCreation delete() { + return this.delete; + } + + /** + * Set the delete property: The function to delete the blob version. + * + * @param delete the delete value to set. + * @return the ManagementPolicyVersion object itself. + */ + public ManagementPolicyVersion withDelete(DateAfterCreation delete) { + this.delete = delete; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tierToCool() != null) { + tierToCool().validate(); + } + if (tierToArchive() != null) { + tierToArchive().validate(); + } + if (tierToCold() != null) { + tierToCold().validate(); + } + if (tierToHot() != null) { + tierToHot().validate(); + } + if (delete() != null) { + delete().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("tierToCool", this.tierToCool); + jsonWriter.writeJsonField("tierToArchive", this.tierToArchive); + jsonWriter.writeJsonField("tierToCold", this.tierToCold); + jsonWriter.writeJsonField("tierToHot", this.tierToHot); + jsonWriter.writeJsonField("delete", this.delete); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagementPolicyVersion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementPolicyVersion 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 ManagementPolicyVersion. + */ + public static ManagementPolicyVersion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementPolicyVersion deserializedManagementPolicyVersion = new ManagementPolicyVersion(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tierToCool".equals(fieldName)) { + deserializedManagementPolicyVersion.tierToCool = DateAfterCreation.fromJson(reader); + } else if ("tierToArchive".equals(fieldName)) { + deserializedManagementPolicyVersion.tierToArchive = DateAfterCreation.fromJson(reader); + } else if ("tierToCold".equals(fieldName)) { + deserializedManagementPolicyVersion.tierToCold = DateAfterCreation.fromJson(reader); + } else if ("tierToHot".equals(fieldName)) { + deserializedManagementPolicyVersion.tierToHot = DateAfterCreation.fromJson(reader); + } else if ("delete".equals(fieldName)) { + deserializedManagementPolicyVersion.delete = DateAfterCreation.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagementPolicyVersion; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MetricSpecification.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MetricSpecification.java new file mode 100644 index 0000000000000..effe0630a3d5b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MetricSpecification.java @@ -0,0 +1,322 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.List; + +/** + * Metric specification of operation. + */ +@Fluent +public final class MetricSpecification implements JsonSerializable { + /* + * Name of metric specification. + */ + private String name; + + /* + * Display name of metric specification. + */ + private String displayName; + + /* + * Display description of metric specification. + */ + private String displayDescription; + + /* + * Unit could be Bytes or Count. + */ + private String unit; + + /* + * Dimensions of blobs, including blob type and access tier. + */ + private List dimensions; + + /* + * Aggregation type could be Average. + */ + private String aggregationType; + + /* + * The property to decide fill gap with zero or not. + */ + private Boolean fillGapWithZero; + + /* + * The category this metric specification belong to, could be Capacity. + */ + private String category; + + /* + * Account Resource Id. + */ + private String resourceIdDimensionNameOverride; + + /** + * Creates an instance of MetricSpecification class. + */ + public MetricSpecification() { + } + + /** + * Get the name property: Name of metric specification. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of metric specification. + * + * @param name the name value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Display name of metric specification. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of metric specification. + * + * @param displayName the displayName value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the displayDescription property: Display description of metric specification. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: Display description of metric specification. + * + * @param displayDescription the displayDescription value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get the unit property: Unit could be Bytes or Count. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: Unit could be Bytes or Count. + * + * @param unit the unit value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the dimensions property: Dimensions of blobs, including blob type and access tier. + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: Dimensions of blobs, including blob type and access tier. + * + * @param dimensions the dimensions value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get the aggregationType property: Aggregation type could be Average. + * + * @return the aggregationType value. + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set the aggregationType property: Aggregation type could be Average. + * + * @param aggregationType the aggregationType value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get the fillGapWithZero property: The property to decide fill gap with zero or not. + * + * @return the fillGapWithZero value. + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set the fillGapWithZero property: The property to decide fill gap with zero or not. + * + * @param fillGapWithZero the fillGapWithZero value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get the category property: The category this metric specification belong to, could be Capacity. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Set the category property: The category this metric specification belong to, could be Capacity. + * + * @param category the category value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get the resourceIdDimensionNameOverride property: Account Resource Id. + * + * @return the resourceIdDimensionNameOverride value. + */ + public String resourceIdDimensionNameOverride() { + return this.resourceIdDimensionNameOverride; + } + + /** + * Set the resourceIdDimensionNameOverride property: Account Resource Id. + * + * @param resourceIdDimensionNameOverride the resourceIdDimensionNameOverride value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withResourceIdDimensionNameOverride(String resourceIdDimensionNameOverride) { + this.resourceIdDimensionNameOverride = resourceIdDimensionNameOverride; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("displayDescription", this.displayDescription); + jsonWriter.writeStringField("unit", this.unit); + jsonWriter.writeArrayField("dimensions", this.dimensions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("aggregationType", this.aggregationType); + jsonWriter.writeBooleanField("fillGapWithZero", this.fillGapWithZero); + jsonWriter.writeStringField("category", this.category); + jsonWriter.writeStringField("resourceIdDimensionNameOverride", this.resourceIdDimensionNameOverride); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricSpecification 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 MetricSpecification. + */ + public static MetricSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricSpecification deserializedMetricSpecification = new MetricSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedMetricSpecification.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMetricSpecification.displayName = reader.getString(); + } else if ("displayDescription".equals(fieldName)) { + deserializedMetricSpecification.displayDescription = reader.getString(); + } else if ("unit".equals(fieldName)) { + deserializedMetricSpecification.unit = reader.getString(); + } else if ("dimensions".equals(fieldName)) { + List dimensions = reader.readArray(reader1 -> Dimension.fromJson(reader1)); + deserializedMetricSpecification.dimensions = dimensions; + } else if ("aggregationType".equals(fieldName)) { + deserializedMetricSpecification.aggregationType = reader.getString(); + } else if ("fillGapWithZero".equals(fieldName)) { + deserializedMetricSpecification.fillGapWithZero = reader.getNullable(JsonReader::getBoolean); + } else if ("category".equals(fieldName)) { + deserializedMetricSpecification.category = reader.getString(); + } else if ("resourceIdDimensionNameOverride".equals(fieldName)) { + deserializedMetricSpecification.resourceIdDimensionNameOverride = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMetricSpecification; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MigrationName.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MigrationName.java new file mode 100644 index 0000000000000..7a0179ce93447 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MigrationName.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for MigrationName. + */ +public final class MigrationName extends ExpandableStringEnum { + /** + * Static value default for MigrationName. + */ + public static final MigrationName DEFAULT = fromString("default"); + + /** + * Creates a new instance of MigrationName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MigrationName() { + } + + /** + * Creates or finds a MigrationName from its string representation. + * + * @param name a name to look for. + * @return the corresponding MigrationName. + */ + public static MigrationName fromString(String name) { + return fromString(name, MigrationName.class); + } + + /** + * Gets known MigrationName values. + * + * @return known MigrationName values. + */ + public static Collection values() { + return values(MigrationName.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MigrationState.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MigrationState.java new file mode 100644 index 0000000000000..b72af4f0cf3fb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MigrationState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * This property denotes the container level immutability to object level immutability migration state. + */ +public final class MigrationState extends ExpandableStringEnum { + /** + * Static value InProgress for MigrationState. + */ + public static final MigrationState IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Completed for MigrationState. + */ + public static final MigrationState COMPLETED = fromString("Completed"); + + /** + * Creates a new instance of MigrationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MigrationState() { + } + + /** + * Creates or finds a MigrationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding MigrationState. + */ + public static MigrationState fromString(String name) { + return fromString(name, MigrationState.class); + } + + /** + * Gets known MigrationState values. + * + * @return known MigrationState values. + */ + public static Collection values() { + return values(MigrationState.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MigrationStatus.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MigrationStatus.java new file mode 100644 index 0000000000000..dfaa00af50d8b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MigrationStatus.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Current status of migration. + */ +public final class MigrationStatus extends ExpandableStringEnum { + /** + * Static value Invalid for MigrationStatus. + */ + public static final MigrationStatus INVALID = fromString("Invalid"); + + /** + * Static value SubmittedForConversion for MigrationStatus. + */ + public static final MigrationStatus SUBMITTED_FOR_CONVERSION = fromString("SubmittedForConversion"); + + /** + * Static value InProgress for MigrationStatus. + */ + public static final MigrationStatus IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Complete for MigrationStatus. + */ + public static final MigrationStatus COMPLETE = fromString("Complete"); + + /** + * Static value Failed for MigrationStatus. + */ + public static final MigrationStatus FAILED = fromString("Failed"); + + /** + * Creates a new instance of MigrationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MigrationStatus() { + } + + /** + * Creates or finds a MigrationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding MigrationStatus. + */ + public static MigrationStatus fromString(String name) { + return fromString(name, MigrationStatus.class); + } + + /** + * Gets known MigrationStatus values. + * + * @return known MigrationStatus values. + */ + public static Collection values() { + return values(MigrationStatus.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MinimumTlsVersion.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MinimumTlsVersion.java new file mode 100644 index 0000000000000..d2c0f8cfd7d4b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MinimumTlsVersion.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this + * property. + */ +public final class MinimumTlsVersion extends ExpandableStringEnum { + /** + * Static value TLS1_0 for MinimumTlsVersion. + */ + public static final MinimumTlsVersion TLS1_0 = fromString("TLS1_0"); + + /** + * Static value TLS1_1 for MinimumTlsVersion. + */ + public static final MinimumTlsVersion TLS1_1 = fromString("TLS1_1"); + + /** + * Static value TLS1_2 for MinimumTlsVersion. + */ + public static final MinimumTlsVersion TLS1_2 = fromString("TLS1_2"); + + /** + * Static value TLS1_3 for MinimumTlsVersion. + */ + public static final MinimumTlsVersion TLS1_3 = fromString("TLS1_3"); + + /** + * Creates a new instance of MinimumTlsVersion value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MinimumTlsVersion() { + } + + /** + * Creates or finds a MinimumTlsVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding MinimumTlsVersion. + */ + public static MinimumTlsVersion fromString(String name) { + return fromString(name, MinimumTlsVersion.class); + } + + /** + * Gets known MinimumTlsVersion values. + * + * @return known MinimumTlsVersion values. + */ + public static Collection values() { + return values(MinimumTlsVersion.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Multichannel.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Multichannel.java new file mode 100644 index 0000000000000..f6ee3ffce8171 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Multichannel.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Multichannel setting. Applies to Premium FileStorage only. + */ +@Fluent +public final class Multichannel implements JsonSerializable { + /* + * Indicates whether multichannel is enabled + */ + private Boolean enabled; + + /** + * Creates an instance of Multichannel class. + */ + public Multichannel() { + } + + /** + * Get the enabled property: Indicates whether multichannel is enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Indicates whether multichannel is enabled. + * + * @param enabled the enabled value to set. + * @return the Multichannel object itself. + */ + public Multichannel withEnabled(Boolean enabled) { + this.enabled = enabled; + 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.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Multichannel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Multichannel 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 Multichannel. + */ + public static Multichannel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Multichannel deserializedMultichannel = new Multichannel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedMultichannel.enabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedMultichannel; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Name.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Name.java new file mode 100644 index 0000000000000..40b89b4f78cb4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Name.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Name of the policy. The valid value is AccessTimeTracking. This field is currently read only. + */ +public final class Name extends ExpandableStringEnum { + /** + * Static value AccessTimeTracking for Name. + */ + public static final Name ACCESS_TIME_TRACKING = fromString("AccessTimeTracking"); + + /** + * Creates a new instance of Name value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Name() { + } + + /** + * Creates or finds a Name from its string representation. + * + * @param name a name to look for. + * @return the corresponding Name. + */ + public static Name fromString(String name) { + return fromString(name, Name.class); + } + + /** + * Gets known Name values. + * + * @return known Name values. + */ + public static Collection values() { + return values(Name.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkRuleSet.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkRuleSet.java new file mode 100644 index 0000000000000..ee071072cb329 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkRuleSet.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.List; + +/** + * Network rule set. + */ +@Fluent +public final class NetworkRuleSet implements JsonSerializable { + /* + * Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of + * Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. + */ + private Bypass bypass; + + /* + * Sets the resource access rules + */ + private List resourceAccessRules; + + /* + * Sets the virtual network rules + */ + private List virtualNetworkRules; + + /* + * Sets the IP ACL rules + */ + private List ipRules; + + /* + * Specifies the default action of allow or deny when no other rules match. + */ + private DefaultAction defaultAction; + + /** + * Creates an instance of NetworkRuleSet class. + */ + public NetworkRuleSet() { + } + + /** + * Get the bypass property: Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values + * are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of + * those traffics. + * + * @return the bypass value. + */ + public Bypass bypass() { + return this.bypass; + } + + /** + * Set the bypass property: Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values + * are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of + * those traffics. + * + * @param bypass the bypass value to set. + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withBypass(Bypass bypass) { + this.bypass = bypass; + return this; + } + + /** + * Get the resourceAccessRules property: Sets the resource access rules. + * + * @return the resourceAccessRules value. + */ + public List resourceAccessRules() { + return this.resourceAccessRules; + } + + /** + * Set the resourceAccessRules property: Sets the resource access rules. + * + * @param resourceAccessRules the resourceAccessRules value to set. + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withResourceAccessRules(List resourceAccessRules) { + this.resourceAccessRules = resourceAccessRules; + return this; + } + + /** + * Get the virtualNetworkRules property: Sets the virtual network rules. + * + * @return the virtualNetworkRules value. + */ + public List virtualNetworkRules() { + return this.virtualNetworkRules; + } + + /** + * Set the virtualNetworkRules property: Sets the virtual network rules. + * + * @param virtualNetworkRules the virtualNetworkRules value to set. + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withVirtualNetworkRules(List virtualNetworkRules) { + this.virtualNetworkRules = virtualNetworkRules; + return this; + } + + /** + * Get the ipRules property: Sets the IP ACL rules. + * + * @return the ipRules value. + */ + public List ipRules() { + return this.ipRules; + } + + /** + * Set the ipRules property: Sets the IP ACL rules. + * + * @param ipRules the ipRules value to set. + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withIpRules(List ipRules) { + this.ipRules = ipRules; + return this; + } + + /** + * Get the defaultAction property: Specifies the default action of allow or deny when no other rules match. + * + * @return the defaultAction value. + */ + public DefaultAction defaultAction() { + return this.defaultAction; + } + + /** + * Set the defaultAction property: Specifies the default action of allow or deny when no other rules match. + * + * @param defaultAction the defaultAction value to set. + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withDefaultAction(DefaultAction defaultAction) { + this.defaultAction = defaultAction; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceAccessRules() != null) { + resourceAccessRules().forEach(e -> e.validate()); + } + if (virtualNetworkRules() != null) { + virtualNetworkRules().forEach(e -> e.validate()); + } + if (ipRules() != null) { + ipRules().forEach(e -> e.validate()); + } + if (defaultAction() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property defaultAction in model NetworkRuleSet")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkRuleSet.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("defaultAction", this.defaultAction == null ? null : this.defaultAction.toString()); + jsonWriter.writeStringField("bypass", this.bypass == null ? null : this.bypass.toString()); + jsonWriter.writeArrayField("resourceAccessRules", this.resourceAccessRules, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("virtualNetworkRules", this.virtualNetworkRules, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ipRules", this.ipRules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkRuleSet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkRuleSet 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 NetworkRuleSet. + */ + public static NetworkRuleSet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkRuleSet deserializedNetworkRuleSet = new NetworkRuleSet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("defaultAction".equals(fieldName)) { + deserializedNetworkRuleSet.defaultAction = DefaultAction.fromString(reader.getString()); + } else if ("bypass".equals(fieldName)) { + deserializedNetworkRuleSet.bypass = Bypass.fromString(reader.getString()); + } else if ("resourceAccessRules".equals(fieldName)) { + List resourceAccessRules + = reader.readArray(reader1 -> ResourceAccessRule.fromJson(reader1)); + deserializedNetworkRuleSet.resourceAccessRules = resourceAccessRules; + } else if ("virtualNetworkRules".equals(fieldName)) { + List virtualNetworkRules + = reader.readArray(reader1 -> VirtualNetworkRule.fromJson(reader1)); + deserializedNetworkRuleSet.virtualNetworkRules = virtualNetworkRules; + } else if ("ipRules".equals(fieldName)) { + List ipRules = reader.readArray(reader1 -> IpRule.fromJson(reader1)); + deserializedNetworkRuleSet.ipRules = ipRules; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkRuleSet; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkSecurityPerimeter.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkSecurityPerimeter.java new file mode 100644 index 0000000000000..b0d673982e401 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkSecurityPerimeter.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * NetworkSecurityPerimeter related information. + */ +@Fluent +public final class NetworkSecurityPerimeter implements JsonSerializable { + /* + * The ARM identifier of the resource + */ + private String id; + + /* + * Guid of the resource + */ + private String perimeterGuid; + + /* + * Location of the resource + */ + private String location; + + /** + * Creates an instance of NetworkSecurityPerimeter class. + */ + public NetworkSecurityPerimeter() { + } + + /** + * Get the id property: The ARM identifier of the resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ARM identifier of the resource. + * + * @param id the id value to set. + * @return the NetworkSecurityPerimeter object itself. + */ + public NetworkSecurityPerimeter withId(String id) { + this.id = id; + return this; + } + + /** + * Get the perimeterGuid property: Guid of the resource. + * + * @return the perimeterGuid value. + */ + public String perimeterGuid() { + return this.perimeterGuid; + } + + /** + * Set the perimeterGuid property: Guid of the resource. + * + * @param perimeterGuid the perimeterGuid value to set. + * @return the NetworkSecurityPerimeter object itself. + */ + public NetworkSecurityPerimeter withPerimeterGuid(String perimeterGuid) { + this.perimeterGuid = perimeterGuid; + return this; + } + + /** + * Get the location property: Location of the resource. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Location of the resource. + * + * @param location the location value to set. + * @return the NetworkSecurityPerimeter object itself. + */ + public NetworkSecurityPerimeter withLocation(String location) { + this.location = location; + 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("id", this.id); + jsonWriter.writeStringField("perimeterGuid", this.perimeterGuid); + jsonWriter.writeStringField("location", this.location); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityPerimeter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityPerimeter 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 NetworkSecurityPerimeter. + */ + public static NetworkSecurityPerimeter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityPerimeter deserializedNetworkSecurityPerimeter = new NetworkSecurityPerimeter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNetworkSecurityPerimeter.id = reader.getString(); + } else if ("perimeterGuid".equals(fieldName)) { + deserializedNetworkSecurityPerimeter.perimeterGuid = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedNetworkSecurityPerimeter.location = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeter; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkSecurityPerimeterConfiguration.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkSecurityPerimeterConfiguration.java new file mode 100644 index 0000000000000..c6dd61eb5291b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkSecurityPerimeterConfiguration.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.storage.generated.fluent.models.NetworkSecurityPerimeterConfigurationInner; +import java.util.List; + +/** + * An immutable client-side representation of NetworkSecurityPerimeterConfiguration. + */ +public interface NetworkSecurityPerimeterConfiguration { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of Network Security Perimeter configuration propagation. + * + * @return the provisioningState value. + */ + NetworkSecurityPerimeterConfigurationProvisioningState provisioningState(); + + /** + * Gets the provisioningIssues property: List of Provisioning Issues if any. + * + * @return the provisioningIssues value. + */ + List provisioningIssues(); + + /** + * Gets the networkSecurityPerimeter property: NetworkSecurityPerimeter related information. + * + * @return the networkSecurityPerimeter value. + */ + NetworkSecurityPerimeter networkSecurityPerimeter(); + + /** + * Gets the resourceAssociation property: Information about resource association. + * + * @return the resourceAssociation value. + */ + NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation resourceAssociation(); + + /** + * Gets the profile property: Network Security Perimeter profile. + * + * @return the profile value. + */ + NetworkSecurityPerimeterConfigurationPropertiesProfile profile(); + + /** + * Gets the inner + * com.azure.resourcemanager.storage.generated.fluent.models.NetworkSecurityPerimeterConfigurationInner object. + * + * @return the inner object. + */ + NetworkSecurityPerimeterConfigurationInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkSecurityPerimeterConfigurationList.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkSecurityPerimeterConfigurationList.java new file mode 100644 index 0000000000000..370c3edbc1765 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkSecurityPerimeterConfigurationList.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 com.azure.resourcemanager.storage.generated.fluent.models.NetworkSecurityPerimeterConfigurationInner; +import java.io.IOException; +import java.util.List; + +/** + * Result of the List Network Security Perimeter configuration operation. + */ +@Fluent +public final class NetworkSecurityPerimeterConfigurationList + implements JsonSerializable { + /* + * A collection of Network Security Perimeter configurations + */ + private List value; + + /* + * The URI that can be used to request the next set of paged results. + */ + private String nextLink; + + /** + * Creates an instance of NetworkSecurityPerimeterConfigurationList class. + */ + public NetworkSecurityPerimeterConfigurationList() { + } + + /** + * Get the value property: A collection of Network Security Perimeter configurations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The URI that can be used to request the next set of paged results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next set of paged results. + * + * @param nextLink the nextLink value to set. + * @return the NetworkSecurityPerimeterConfigurationList object itself. + */ + public NetworkSecurityPerimeterConfigurationList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityPerimeterConfigurationList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityPerimeterConfigurationList 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 NetworkSecurityPerimeterConfigurationList. + */ + public static NetworkSecurityPerimeterConfigurationList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityPerimeterConfigurationList deserializedNetworkSecurityPerimeterConfigurationList + = new NetworkSecurityPerimeterConfigurationList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NetworkSecurityPerimeterConfigurationInner.fromJson(reader1)); + deserializedNetworkSecurityPerimeterConfigurationList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeterConfigurationList; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkSecurityPerimeterConfigurationPropertiesProfile.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkSecurityPerimeterConfigurationPropertiesProfile.java new file mode 100644 index 0000000000000..886d2fd574567 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkSecurityPerimeterConfigurationPropertiesProfile.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.List; + +/** + * Network Security Perimeter profile. + */ +@Fluent +public final class NetworkSecurityPerimeterConfigurationPropertiesProfile + implements JsonSerializable { + /* + * Name of the resource + */ + private String name; + + /* + * Current access rules version + */ + private Float accessRulesVersion; + + /* + * List of Access Rules + */ + private List accessRules; + + /* + * Diagnostic settings version + */ + private Float diagnosticSettingsVersion; + + /* + * Enabled logging categories + */ + private List enabledLogCategories; + + /** + * Creates an instance of NetworkSecurityPerimeterConfigurationPropertiesProfile class. + */ + public NetworkSecurityPerimeterConfigurationPropertiesProfile() { + } + + /** + * Get the name property: Name of the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the resource. + * + * @param name the name value to set. + * @return the NetworkSecurityPerimeterConfigurationPropertiesProfile object itself. + */ + public NetworkSecurityPerimeterConfigurationPropertiesProfile withName(String name) { + this.name = name; + return this; + } + + /** + * Get the accessRulesVersion property: Current access rules version. + * + * @return the accessRulesVersion value. + */ + public Float accessRulesVersion() { + return this.accessRulesVersion; + } + + /** + * Set the accessRulesVersion property: Current access rules version. + * + * @param accessRulesVersion the accessRulesVersion value to set. + * @return the NetworkSecurityPerimeterConfigurationPropertiesProfile object itself. + */ + public NetworkSecurityPerimeterConfigurationPropertiesProfile withAccessRulesVersion(Float accessRulesVersion) { + this.accessRulesVersion = accessRulesVersion; + return this; + } + + /** + * Get the accessRules property: List of Access Rules. + * + * @return the accessRules value. + */ + public List accessRules() { + return this.accessRules; + } + + /** + * Set the accessRules property: List of Access Rules. + * + * @param accessRules the accessRules value to set. + * @return the NetworkSecurityPerimeterConfigurationPropertiesProfile object itself. + */ + public NetworkSecurityPerimeterConfigurationPropertiesProfile withAccessRules(List accessRules) { + this.accessRules = accessRules; + return this; + } + + /** + * Get the diagnosticSettingsVersion property: Diagnostic settings version. + * + * @return the diagnosticSettingsVersion value. + */ + public Float diagnosticSettingsVersion() { + return this.diagnosticSettingsVersion; + } + + /** + * Set the diagnosticSettingsVersion property: Diagnostic settings version. + * + * @param diagnosticSettingsVersion the diagnosticSettingsVersion value to set. + * @return the NetworkSecurityPerimeterConfigurationPropertiesProfile object itself. + */ + public NetworkSecurityPerimeterConfigurationPropertiesProfile + withDiagnosticSettingsVersion(Float diagnosticSettingsVersion) { + this.diagnosticSettingsVersion = diagnosticSettingsVersion; + return this; + } + + /** + * Get the enabledLogCategories property: Enabled logging categories. + * + * @return the enabledLogCategories value. + */ + public List enabledLogCategories() { + return this.enabledLogCategories; + } + + /** + * Set the enabledLogCategories property: Enabled logging categories. + * + * @param enabledLogCategories the enabledLogCategories value to set. + * @return the NetworkSecurityPerimeterConfigurationPropertiesProfile object itself. + */ + public NetworkSecurityPerimeterConfigurationPropertiesProfile + withEnabledLogCategories(List enabledLogCategories) { + this.enabledLogCategories = enabledLogCategories; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (accessRules() != null) { + accessRules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("accessRulesVersion", this.accessRulesVersion); + jsonWriter.writeArrayField("accessRules", this.accessRules, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("diagnosticSettingsVersion", this.diagnosticSettingsVersion); + jsonWriter.writeArrayField("enabledLogCategories", this.enabledLogCategories, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityPerimeterConfigurationPropertiesProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityPerimeterConfigurationPropertiesProfile 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 NetworkSecurityPerimeterConfigurationPropertiesProfile. + */ + public static NetworkSecurityPerimeterConfigurationPropertiesProfile fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityPerimeterConfigurationPropertiesProfile deserializedNetworkSecurityPerimeterConfigurationPropertiesProfile + = new NetworkSecurityPerimeterConfigurationPropertiesProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationPropertiesProfile.name = reader.getString(); + } else if ("accessRulesVersion".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationPropertiesProfile.accessRulesVersion + = reader.getNullable(JsonReader::getFloat); + } else if ("accessRules".equals(fieldName)) { + List accessRules = reader.readArray(reader1 -> NspAccessRule.fromJson(reader1)); + deserializedNetworkSecurityPerimeterConfigurationPropertiesProfile.accessRules = accessRules; + } else if ("diagnosticSettingsVersion".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationPropertiesProfile.diagnosticSettingsVersion + = reader.getNullable(JsonReader::getFloat); + } else if ("enabledLogCategories".equals(fieldName)) { + List enabledLogCategories = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkSecurityPerimeterConfigurationPropertiesProfile.enabledLogCategories + = enabledLogCategories; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeterConfigurationPropertiesProfile; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.java new file mode 100644 index 0000000000000..f33752d858a33 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Information about resource association. + */ +@Fluent +public final class NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation + implements JsonSerializable { + /* + * Name of the resource association + */ + private String name; + + /* + * Access Mode of the resource association + */ + private ResourceAssociationAccessMode accessMode; + + /** + * Creates an instance of NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation class. + */ + public NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation() { + } + + /** + * Get the name property: Name of the resource association. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the resource association. + * + * @param name the name value to set. + * @return the NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation object itself. + */ + public NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the accessMode property: Access Mode of the resource association. + * + * @return the accessMode value. + */ + public ResourceAssociationAccessMode accessMode() { + return this.accessMode; + } + + /** + * Set the accessMode property: Access Mode of the resource association. + * + * @param accessMode the accessMode value to set. + * @return the NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation object itself. + */ + public NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation + withAccessMode(ResourceAssociationAccessMode accessMode) { + this.accessMode = accessMode; + 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("name", this.name); + jsonWriter.writeStringField("accessMode", this.accessMode == null ? null : this.accessMode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation 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 + * NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation. + */ + public static NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation deserializedNetworkSecurityPerimeterConfigurationPropertiesResourceAssociation + = new NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.name + = reader.getString(); + } else if ("accessMode".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.accessMode + = ResourceAssociationAccessMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeterConfigurationPropertiesResourceAssociation; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkSecurityPerimeterConfigurationProvisioningState.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkSecurityPerimeterConfigurationProvisioningState.java new file mode 100644 index 0000000000000..0609fcf73e67d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkSecurityPerimeterConfigurationProvisioningState.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning state of Network Security Perimeter configuration propagation. + */ +public final class NetworkSecurityPerimeterConfigurationProvisioningState + extends ExpandableStringEnum { + /** + * Static value Accepted for NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Static value Succeeded for NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Deleting for NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Canceled for NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of NetworkSecurityPerimeterConfigurationProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkSecurityPerimeterConfigurationProvisioningState() { + } + + /** + * Creates or finds a NetworkSecurityPerimeterConfigurationProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static NetworkSecurityPerimeterConfigurationProvisioningState fromString(String name) { + return fromString(name, NetworkSecurityPerimeterConfigurationProvisioningState.class); + } + + /** + * Gets known NetworkSecurityPerimeterConfigurationProvisioningState values. + * + * @return known NetworkSecurityPerimeterConfigurationProvisioningState values. + */ + public static Collection values() { + return values(NetworkSecurityPerimeterConfigurationProvisioningState.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkSecurityPerimeterConfigurations.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkSecurityPerimeterConfigurations.java new file mode 100644 index 0000000000000..d9201c6ed6de3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkSecurityPerimeterConfigurations.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 NetworkSecurityPerimeterConfigurations. + */ +public interface NetworkSecurityPerimeterConfigurations { + /** + * Gets list of effective NetworkSecurityPerimeterConfiguration for storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of effective NetworkSecurityPerimeterConfiguration for storage account as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Gets list of effective NetworkSecurityPerimeterConfiguration for storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of effective NetworkSecurityPerimeterConfiguration for storage account as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, + Context context); + + /** + * Gets effective NetworkSecurityPerimeterConfiguration for association. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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 effective NetworkSecurityPerimeterConfiguration for association along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName, Context context); + + /** + * Gets effective NetworkSecurityPerimeterConfiguration for association. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 effective NetworkSecurityPerimeterConfiguration for association. + */ + NetworkSecurityPerimeterConfiguration get(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName); + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 reconcile(String resourceGroupName, String accountName, String networkSecurityPerimeterConfigurationName); + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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 reconcile(String resourceGroupName, String accountName, String networkSecurityPerimeterConfigurationName, + Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NspAccessRule.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NspAccessRule.java new file mode 100644 index 0000000000000..fdee1686abc46 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NspAccessRule.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Information of Access Rule in Network Security Perimeter profile. + */ +@Fluent +public final class NspAccessRule implements JsonSerializable { + /* + * Name of the resource + */ + private String name; + + /* + * Properties of Access Rule + */ + private NspAccessRuleProperties properties; + + /** + * Creates an instance of NspAccessRule class. + */ + public NspAccessRule() { + } + + /** + * Get the name property: Name of the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the resource. + * + * @param name the name value to set. + * @return the NspAccessRule object itself. + */ + public NspAccessRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the properties property: Properties of Access Rule. + * + * @return the properties value. + */ + public NspAccessRuleProperties properties() { + return this.properties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NspAccessRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NspAccessRule 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 NspAccessRule. + */ + public static NspAccessRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NspAccessRule deserializedNspAccessRule = new NspAccessRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNspAccessRule.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedNspAccessRule.properties = NspAccessRuleProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNspAccessRule; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NspAccessRuleDirection.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NspAccessRuleDirection.java new file mode 100644 index 0000000000000..2358f98b8ac8a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NspAccessRuleDirection.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Direction of Access Rule. + */ +public final class NspAccessRuleDirection extends ExpandableStringEnum { + /** + * Static value Inbound for NspAccessRuleDirection. + */ + public static final NspAccessRuleDirection INBOUND = fromString("Inbound"); + + /** + * Static value Outbound for NspAccessRuleDirection. + */ + public static final NspAccessRuleDirection OUTBOUND = fromString("Outbound"); + + /** + * Creates a new instance of NspAccessRuleDirection value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NspAccessRuleDirection() { + } + + /** + * Creates or finds a NspAccessRuleDirection from its string representation. + * + * @param name a name to look for. + * @return the corresponding NspAccessRuleDirection. + */ + public static NspAccessRuleDirection fromString(String name) { + return fromString(name, NspAccessRuleDirection.class); + } + + /** + * Gets known NspAccessRuleDirection values. + * + * @return known NspAccessRuleDirection values. + */ + public static Collection values() { + return values(NspAccessRuleDirection.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NspAccessRuleProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NspAccessRuleProperties.java new file mode 100644 index 0000000000000..69cd0060e83d3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NspAccessRuleProperties.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.List; + +/** + * Properties of Access Rule. + */ +@Fluent +public final class NspAccessRuleProperties implements JsonSerializable { + /* + * Direction of Access Rule + */ + private NspAccessRuleDirection direction; + + /* + * Address prefixes in the CIDR format for inbound rules + */ + private List addressPrefixes; + + /* + * Subscriptions for inbound rules + */ + private List subscriptions; + + /* + * NetworkSecurityPerimeters for inbound rules + */ + private List networkSecurityPerimeters; + + /* + * FQDN for outbound rules + */ + private List fullyQualifiedDomainNames; + + /** + * Creates an instance of NspAccessRuleProperties class. + */ + public NspAccessRuleProperties() { + } + + /** + * Get the direction property: Direction of Access Rule. + * + * @return the direction value. + */ + public NspAccessRuleDirection direction() { + return this.direction; + } + + /** + * Set the direction property: Direction of Access Rule. + * + * @param direction the direction value to set. + * @return the NspAccessRuleProperties object itself. + */ + public NspAccessRuleProperties withDirection(NspAccessRuleDirection direction) { + this.direction = direction; + return this; + } + + /** + * Get the addressPrefixes property: Address prefixes in the CIDR format for inbound rules. + * + * @return the addressPrefixes value. + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Set the addressPrefixes property: Address prefixes in the CIDR format for inbound rules. + * + * @param addressPrefixes the addressPrefixes value to set. + * @return the NspAccessRuleProperties object itself. + */ + public NspAccessRuleProperties withAddressPrefixes(List addressPrefixes) { + this.addressPrefixes = addressPrefixes; + return this; + } + + /** + * Get the subscriptions property: Subscriptions for inbound rules. + * + * @return the subscriptions value. + */ + public List subscriptions() { + return this.subscriptions; + } + + /** + * Set the subscriptions property: Subscriptions for inbound rules. + * + * @param subscriptions the subscriptions value to set. + * @return the NspAccessRuleProperties object itself. + */ + public NspAccessRuleProperties withSubscriptions(List subscriptions) { + this.subscriptions = subscriptions; + return this; + } + + /** + * Get the networkSecurityPerimeters property: NetworkSecurityPerimeters for inbound rules. + * + * @return the networkSecurityPerimeters value. + */ + public List networkSecurityPerimeters() { + return this.networkSecurityPerimeters; + } + + /** + * Get the fullyQualifiedDomainNames property: FQDN for outbound rules. + * + * @return the fullyQualifiedDomainNames value. + */ + public List fullyQualifiedDomainNames() { + return this.fullyQualifiedDomainNames; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subscriptions() != null) { + subscriptions().forEach(e -> e.validate()); + } + if (networkSecurityPerimeters() != null) { + networkSecurityPerimeters().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("direction", this.direction == null ? null : this.direction.toString()); + jsonWriter.writeArrayField("addressPrefixes", this.addressPrefixes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("subscriptions", this.subscriptions, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NspAccessRuleProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NspAccessRuleProperties 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 NspAccessRuleProperties. + */ + public static NspAccessRuleProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NspAccessRuleProperties deserializedNspAccessRuleProperties = new NspAccessRuleProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("direction".equals(fieldName)) { + deserializedNspAccessRuleProperties.direction + = NspAccessRuleDirection.fromString(reader.getString()); + } else if ("addressPrefixes".equals(fieldName)) { + List addressPrefixes = reader.readArray(reader1 -> reader1.getString()); + deserializedNspAccessRuleProperties.addressPrefixes = addressPrefixes; + } else if ("subscriptions".equals(fieldName)) { + List subscriptions + = reader.readArray(reader1 -> NspAccessRulePropertiesSubscriptionsItem.fromJson(reader1)); + deserializedNspAccessRuleProperties.subscriptions = subscriptions; + } else if ("networkSecurityPerimeters".equals(fieldName)) { + List networkSecurityPerimeters + = reader.readArray(reader1 -> NetworkSecurityPerimeter.fromJson(reader1)); + deserializedNspAccessRuleProperties.networkSecurityPerimeters = networkSecurityPerimeters; + } else if ("fullyQualifiedDomainNames".equals(fieldName)) { + List fullyQualifiedDomainNames = reader.readArray(reader1 -> reader1.getString()); + deserializedNspAccessRuleProperties.fullyQualifiedDomainNames = fullyQualifiedDomainNames; + } else { + reader.skipChildren(); + } + } + + return deserializedNspAccessRuleProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NspAccessRulePropertiesSubscriptionsItem.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NspAccessRulePropertiesSubscriptionsItem.java new file mode 100644 index 0000000000000..bab7a8bfec6a9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NspAccessRulePropertiesSubscriptionsItem.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Subscription for inbound rule. + */ +@Fluent +public final class NspAccessRulePropertiesSubscriptionsItem + implements JsonSerializable { + /* + * The ARM identifier of subscription + */ + private String id; + + /** + * Creates an instance of NspAccessRulePropertiesSubscriptionsItem class. + */ + public NspAccessRulePropertiesSubscriptionsItem() { + } + + /** + * Get the id property: The ARM identifier of subscription. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ARM identifier of subscription. + * + * @param id the id value to set. + * @return the NspAccessRulePropertiesSubscriptionsItem object itself. + */ + public NspAccessRulePropertiesSubscriptionsItem withId(String id) { + this.id = id; + 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("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NspAccessRulePropertiesSubscriptionsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NspAccessRulePropertiesSubscriptionsItem 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 NspAccessRulePropertiesSubscriptionsItem. + */ + public static NspAccessRulePropertiesSubscriptionsItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NspAccessRulePropertiesSubscriptionsItem deserializedNspAccessRulePropertiesSubscriptionsItem + = new NspAccessRulePropertiesSubscriptionsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNspAccessRulePropertiesSubscriptionsItem.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNspAccessRulePropertiesSubscriptionsItem; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicies.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicies.java new file mode 100644 index 0000000000000..32fdae46785cb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicies.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 com.azure.resourcemanager.storage.generated.fluent.models.ObjectReplicationPolicyInner; +import java.io.IOException; +import java.util.List; + +/** + * List storage account object replication policies. + */ +@Fluent +public final class ObjectReplicationPolicies implements JsonSerializable { + /* + * The replication policy between two storage accounts. + */ + private List value; + + /** + * Creates an instance of ObjectReplicationPolicies class. + */ + public ObjectReplicationPolicies() { + } + + /** + * Get the value property: The replication policy between two storage accounts. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The replication policy between two storage accounts. + * + * @param value the value value to set. + * @return the ObjectReplicationPolicies object itself. + */ + public ObjectReplicationPolicies withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObjectReplicationPolicies from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObjectReplicationPolicies 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 ObjectReplicationPolicies. + */ + public static ObjectReplicationPolicies fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObjectReplicationPolicies deserializedObjectReplicationPolicies = new ObjectReplicationPolicies(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ObjectReplicationPolicyInner.fromJson(reader1)); + deserializedObjectReplicationPolicies.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedObjectReplicationPolicies; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPoliciesOperations.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPoliciesOperations.java new file mode 100644 index 0000000000000..1e6067939e0d1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPoliciesOperations.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 ObjectReplicationPoliciesOperations. + */ +public interface ObjectReplicationPoliciesOperations { + /** + * List the object replication policies associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account object replication policies as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List the object replication policies associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list storage account object replication policies as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure the policy + * on the destination account first. For the source account, provide the value of the policy ID that is returned + * when you download the policy that was defined on the destination account. The policy is downloaded as a JSON + * file. + * @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 object replication policy of the storage account by policy ID along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String accountName, + String objectReplicationPolicyId, Context context); + + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure the policy + * on the destination account first. For the source account, provide the value of the policy ID that is returned + * when you download the policy that was defined on the destination account. The policy is downloaded as a JSON + * file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 object replication policy of the storage account by policy ID. + */ + ObjectReplicationPolicy get(String resourceGroupName, String accountName, String objectReplicationPolicyId); + + /** + * Deletes the object replication policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure the policy + * on the destination account first. For the source account, provide the value of the policy ID that is returned + * when you download the policy that was defined on the destination account. The policy is downloaded as a JSON + * file. + * @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 Response}. + */ + Response deleteWithResponse(String resourceGroupName, String accountName, String objectReplicationPolicyId, + Context context); + + /** + * Deletes the object replication policy associated with the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param objectReplicationPolicyId For the destination account, provide the value 'default'. Configure the policy + * on the destination account first. For the source account, provide the value of the policy ID that is returned + * when you download the policy that was defined on the destination account. The policy is downloaded as a JSON + * file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String objectReplicationPolicyId); + + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the object replication policy of the storage account by policy ID along with {@link Response}. + */ + ObjectReplicationPolicy getById(String id); + + /** + * Get the object replication policy of the storage account by policy ID. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the object replication policy of the storage account by policy ID along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the object replication policy associated with the specified storage account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the object replication policy associated with the specified storage account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ObjectReplicationPolicy resource. + * + * @param name resource name. + * @return the first stage of the new ObjectReplicationPolicy definition. + */ + ObjectReplicationPolicy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicy.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicy.java new file mode 100644 index 0000000000000..df77b80e717bf --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicy.java @@ -0,0 +1,310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.ObjectReplicationPolicyInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * An immutable client-side representation of ObjectReplicationPolicy. + */ +public interface ObjectReplicationPolicy { + /** + * 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 policyId property: A unique id for object replication policy. + * + * @return the policyId value. + */ + String policyId(); + + /** + * Gets the enabledTime property: Indicates when the policy is enabled on the source account. + * + * @return the enabledTime value. + */ + OffsetDateTime enabledTime(); + + /** + * Gets the sourceAccount property: Required. Source account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * + * @return the sourceAccount value. + */ + String sourceAccount(); + + /** + * Gets the destinationAccount property: Required. Destination account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * + * @return the destinationAccount value. + */ + String destinationAccount(); + + /** + * Gets the rules property: The storage account object replication rules. + * + * @return the rules value. + */ + List rules(); + + /** + * Gets the metrics property: Optional. The object replication policy metrics feature options. + * + * @return the metrics value. + */ + ObjectReplicationPolicyPropertiesMetrics metrics(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.ObjectReplicationPolicyInner object. + * + * @return the inner object. + */ + ObjectReplicationPolicyInner innerModel(); + + /** + * The entirety of the ObjectReplicationPolicy definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The ObjectReplicationPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ObjectReplicationPolicy definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the ObjectReplicationPolicy definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the ObjectReplicationPolicy 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.WithSourceAccount, DefinitionStages.WithDestinationAccount, + DefinitionStages.WithRules, DefinitionStages.WithMetrics { + /** + * Executes the create request. + * + * @return the created resource. + */ + ObjectReplicationPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ObjectReplicationPolicy create(Context context); + } + + /** + * The stage of the ObjectReplicationPolicy definition allowing to specify sourceAccount. + */ + interface WithSourceAccount { + /** + * Specifies the sourceAccount property: Required. Source account name. It should be full resource id if + * allowCrossTenantReplication set to false.. + * + * @param sourceAccount Required. Source account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * @return the next definition stage. + */ + WithCreate withSourceAccount(String sourceAccount); + } + + /** + * The stage of the ObjectReplicationPolicy definition allowing to specify destinationAccount. + */ + interface WithDestinationAccount { + /** + * Specifies the destinationAccount property: Required. Destination account name. It should be full resource + * id if allowCrossTenantReplication set to false.. + * + * @param destinationAccount Required. Destination account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * @return the next definition stage. + */ + WithCreate withDestinationAccount(String destinationAccount); + } + + /** + * The stage of the ObjectReplicationPolicy definition allowing to specify rules. + */ + interface WithRules { + /** + * Specifies the rules property: The storage account object replication rules.. + * + * @param rules The storage account object replication rules. + * @return the next definition stage. + */ + WithCreate withRules(List rules); + } + + /** + * The stage of the ObjectReplicationPolicy definition allowing to specify metrics. + */ + interface WithMetrics { + /** + * Specifies the metrics property: Optional. The object replication policy metrics feature options.. + * + * @param metrics Optional. The object replication policy metrics feature options. + * @return the next definition stage. + */ + WithCreate withMetrics(ObjectReplicationPolicyPropertiesMetrics metrics); + } + } + + /** + * Begins update for the ObjectReplicationPolicy resource. + * + * @return the stage of resource update. + */ + ObjectReplicationPolicy.Update update(); + + /** + * The template for ObjectReplicationPolicy update. + */ + interface Update extends UpdateStages.WithSourceAccount, UpdateStages.WithDestinationAccount, + UpdateStages.WithRules, UpdateStages.WithMetrics { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ObjectReplicationPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ObjectReplicationPolicy apply(Context context); + } + + /** + * The ObjectReplicationPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the ObjectReplicationPolicy update allowing to specify sourceAccount. + */ + interface WithSourceAccount { + /** + * Specifies the sourceAccount property: Required. Source account name. It should be full resource id if + * allowCrossTenantReplication set to false.. + * + * @param sourceAccount Required. Source account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * @return the next definition stage. + */ + Update withSourceAccount(String sourceAccount); + } + + /** + * The stage of the ObjectReplicationPolicy update allowing to specify destinationAccount. + */ + interface WithDestinationAccount { + /** + * Specifies the destinationAccount property: Required. Destination account name. It should be full resource + * id if allowCrossTenantReplication set to false.. + * + * @param destinationAccount Required. Destination account name. It should be full resource id if + * allowCrossTenantReplication set to false. + * @return the next definition stage. + */ + Update withDestinationAccount(String destinationAccount); + } + + /** + * The stage of the ObjectReplicationPolicy update allowing to specify rules. + */ + interface WithRules { + /** + * Specifies the rules property: The storage account object replication rules.. + * + * @param rules The storage account object replication rules. + * @return the next definition stage. + */ + Update withRules(List rules); + } + + /** + * The stage of the ObjectReplicationPolicy update allowing to specify metrics. + */ + interface WithMetrics { + /** + * Specifies the metrics property: Optional. The object replication policy metrics feature options.. + * + * @param metrics Optional. The object replication policy metrics feature options. + * @return the next definition stage. + */ + Update withMetrics(ObjectReplicationPolicyPropertiesMetrics metrics); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ObjectReplicationPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ObjectReplicationPolicy refresh(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicyFilter.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicyFilter.java new file mode 100644 index 0000000000000..20b5af5d64214 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicyFilter.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.List; + +/** + * Filters limit replication to a subset of blobs within the storage account. A logical OR is performed on values in the + * filter. If multiple filters are defined, a logical AND is performed on all filters. + */ +@Fluent +public final class ObjectReplicationPolicyFilter implements JsonSerializable { + /* + * Optional. Filters the results to replicate only blobs whose names begin with the specified prefix. + */ + private List prefixMatch; + + /* + * Blobs created after the time will be replicated to the destination. It must be in datetime format + * 'yyyy-MM-ddTHH:mm:ssZ'. Example: 2020-02-19T16:05:00Z + */ + private String minCreationTime; + + /** + * Creates an instance of ObjectReplicationPolicyFilter class. + */ + public ObjectReplicationPolicyFilter() { + } + + /** + * Get the prefixMatch property: Optional. Filters the results to replicate only blobs whose names begin with the + * specified prefix. + * + * @return the prefixMatch value. + */ + public List prefixMatch() { + return this.prefixMatch; + } + + /** + * Set the prefixMatch property: Optional. Filters the results to replicate only blobs whose names begin with the + * specified prefix. + * + * @param prefixMatch the prefixMatch value to set. + * @return the ObjectReplicationPolicyFilter object itself. + */ + public ObjectReplicationPolicyFilter withPrefixMatch(List prefixMatch) { + this.prefixMatch = prefixMatch; + return this; + } + + /** + * Get the minCreationTime property: Blobs created after the time will be replicated to the destination. It must be + * in datetime format 'yyyy-MM-ddTHH:mm:ssZ'. Example: 2020-02-19T16:05:00Z. + * + * @return the minCreationTime value. + */ + public String minCreationTime() { + return this.minCreationTime; + } + + /** + * Set the minCreationTime property: Blobs created after the time will be replicated to the destination. It must be + * in datetime format 'yyyy-MM-ddTHH:mm:ssZ'. Example: 2020-02-19T16:05:00Z. + * + * @param minCreationTime the minCreationTime value to set. + * @return the ObjectReplicationPolicyFilter object itself. + */ + public ObjectReplicationPolicyFilter withMinCreationTime(String minCreationTime) { + this.minCreationTime = minCreationTime; + 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.writeArrayField("prefixMatch", this.prefixMatch, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("minCreationTime", this.minCreationTime); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObjectReplicationPolicyFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObjectReplicationPolicyFilter 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 ObjectReplicationPolicyFilter. + */ + public static ObjectReplicationPolicyFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObjectReplicationPolicyFilter deserializedObjectReplicationPolicyFilter + = new ObjectReplicationPolicyFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("prefixMatch".equals(fieldName)) { + List prefixMatch = reader.readArray(reader1 -> reader1.getString()); + deserializedObjectReplicationPolicyFilter.prefixMatch = prefixMatch; + } else if ("minCreationTime".equals(fieldName)) { + deserializedObjectReplicationPolicyFilter.minCreationTime = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedObjectReplicationPolicyFilter; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicyPropertiesMetrics.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicyPropertiesMetrics.java new file mode 100644 index 0000000000000..45642f80ff435 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicyPropertiesMetrics.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Optional. The object replication policy metrics feature options. + */ +@Fluent +public final class ObjectReplicationPolicyPropertiesMetrics + implements JsonSerializable { + /* + * Indicates whether object replication metrics feature is enabled for the policy. + */ + private Boolean enabled; + + /** + * Creates an instance of ObjectReplicationPolicyPropertiesMetrics class. + */ + public ObjectReplicationPolicyPropertiesMetrics() { + } + + /** + * Get the enabled property: Indicates whether object replication metrics feature is enabled for the policy. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Indicates whether object replication metrics feature is enabled for the policy. + * + * @param enabled the enabled value to set. + * @return the ObjectReplicationPolicyPropertiesMetrics object itself. + */ + public ObjectReplicationPolicyPropertiesMetrics withEnabled(Boolean enabled) { + this.enabled = enabled; + 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.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObjectReplicationPolicyPropertiesMetrics from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObjectReplicationPolicyPropertiesMetrics 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 ObjectReplicationPolicyPropertiesMetrics. + */ + public static ObjectReplicationPolicyPropertiesMetrics fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObjectReplicationPolicyPropertiesMetrics deserializedObjectReplicationPolicyPropertiesMetrics + = new ObjectReplicationPolicyPropertiesMetrics(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedObjectReplicationPolicyPropertiesMetrics.enabled + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedObjectReplicationPolicyPropertiesMetrics; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicyRule.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicyRule.java new file mode 100644 index 0000000000000..18ac6cfe2c6a7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicyRule.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * The replication policy rule between two containers. + */ +@Fluent +public final class ObjectReplicationPolicyRule implements JsonSerializable { + /* + * Rule Id is auto-generated for each new rule on destination account. It is required for put policy on source + * account. + */ + private String ruleId; + + /* + * Required. Source container name. + */ + private String sourceContainer; + + /* + * Required. Destination container name. + */ + private String destinationContainer; + + /* + * Optional. An object that defines the filter set. + */ + private ObjectReplicationPolicyFilter filters; + + /** + * Creates an instance of ObjectReplicationPolicyRule class. + */ + public ObjectReplicationPolicyRule() { + } + + /** + * Get the ruleId property: Rule Id is auto-generated for each new rule on destination account. It is required for + * put policy on source account. + * + * @return the ruleId value. + */ + public String ruleId() { + return this.ruleId; + } + + /** + * Set the ruleId property: Rule Id is auto-generated for each new rule on destination account. It is required for + * put policy on source account. + * + * @param ruleId the ruleId value to set. + * @return the ObjectReplicationPolicyRule object itself. + */ + public ObjectReplicationPolicyRule withRuleId(String ruleId) { + this.ruleId = ruleId; + return this; + } + + /** + * Get the sourceContainer property: Required. Source container name. + * + * @return the sourceContainer value. + */ + public String sourceContainer() { + return this.sourceContainer; + } + + /** + * Set the sourceContainer property: Required. Source container name. + * + * @param sourceContainer the sourceContainer value to set. + * @return the ObjectReplicationPolicyRule object itself. + */ + public ObjectReplicationPolicyRule withSourceContainer(String sourceContainer) { + this.sourceContainer = sourceContainer; + return this; + } + + /** + * Get the destinationContainer property: Required. Destination container name. + * + * @return the destinationContainer value. + */ + public String destinationContainer() { + return this.destinationContainer; + } + + /** + * Set the destinationContainer property: Required. Destination container name. + * + * @param destinationContainer the destinationContainer value to set. + * @return the ObjectReplicationPolicyRule object itself. + */ + public ObjectReplicationPolicyRule withDestinationContainer(String destinationContainer) { + this.destinationContainer = destinationContainer; + return this; + } + + /** + * Get the filters property: Optional. An object that defines the filter set. + * + * @return the filters value. + */ + public ObjectReplicationPolicyFilter filters() { + return this.filters; + } + + /** + * Set the filters property: Optional. An object that defines the filter set. + * + * @param filters the filters value to set. + * @return the ObjectReplicationPolicyRule object itself. + */ + public ObjectReplicationPolicyRule withFilters(ObjectReplicationPolicyFilter filters) { + this.filters = filters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceContainer() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sourceContainer in model ObjectReplicationPolicyRule")); + } + if (destinationContainer() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destinationContainer in model ObjectReplicationPolicyRule")); + } + if (filters() != null) { + filters().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ObjectReplicationPolicyRule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sourceContainer", this.sourceContainer); + jsonWriter.writeStringField("destinationContainer", this.destinationContainer); + jsonWriter.writeStringField("ruleId", this.ruleId); + jsonWriter.writeJsonField("filters", this.filters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObjectReplicationPolicyRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObjectReplicationPolicyRule 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 ObjectReplicationPolicyRule. + */ + public static ObjectReplicationPolicyRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObjectReplicationPolicyRule deserializedObjectReplicationPolicyRule = new ObjectReplicationPolicyRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceContainer".equals(fieldName)) { + deserializedObjectReplicationPolicyRule.sourceContainer = reader.getString(); + } else if ("destinationContainer".equals(fieldName)) { + deserializedObjectReplicationPolicyRule.destinationContainer = reader.getString(); + } else if ("ruleId".equals(fieldName)) { + deserializedObjectReplicationPolicyRule.ruleId = reader.getString(); + } else if ("filters".equals(fieldName)) { + deserializedObjectReplicationPolicyRule.filters = ObjectReplicationPolicyFilter.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedObjectReplicationPolicyRule; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectType.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectType.java new file mode 100644 index 0000000000000..a9541eeed34fb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectType.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * This is a required field. This field specifies the scope of the inventory created either at the blob or container + * level. + */ +public final class ObjectType extends ExpandableStringEnum { + /** + * Static value Blob for ObjectType. + */ + public static final ObjectType BLOB = fromString("Blob"); + + /** + * Static value Container for ObjectType. + */ + public static final ObjectType CONTAINER = fromString("Container"); + + /** + * Creates a new instance of ObjectType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ObjectType() { + } + + /** + * Creates or finds a ObjectType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ObjectType. + */ + public static ObjectType fromString(String name) { + return fromString(name, ObjectType.class); + } + + /** + * Gets known ObjectType values. + * + * @return known ObjectType values. + */ + public static Collection values() { + return values(ObjectType.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Operation.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Operation.java new file mode 100644 index 0000000000000..99949840cc48f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Operation.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.OperationInner; + +/** + * An immutable client-side representation of Operation. + */ +public interface Operation { + /** + * Gets the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: Display metadata associated with the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The origin of operations. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the serviceSpecification property: One property of operation, include metric specifications. + * + * @return the serviceSpecification value. + */ + ServiceSpecification serviceSpecification(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/OperationDisplay.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/OperationDisplay.java new file mode 100644 index 0000000000000..a73761aef8f17 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/OperationDisplay.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Display metadata associated with the operation. + */ +@Fluent +public final class OperationDisplay implements JsonSerializable { + /* + * Service provider: Microsoft Storage. + */ + private String provider; + + /* + * Resource on which the operation is performed etc. + */ + private String resource; + + /* + * Type of operation: get, read, delete, etc. + */ + private String operation; + + /* + * Description of the operation. + */ + private String description; + + /** + * Creates an instance of OperationDisplay class. + */ + public OperationDisplay() { + } + + /** + * Get the provider property: Service provider: Microsoft Storage. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Service provider: Microsoft Storage. + * + * @param provider the provider value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: Resource on which the operation is performed etc. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Resource on which the operation is performed etc. + * + * @param resource the resource value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: Type of operation: get, read, delete, etc. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Type of operation: get, read, delete, etc. + * + * @param operation the operation value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: Description of the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the operation. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("provider", this.provider); + jsonWriter.writeStringField("resource", this.resource); + jsonWriter.writeStringField("operation", this.operation); + jsonWriter.writeStringField("description", this.description); + 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/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/OperationListResult.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/OperationListResult.java new file mode 100644 index 0000000000000..579113e19f1ff --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/OperationListResult.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 com.azure.resourcemanager.storage.generated.fluent.models.OperationInner; +import java.io.IOException; +import java.util.List; + +/** + * Result of the request to list Storage operations. It contains a list of operations and a URL link to get the next set + * of results. + */ +@Fluent +public final class OperationListResult implements JsonSerializable { + /* + * List of Storage operations supported by the Storage resource provider. + */ + private List value; + + /** + * Creates an instance of OperationListResult class. + */ + public OperationListResult() { + } + + /** + * Get the value property: List of Storage operations supported by the Storage resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Storage operations supported by the Storage resource provider. + * + * @param value the value value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + 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 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 { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Operations.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Operations.java new file mode 100644 index 0000000000000..a84b0a16b2bdd --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Operations.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of Operations. + */ +public interface Operations { + /** + * Lists all of the available Storage Rest API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all of the available Storage Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PermissionScope.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PermissionScope.java new file mode 100644 index 0000000000000..ff17d7d0ab26d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PermissionScope.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * The PermissionScope model. + */ +@Fluent +public final class PermissionScope implements JsonSerializable { + /* + * The permissions for the local user. Possible values include: Read (r), Write (w), Delete (d), List (l), Create + * (c), Modify Ownership (o), and Modify Permissions (p). + */ + private String permissions; + + /* + * The service used by the local user, e.g. blob, file. + */ + private String service; + + /* + * The name of resource, normally the container name or the file share name, used by the local user. + */ + private String resourceName; + + /** + * Creates an instance of PermissionScope class. + */ + public PermissionScope() { + } + + /** + * Get the permissions property: The permissions for the local user. Possible values include: Read (r), Write (w), + * Delete (d), List (l), Create (c), Modify Ownership (o), and Modify Permissions (p). + * + * @return the permissions value. + */ + public String permissions() { + return this.permissions; + } + + /** + * Set the permissions property: The permissions for the local user. Possible values include: Read (r), Write (w), + * Delete (d), List (l), Create (c), Modify Ownership (o), and Modify Permissions (p). + * + * @param permissions the permissions value to set. + * @return the PermissionScope object itself. + */ + public PermissionScope withPermissions(String permissions) { + this.permissions = permissions; + return this; + } + + /** + * Get the service property: The service used by the local user, e.g. blob, file. + * + * @return the service value. + */ + public String service() { + return this.service; + } + + /** + * Set the service property: The service used by the local user, e.g. blob, file. + * + * @param service the service value to set. + * @return the PermissionScope object itself. + */ + public PermissionScope withService(String service) { + this.service = service; + return this; + } + + /** + * Get the resourceName property: The name of resource, normally the container name or the file share name, used by + * the local user. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Set the resourceName property: The name of resource, normally the container name or the file share name, used by + * the local user. + * + * @param resourceName the resourceName value to set. + * @return the PermissionScope object itself. + */ + public PermissionScope withResourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (permissions() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property permissions in model PermissionScope")); + } + if (service() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property service in model PermissionScope")); + } + if (resourceName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property resourceName in model PermissionScope")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PermissionScope.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("permissions", this.permissions); + jsonWriter.writeStringField("service", this.service); + jsonWriter.writeStringField("resourceName", this.resourceName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PermissionScope from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PermissionScope 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 PermissionScope. + */ + public static PermissionScope fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PermissionScope deserializedPermissionScope = new PermissionScope(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("permissions".equals(fieldName)) { + deserializedPermissionScope.permissions = reader.getString(); + } else if ("service".equals(fieldName)) { + deserializedPermissionScope.service = reader.getString(); + } else if ("resourceName".equals(fieldName)) { + deserializedPermissionScope.resourceName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPermissionScope; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Permissions.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Permissions.java new file mode 100644 index 0000000000000..8efd5c5d59fe8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Permissions.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add + * (a), Create (c), Update (u) and Process (p). + */ +public final class Permissions extends ExpandableStringEnum { + /** + * Static value r for Permissions. + */ + public static final Permissions R = fromString("r"); + + /** + * Static value d for Permissions. + */ + public static final Permissions D = fromString("d"); + + /** + * Static value w for Permissions. + */ + public static final Permissions W = fromString("w"); + + /** + * Static value l for Permissions. + */ + public static final Permissions L = fromString("l"); + + /** + * Static value a for Permissions. + */ + public static final Permissions A = fromString("a"); + + /** + * Static value c for Permissions. + */ + public static final Permissions C = fromString("c"); + + /** + * Static value u for Permissions. + */ + public static final Permissions U = fromString("u"); + + /** + * Static value p for Permissions. + */ + public static final Permissions P = fromString("p"); + + /** + * Creates a new instance of Permissions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Permissions() { + } + + /** + * Creates or finds a Permissions from its string representation. + * + * @param name a name to look for. + * @return the corresponding Permissions. + */ + public static Permissions fromString(String name) { + return fromString(name, Permissions.class); + } + + /** + * Gets known Permissions values. + * + * @return known Permissions values. + */ + public static Collection values() { + return values(Permissions.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PostFailoverRedundancy.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PostFailoverRedundancy.java new file mode 100644 index 0000000000000..f7bede0737479 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PostFailoverRedundancy.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The redundancy type of the account after an account failover is performed. + */ +public final class PostFailoverRedundancy extends ExpandableStringEnum { + /** + * Static value Standard_LRS for PostFailoverRedundancy. + */ + public static final PostFailoverRedundancy STANDARD_LRS = fromString("Standard_LRS"); + + /** + * Static value Standard_ZRS for PostFailoverRedundancy. + */ + public static final PostFailoverRedundancy STANDARD_ZRS = fromString("Standard_ZRS"); + + /** + * Creates a new instance of PostFailoverRedundancy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PostFailoverRedundancy() { + } + + /** + * Creates or finds a PostFailoverRedundancy from its string representation. + * + * @param name a name to look for. + * @return the corresponding PostFailoverRedundancy. + */ + public static PostFailoverRedundancy fromString(String name) { + return fromString(name, PostFailoverRedundancy.class); + } + + /** + * Gets known PostFailoverRedundancy values. + * + * @return known PostFailoverRedundancy values. + */ + public static Collection values() { + return values(PostFailoverRedundancy.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PostPlannedFailoverRedundancy.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PostPlannedFailoverRedundancy.java new file mode 100644 index 0000000000000..c2238f201df03 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PostPlannedFailoverRedundancy.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The redundancy type of the account after a planned account failover is performed. + */ +public final class PostPlannedFailoverRedundancy extends ExpandableStringEnum { + /** + * Static value Standard_GRS for PostPlannedFailoverRedundancy. + */ + public static final PostPlannedFailoverRedundancy STANDARD_GRS = fromString("Standard_GRS"); + + /** + * Static value Standard_GZRS for PostPlannedFailoverRedundancy. + */ + public static final PostPlannedFailoverRedundancy STANDARD_GZRS = fromString("Standard_GZRS"); + + /** + * Static value Standard_RAGRS for PostPlannedFailoverRedundancy. + */ + public static final PostPlannedFailoverRedundancy STANDARD_RAGRS = fromString("Standard_RAGRS"); + + /** + * Static value Standard_RAGZRS for PostPlannedFailoverRedundancy. + */ + public static final PostPlannedFailoverRedundancy STANDARD_RAGZRS = fromString("Standard_RAGZRS"); + + /** + * Creates a new instance of PostPlannedFailoverRedundancy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PostPlannedFailoverRedundancy() { + } + + /** + * Creates or finds a PostPlannedFailoverRedundancy from its string representation. + * + * @param name a name to look for. + * @return the corresponding PostPlannedFailoverRedundancy. + */ + public static PostPlannedFailoverRedundancy fromString(String name) { + return fromString(name, PostPlannedFailoverRedundancy.class); + } + + /** + * Gets known PostPlannedFailoverRedundancy values. + * + * @return known PostPlannedFailoverRedundancy values. + */ + public static Collection values() { + return values(PostPlannedFailoverRedundancy.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpoint.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpoint.java new file mode 100644 index 0000000000000..c616f5ba271b4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpoint.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * The Private Endpoint resource. + */ +@Immutable +public final class PrivateEndpoint implements JsonSerializable { + /* + * The ARM identifier for Private Endpoint + */ + private String id; + + /** + * Creates an instance of PrivateEndpoint class. + */ + public PrivateEndpoint() { + } + + /** + * Get the id property: The ARM identifier for Private Endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * 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 PrivateEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpoint 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 PrivateEndpoint. + */ + public static PrivateEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpoint deserializedPrivateEndpoint = new PrivateEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpoint.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpoint; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnection.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnection.java new file mode 100644 index 0000000000000..99b9dd29b25a8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnection.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateEndpointConnectionInner; + +/** + * An immutable client-side representation of PrivateEndpointConnection. + */ +public interface PrivateEndpointConnection { + /** + * 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 privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the + * connection between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + PrivateEndpointConnectionProvisioningState provisioningState(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.PrivateEndpointConnectionInner object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); + + /** + * The entirety of the PrivateEndpointConnection definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The PrivateEndpointConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the PrivateEndpointConnection definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the PrivateEndpointConnection 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.WithPrivateEndpoint, DefinitionStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateEndpointConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateEndpointConnection create(Context context); + } + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. + */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The resource of private end point.. + * + * @param privateEndpoint The resource of private end point. + * @return the next definition stage. + */ + WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify privateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of + * the connection between service consumer and provider.. + * + * @param privateLinkServiceConnectionState A collection of information about the state of the connection + * between service consumer and provider. + * @return the next definition stage. + */ + WithCreate withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + } + + /** + * Begins update for the PrivateEndpointConnection resource. + * + * @return the stage of resource update. + */ + PrivateEndpointConnection.Update update(); + + /** + * The template for PrivateEndpointConnection update. + */ + interface Update extends UpdateStages.WithPrivateEndpoint, UpdateStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PrivateEndpointConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PrivateEndpointConnection apply(Context context); + } + + /** + * The PrivateEndpointConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the PrivateEndpointConnection update allowing to specify privateEndpoint. + */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The resource of private end point.. + * + * @param privateEndpoint The resource of private end point. + * @return the next definition stage. + */ + Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + + /** + * The stage of the PrivateEndpointConnection update allowing to specify privateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of + * the connection between service consumer and provider.. + * + * @param privateLinkServiceConnectionState A collection of information about the state of the connection + * between service consumer and provider. + * @return the next definition stage. + */ + Update withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnectionListResult.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 0000000000000..3f6d30d040695 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 com.azure.resourcemanager.storage.generated.fluent.models.PrivateEndpointConnectionInner; +import java.io.IOException; +import java.util.List; + +/** + * List of private endpoint connection associated with the specified storage account. + */ +@Fluent +public final class PrivateEndpointConnectionListResult + implements JsonSerializable { + /* + * Array of private endpoint connections + */ + private List value; + + /** + * Creates an instance of PrivateEndpointConnectionListResult class. + */ + public PrivateEndpointConnectionListResult() { + } + + /** + * Get the value property: Array of private endpoint connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private endpoint connections. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionListResult 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 PrivateEndpointConnectionListResult. + */ + public static PrivateEndpointConnectionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionListResult deserializedPrivateEndpointConnectionListResult + = new PrivateEndpointConnectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedPrivateEndpointConnectionListResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionListResult; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnectionProvisioningState.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnectionProvisioningState.java new file mode 100644 index 0000000000000..3c9d7b63c0728 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnectionProvisioningState.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The current provisioning state. + */ +public final class PrivateEndpointConnectionProvisioningState + extends ExpandableStringEnum { + /** + * Static value Succeeded for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Creating for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); + + /** + * Static value Deleting for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Failed for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); + + /** + * Creates a new instance of PrivateEndpointConnectionProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointConnectionProvisioningState() { + } + + /** + * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointConnectionProvisioningState. + */ + public static PrivateEndpointConnectionProvisioningState fromString(String name) { + return fromString(name, PrivateEndpointConnectionProvisioningState.class); + } + + /** + * Gets known PrivateEndpointConnectionProvisioningState values. + * + * @return known PrivateEndpointConnectionProvisioningState values. + */ + public static Collection values() { + return values(PrivateEndpointConnectionProvisioningState.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnections.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnections.java new file mode 100644 index 0000000000000..4f18bf9b011d9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnections.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 PrivateEndpointConnections. + */ +public interface PrivateEndpointConnections { + /** + * List all the private endpoint connections associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List all the private endpoint connections associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connection associated with the specified storage account as paginated response + * with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * Gets the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 specified private endpoint connection associated with the storage account along with + * {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String accountName, + String privateEndpointConnectionName, Context context); + + /** + * Gets the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 specified private endpoint connection associated with the storage account. + */ + PrivateEndpointConnection get(String resourceGroupName, String accountName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 Response}. + */ + Response deleteWithResponse(String resourceGroupName, String accountName, + String privateEndpointConnectionName, Context context); + + /** + * Deletes the specified private endpoint connection associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * 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 delete(String resourceGroupName, String accountName, String privateEndpointConnectionName); + + /** + * Gets the specified private endpoint connection associated with the storage account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the storage account along with + * {@link Response}. + */ + PrivateEndpointConnection getById(String id); + + /** + * Gets the specified private endpoint connection associated with the storage account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the storage account along with + * {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified private endpoint connection associated with the storage account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified private endpoint connection associated with the storage account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PrivateEndpointConnection resource. + * + * @param name resource name. + * @return the first stage of the new PrivateEndpointConnection definition. + */ + PrivateEndpointConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointServiceConnectionStatus.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointServiceConnectionStatus.java new file mode 100644 index 0000000000000..6fbba01dbdceb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointServiceConnectionStatus.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The private endpoint connection status. + */ +public final class PrivateEndpointServiceConnectionStatus + extends ExpandableStringEnum { + /** + * Static value Pending for PrivateEndpointServiceConnectionStatus. + */ + public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); + + /** + * Static value Approved for PrivateEndpointServiceConnectionStatus. + */ + public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); + + /** + * Static value Rejected for PrivateEndpointServiceConnectionStatus. + */ + public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** + * Creates a new instance of PrivateEndpointServiceConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointServiceConnectionStatus() { + } + + /** + * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointServiceConnectionStatus. + */ + public static PrivateEndpointServiceConnectionStatus fromString(String name) { + return fromString(name, PrivateEndpointServiceConnectionStatus.class); + } + + /** + * Gets known PrivateEndpointServiceConnectionStatus values. + * + * @return known PrivateEndpointServiceConnectionStatus values. + */ + public static Collection values() { + return values(PrivateEndpointServiceConnectionStatus.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkResource.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkResource.java new file mode 100644 index 0000000000000..ecdb8f915e638 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkResource.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateLinkResourceProperties; +import java.io.IOException; +import java.util.List; + +/** + * A private link resource. + */ +@Fluent +public final class PrivateLinkResource extends ProxyResource { + /* + * Resource properties. + */ + private PrivateLinkResourceProperties innerProperties; + + /* + * 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 PrivateLinkResource class. + */ + public PrivateLinkResource() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateLinkResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.innerProperties() == null ? null : this.innerProperties().groupId(); + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); + } + + /** + * Set the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResource object itself. + */ + public PrivateLinkResource withRequiredZoneNames(List requiredZoneNames) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredZoneNames(requiredZoneNames); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResource 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 PrivateLinkResource. + */ + public static PrivateLinkResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResource deserializedPrivateLinkResource = new PrivateLinkResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateLinkResource.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateLinkResource.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateLinkResource.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateLinkResource.innerProperties = PrivateLinkResourceProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResource; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkResourceListResult.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkResourceListResult.java new file mode 100644 index 0000000000000..8f73f31e5efef --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkResourceListResult.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.PrivateLinkResourceListResultInner; +import java.util.List; + +/** + * An immutable client-side representation of PrivateLinkResourceListResult. + */ +public interface PrivateLinkResourceListResult { + /** + * Gets the value property: Array of private link resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.PrivateLinkResourceListResultInner + * object. + * + * @return the inner object. + */ + PrivateLinkResourceListResultInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkResources.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkResources.java new file mode 100644 index 0000000000000..7f6bff915e8bb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkResources.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of PrivateLinkResources. + */ +public interface PrivateLinkResources { + /** + * Gets the private link resources that need to be created for a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 private link resources that need to be created for a storage account along with {@link Response}. + */ + Response listByStorageAccountWithResponse(String resourceGroupName, + String accountName, Context context); + + /** + * Gets the private link resources that need to be created for a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 private link resources that need to be created for a storage account. + */ + PrivateLinkResourceListResult listByStorageAccount(String resourceGroupName, String accountName); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkServiceConnectionState.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..2c9dbf73d8cd7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * A collection of information about the state of the connection between service consumer and provider. + */ +@Fluent +public final class PrivateLinkServiceConnectionState implements JsonSerializable { + /* + * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + */ + private PrivateEndpointServiceConnectionStatus status; + + /* + * The reason for approval/rejection of the connection. + */ + private String description; + + /* + * A message indicating if changes on the service provider require any updates on the consumer. + */ + private String actionRequired; + + /** + * Creates an instance of PrivateLinkServiceConnectionState class. + */ + public PrivateLinkServiceConnectionState() { + } + + /** + * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @return the status value. + */ + public PrivateEndpointServiceConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: The reason for approval/rejection of the connection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The reason for approval/rejection of the connection. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @return the actionRequired value. + */ + public String actionRequired() { + return this.actionRequired; + } + + /** + * Set the actionRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @param actionRequired the actionRequired value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionRequired(String actionRequired) { + this.actionRequired = actionRequired; + 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("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("actionRequired", this.actionRequired); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkServiceConnectionState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkServiceConnectionState 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 PrivateLinkServiceConnectionState. + */ + public static PrivateLinkServiceConnectionState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkServiceConnectionState deserializedPrivateLinkServiceConnectionState + = new PrivateLinkServiceConnectionState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.status + = PrivateEndpointServiceConnectionStatus.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.description = reader.getString(); + } else if ("actionRequired".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.actionRequired = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkServiceConnectionState; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProtectedAppendWritesHistory.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProtectedAppendWritesHistory.java new file mode 100644 index 0000000000000..cb6f7c3490d1c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProtectedAppendWritesHistory.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +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.time.OffsetDateTime; + +/** + * Protected append writes history setting for the blob container with Legal holds. + */ +@Fluent +public final class ProtectedAppendWritesHistory implements JsonSerializable { + /* + * When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection + * and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. + */ + private Boolean allowProtectedAppendWritesAll; + + /* + * Returns the date and time the tag was added. + */ + private OffsetDateTime timestamp; + + /** + * Creates an instance of ProtectedAppendWritesHistory class. + */ + public ProtectedAppendWritesHistory() { + } + + /** + * Get the allowProtectedAppendWritesAll property: When enabled, new blocks can be written to both 'Append and Bock + * Blobs' while maintaining legal hold protection and compliance. Only new blocks can be added and any existing + * blocks cannot be modified or deleted. + * + * @return the allowProtectedAppendWritesAll value. + */ + public Boolean allowProtectedAppendWritesAll() { + return this.allowProtectedAppendWritesAll; + } + + /** + * Set the allowProtectedAppendWritesAll property: When enabled, new blocks can be written to both 'Append and Bock + * Blobs' while maintaining legal hold protection and compliance. Only new blocks can be added and any existing + * blocks cannot be modified or deleted. + * + * @param allowProtectedAppendWritesAll the allowProtectedAppendWritesAll value to set. + * @return the ProtectedAppendWritesHistory object itself. + */ + public ProtectedAppendWritesHistory withAllowProtectedAppendWritesAll(Boolean allowProtectedAppendWritesAll) { + this.allowProtectedAppendWritesAll = allowProtectedAppendWritesAll; + return this; + } + + /** + * Get the timestamp property: Returns the date and time the tag was added. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * 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.writeBooleanField("allowProtectedAppendWritesAll", this.allowProtectedAppendWritesAll); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProtectedAppendWritesHistory from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProtectedAppendWritesHistory 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 ProtectedAppendWritesHistory. + */ + public static ProtectedAppendWritesHistory fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProtectedAppendWritesHistory deserializedProtectedAppendWritesHistory = new ProtectedAppendWritesHistory(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowProtectedAppendWritesAll".equals(fieldName)) { + deserializedProtectedAppendWritesHistory.allowProtectedAppendWritesAll + = reader.getNullable(JsonReader::getBoolean); + } else if ("timestamp".equals(fieldName)) { + deserializedProtectedAppendWritesHistory.timestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedProtectedAppendWritesHistory; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProtocolSettings.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProtocolSettings.java new file mode 100644 index 0000000000000..3676bd7a1634b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProtocolSettings.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Protocol settings for file service. + */ +@Fluent +public final class ProtocolSettings implements JsonSerializable { + /* + * Setting for SMB protocol + */ + private SmbSetting smb; + + /** + * Creates an instance of ProtocolSettings class. + */ + public ProtocolSettings() { + } + + /** + * Get the smb property: Setting for SMB protocol. + * + * @return the smb value. + */ + public SmbSetting smb() { + return this.smb; + } + + /** + * Set the smb property: Setting for SMB protocol. + * + * @param smb the smb value to set. + * @return the ProtocolSettings object itself. + */ + public ProtocolSettings withSmb(SmbSetting smb) { + this.smb = smb; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (smb() != null) { + smb().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("smb", this.smb); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProtocolSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProtocolSettings 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 ProtocolSettings. + */ + public static ProtocolSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProtocolSettings deserializedProtocolSettings = new ProtocolSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("smb".equals(fieldName)) { + deserializedProtocolSettings.smb = SmbSetting.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProtocolSettings; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProvisioningIssue.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProvisioningIssue.java new file mode 100644 index 0000000000000..0d4c36f96318e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProvisioningIssue.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Describes provisioning issue for given NetworkSecurityPerimeterConfiguration. + */ +@Fluent +public final class ProvisioningIssue implements JsonSerializable { + /* + * Name of the issue + */ + private String name; + + /* + * Properties of provisioning issue + */ + private ProvisioningIssueProperties properties; + + /** + * Creates an instance of ProvisioningIssue class. + */ + public ProvisioningIssue() { + } + + /** + * Get the name property: Name of the issue. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the issue. + * + * @param name the name value to set. + * @return the ProvisioningIssue object itself. + */ + public ProvisioningIssue withName(String name) { + this.name = name; + return this; + } + + /** + * Get the properties property: Properties of provisioning issue. + * + * @return the properties value. + */ + public ProvisioningIssueProperties properties() { + return this.properties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProvisioningIssue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProvisioningIssue 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 ProvisioningIssue. + */ + public static ProvisioningIssue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProvisioningIssue deserializedProvisioningIssue = new ProvisioningIssue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedProvisioningIssue.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedProvisioningIssue.properties = ProvisioningIssueProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProvisioningIssue; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProvisioningIssueProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProvisioningIssueProperties.java new file mode 100644 index 0000000000000..38d9052055727 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProvisioningIssueProperties.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Properties of provisioning issue. + */ +@Fluent +public final class ProvisioningIssueProperties implements JsonSerializable { + /* + * Type of issue + */ + private IssueType issueType; + + /* + * Severity of the issue. + */ + private Severity severity; + + /* + * Description of the issue + */ + private String description; + + /** + * Creates an instance of ProvisioningIssueProperties class. + */ + public ProvisioningIssueProperties() { + } + + /** + * Get the issueType property: Type of issue. + * + * @return the issueType value. + */ + public IssueType issueType() { + return this.issueType; + } + + /** + * Set the issueType property: Type of issue. + * + * @param issueType the issueType value to set. + * @return the ProvisioningIssueProperties object itself. + */ + public ProvisioningIssueProperties withIssueType(IssueType issueType) { + this.issueType = issueType; + return this; + } + + /** + * Get the severity property: Severity of the issue. + * + * @return the severity value. + */ + public Severity severity() { + return this.severity; + } + + /** + * Set the severity property: Severity of the issue. + * + * @param severity the severity value to set. + * @return the ProvisioningIssueProperties object itself. + */ + public ProvisioningIssueProperties withSeverity(Severity severity) { + this.severity = severity; + return this; + } + + /** + * Get the description property: Description of the issue. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the issue. + * + * @param description the description value to set. + * @return the ProvisioningIssueProperties object itself. + */ + public ProvisioningIssueProperties withDescription(String description) { + this.description = description; + 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("issueType", this.issueType == null ? null : this.issueType.toString()); + jsonWriter.writeStringField("severity", this.severity == null ? null : this.severity.toString()); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProvisioningIssueProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProvisioningIssueProperties 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 ProvisioningIssueProperties. + */ + public static ProvisioningIssueProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProvisioningIssueProperties deserializedProvisioningIssueProperties = new ProvisioningIssueProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("issueType".equals(fieldName)) { + deserializedProvisioningIssueProperties.issueType = IssueType.fromString(reader.getString()); + } else if ("severity".equals(fieldName)) { + deserializedProvisioningIssueProperties.severity = Severity.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedProvisioningIssueProperties.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedProvisioningIssueProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProvisioningState.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProvisioningState.java new file mode 100644 index 0000000000000..5614ba9360c9b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProvisioningState.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +/** + * Gets the status of the storage account at the time the operation was called. + */ +public enum ProvisioningState { + /** + * Enum value Creating. + */ + CREATING("Creating"), + + /** + * Enum value ResolvingDNS. + */ + RESOLVING_DNS("ResolvingDNS"), + + /** + * Enum value Succeeded. + */ + SUCCEEDED("Succeeded"), + + /** + * Enum value ValidateSubscriptionQuotaBegin. + */ + VALIDATE_SUBSCRIPTION_QUOTA_BEGIN("ValidateSubscriptionQuotaBegin"), + + /** + * Enum value ValidateSubscriptionQuotaEnd. + */ + VALIDATE_SUBSCRIPTION_QUOTA_END("ValidateSubscriptionQuotaEnd"), + + /** + * Enum value Deleting. + */ + DELETING("Deleting"), + + /** + * Enum value Canceled. + */ + CANCELED("Canceled"), + + /** + * Enum value Failed. + */ + FAILED("Failed"); + + /** + * The actual serialized value for a ProvisioningState instance. + */ + private final String value; + + ProvisioningState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ProvisioningState instance. + * + * @param value the serialized value to parse. + * @return the parsed ProvisioningState object, or null if unable to parse. + */ + public static ProvisioningState fromString(String value) { + if (value == null) { + return null; + } + ProvisioningState[] items = ProvisioningState.values(); + for (ProvisioningState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PublicAccess.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PublicAccess.java new file mode 100644 index 0000000000000..1aba78085a40e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PublicAccess.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +/** + * Specifies whether data in the container may be accessed publicly and the level of access. + */ +public enum PublicAccess { + /** + * Enum value Container. + */ + CONTAINER("Container"), + + /** + * Enum value Blob. + */ + BLOB("Blob"), + + /** + * Enum value None. + */ + NONE("None"); + + /** + * The actual serialized value for a PublicAccess instance. + */ + private final String value; + + PublicAccess(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PublicAccess instance. + * + * @param value the serialized value to parse. + * @return the parsed PublicAccess object, or null if unable to parse. + */ + public static PublicAccess fromString(String value) { + if (value == null) { + return null; + } + PublicAccess[] items = PublicAccess.values(); + for (PublicAccess item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PublicNetworkAccess.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PublicNetworkAccess.java new file mode 100644 index 0000000000000..5a2abad0d2c37 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PublicNetworkAccess.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage + * Account. Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. + */ +public final class PublicNetworkAccess extends ExpandableStringEnum { + /** + * Static value Enabled for PublicNetworkAccess. + */ + public static final PublicNetworkAccess ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for PublicNetworkAccess. + */ + public static final PublicNetworkAccess DISABLED = fromString("Disabled"); + + /** + * Static value SecuredByPerimeter for PublicNetworkAccess. + */ + public static final PublicNetworkAccess SECURED_BY_PERIMETER = fromString("SecuredByPerimeter"); + + /** + * Creates a new instance of PublicNetworkAccess value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PublicNetworkAccess() { + } + + /** + * Creates or finds a PublicNetworkAccess from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicNetworkAccess. + */ + public static PublicNetworkAccess fromString(String name) { + return fromString(name, PublicNetworkAccess.class); + } + + /** + * Gets known PublicNetworkAccess values. + * + * @return known PublicNetworkAccess values. + */ + public static Collection values() { + return values(PublicNetworkAccess.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/QueueServiceProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/QueueServiceProperties.java new file mode 100644 index 0000000000000..49377875ff5bf --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/QueueServiceProperties.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.QueueServicePropertiesInner; + +/** + * An immutable client-side representation of QueueServiceProperties. + */ +public interface QueueServiceProperties { + /** + * 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 cors property: Specifies CORS rules for the Queue service. You can include up to five CorsRule elements + * in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and + * CORS will be disabled for the Queue service. + * + * @return the cors value. + */ + CorsRules cors(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.QueueServicePropertiesInner object. + * + * @return the inner object. + */ + QueueServicePropertiesInner innerModel(); + + /** + * The entirety of the QueueServiceProperties definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The QueueServiceProperties definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the QueueServiceProperties definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the QueueServiceProperties definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the QueueServiceProperties 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.WithCors { + /** + * Executes the create request. + * + * @return the created resource. + */ + QueueServiceProperties create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + QueueServiceProperties create(Context context); + } + + /** + * The stage of the QueueServiceProperties definition allowing to specify cors. + */ + interface WithCors { + /** + * Specifies the cors property: Specifies CORS rules for the Queue service. You can include up to five + * CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS + * rules will be deleted, and CORS will be disabled for the Queue service.. + * + * @param cors Specifies CORS rules for the Queue service. You can include up to five CorsRule elements in + * the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, + * and CORS will be disabled for the Queue service. + * @return the next definition stage. + */ + WithCreate withCors(CorsRules cors); + } + } + + /** + * Begins update for the QueueServiceProperties resource. + * + * @return the stage of resource update. + */ + QueueServiceProperties.Update update(); + + /** + * The template for QueueServiceProperties update. + */ + interface Update extends UpdateStages.WithCors { + /** + * Executes the update request. + * + * @return the updated resource. + */ + QueueServiceProperties apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + QueueServiceProperties apply(Context context); + } + + /** + * The QueueServiceProperties update stages. + */ + interface UpdateStages { + /** + * The stage of the QueueServiceProperties update allowing to specify cors. + */ + interface WithCors { + /** + * Specifies the cors property: Specifies CORS rules for the Queue service. You can include up to five + * CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS + * rules will be deleted, and CORS will be disabled for the Queue service.. + * + * @param cors Specifies CORS rules for the Queue service. You can include up to five CorsRule elements in + * the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, + * and CORS will be disabled for the Queue service. + * @return the next definition stage. + */ + Update withCors(CorsRules cors); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + QueueServiceProperties refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + QueueServiceProperties refresh(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/QueueServices.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/QueueServices.java new file mode 100644 index 0000000000000..8447f84f7934e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/QueueServices.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of QueueServices. + */ +public interface QueueServices { + /** + * List all queue services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 body along with {@link Response}. + */ + Response listWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * List all queue services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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. + */ + ListQueueServices list(String resourceGroupName, String accountName); + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + Response getServicePropertiesWithResponse(String resourceGroupName, String accountName, + Context context); + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + */ + QueueServiceProperties getServiceProperties(String resourceGroupName, String accountName); + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + QueueServiceProperties getServicePropertiesById(String id); + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + Response getServicePropertiesByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new QueueServiceProperties resource. + * + * @return the first stage of the new QueueServiceProperties definition. + */ + QueueServiceProperties.DefinitionStages.Blank define(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Queues.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Queues.java new file mode 100644 index 0000000000000..ac03f0a98086e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Queues.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 Queues. + */ +public interface Queues { + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @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 queue with the specified queue name, under the specified account if it exists along with + * {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String accountName, String queueName, + Context context); + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 queue with the specified queue name, under the specified account if it exists. + */ + StorageQueue get(String resourceGroupName, String accountName, String queueName); + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @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 Response}. + */ + Response deleteWithResponse(String resourceGroupName, String accountName, String queueName, Context context); + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an + * alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String queueName); + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 all the queues under the specified storage account as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response. + * @param filter Optional, When specified, only the queues with a name starting with the given filter will be + * listed. + * @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 all the queues under the specified storage account as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, String maxpagesize, String filter, + Context context); + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queue with the specified queue name, under the specified account if it exists along with + * {@link Response}. + */ + StorageQueue getById(String id); + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the queue with the specified queue name, under the specified account if it exists along with + * {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @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); + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new StorageQueue resource. + * + * @param name resource name. + * @return the first stage of the new StorageQueue definition. + */ + StorageQueue.DefinitionStages.Blank define(String name); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Reason.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Reason.java new file mode 100644 index 0000000000000..a6613dfd125fe --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Reason.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +/** + * Gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable + * is false. + */ +public enum Reason { + /** + * Enum value AccountNameInvalid. + */ + ACCOUNT_NAME_INVALID("AccountNameInvalid"), + + /** + * Enum value AlreadyExists. + */ + ALREADY_EXISTS("AlreadyExists"); + + /** + * The actual serialized value for a Reason instance. + */ + private final String value; + + Reason(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Reason instance. + * + * @param value the serialized value to parse. + * @return the parsed Reason object, or null if unable to parse. + */ + public static Reason fromString(String value) { + if (value == null) { + return null; + } + Reason[] items = Reason.values(); + for (Reason item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ReasonCode.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ReasonCode.java new file mode 100644 index 0000000000000..a13479f651d3c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ReasonCode.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set + * when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The + * "NotAvailableForSubscription" is related to capacity at DC. + */ +public final class ReasonCode extends ExpandableStringEnum { + /** + * Static value QuotaId for ReasonCode. + */ + public static final ReasonCode QUOTA_ID = fromString("QuotaId"); + + /** + * Static value NotAvailableForSubscription for ReasonCode. + */ + public static final ReasonCode NOT_AVAILABLE_FOR_SUBSCRIPTION = fromString("NotAvailableForSubscription"); + + /** + * Creates a new instance of ReasonCode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ReasonCode() { + } + + /** + * Creates or finds a ReasonCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReasonCode. + */ + public static ReasonCode fromString(String name) { + return fromString(name, ReasonCode.class); + } + + /** + * Gets known ReasonCode values. + * + * @return known ReasonCode values. + */ + public static Collection values() { + return values(ReasonCode.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ResourceAccessRule.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ResourceAccessRule.java new file mode 100644 index 0000000000000..fb4031625f272 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ResourceAccessRule.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Resource Access Rule. + */ +@Fluent +public final class ResourceAccessRule implements JsonSerializable { + /* + * Tenant Id + */ + private String tenantId; + + /* + * Resource Id + */ + private String resourceId; + + /** + * Creates an instance of ResourceAccessRule class. + */ + public ResourceAccessRule() { + } + + /** + * Get the tenantId property: Tenant Id. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: Tenant Id. + * + * @param tenantId the tenantId value to set. + * @return the ResourceAccessRule object itself. + */ + public ResourceAccessRule withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the resourceId property: Resource Id. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Resource Id. + * + * @param resourceId the resourceId value to set. + * @return the ResourceAccessRule object itself. + */ + public ResourceAccessRule withResourceId(String resourceId) { + this.resourceId = resourceId; + 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("tenantId", this.tenantId); + jsonWriter.writeStringField("resourceId", this.resourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceAccessRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceAccessRule 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 ResourceAccessRule. + */ + public static ResourceAccessRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceAccessRule deserializedResourceAccessRule = new ResourceAccessRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedResourceAccessRule.tenantId = reader.getString(); + } else if ("resourceId".equals(fieldName)) { + deserializedResourceAccessRule.resourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceAccessRule; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ResourceAssociationAccessMode.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ResourceAssociationAccessMode.java new file mode 100644 index 0000000000000..dc74cbf32b692 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ResourceAssociationAccessMode.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Access Mode of the resource association. + */ +public final class ResourceAssociationAccessMode extends ExpandableStringEnum { + /** + * Static value Enforced for ResourceAssociationAccessMode. + */ + public static final ResourceAssociationAccessMode ENFORCED = fromString("Enforced"); + + /** + * Static value Learning for ResourceAssociationAccessMode. + */ + public static final ResourceAssociationAccessMode LEARNING = fromString("Learning"); + + /** + * Static value Audit for ResourceAssociationAccessMode. + */ + public static final ResourceAssociationAccessMode AUDIT = fromString("Audit"); + + /** + * Creates a new instance of ResourceAssociationAccessMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceAssociationAccessMode() { + } + + /** + * Creates or finds a ResourceAssociationAccessMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceAssociationAccessMode. + */ + public static ResourceAssociationAccessMode fromString(String name) { + return fromString(name, ResourceAssociationAccessMode.class); + } + + /** + * Gets known ResourceAssociationAccessMode values. + * + * @return known ResourceAssociationAccessMode values. + */ + public static Collection values() { + return values(ResourceAssociationAccessMode.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RestorePolicyProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RestorePolicyProperties.java new file mode 100644 index 0000000000000..e5d7d63cf04cf --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RestorePolicyProperties.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +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.time.OffsetDateTime; + +/** + * The blob service properties for blob restore policy. + */ +@Fluent +public final class RestorePolicyProperties implements JsonSerializable { + /* + * Blob restore is enabled if set to true. + */ + private boolean enabled; + + /* + * how long this blob can be restored. It should be great than zero and less than DeleteRetentionPolicy.days. + */ + private Integer days; + + /* + * Deprecated in favor of minRestoreTime property. + */ + private OffsetDateTime lastEnabledTime; + + /* + * Returns the minimum date and time that the restore can be started. + */ + private OffsetDateTime minRestoreTime; + + /** + * Creates an instance of RestorePolicyProperties class. + */ + public RestorePolicyProperties() { + } + + /** + * Get the enabled property: Blob restore is enabled if set to true. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Blob restore is enabled if set to true. + * + * @param enabled the enabled value to set. + * @return the RestorePolicyProperties object itself. + */ + public RestorePolicyProperties withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the days property: how long this blob can be restored. It should be great than zero and less than + * DeleteRetentionPolicy.days. + * + * @return the days value. + */ + public Integer days() { + return this.days; + } + + /** + * Set the days property: how long this blob can be restored. It should be great than zero and less than + * DeleteRetentionPolicy.days. + * + * @param days the days value to set. + * @return the RestorePolicyProperties object itself. + */ + public RestorePolicyProperties withDays(Integer days) { + this.days = days; + return this; + } + + /** + * Get the lastEnabledTime property: Deprecated in favor of minRestoreTime property. + * + * @return the lastEnabledTime value. + */ + public OffsetDateTime lastEnabledTime() { + return this.lastEnabledTime; + } + + /** + * Get the minRestoreTime property: Returns the minimum date and time that the restore can be started. + * + * @return the minRestoreTime value. + */ + public OffsetDateTime minRestoreTime() { + return this.minRestoreTime; + } + + /** + * 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.writeBooleanField("enabled", this.enabled); + jsonWriter.writeNumberField("days", this.days); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RestorePolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RestorePolicyProperties 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 RestorePolicyProperties. + */ + public static RestorePolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RestorePolicyProperties deserializedRestorePolicyProperties = new RestorePolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedRestorePolicyProperties.enabled = reader.getBoolean(); + } else if ("days".equals(fieldName)) { + deserializedRestorePolicyProperties.days = reader.getNullable(JsonReader::getInt); + } else if ("lastEnabledTime".equals(fieldName)) { + deserializedRestorePolicyProperties.lastEnabledTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("minRestoreTime".equals(fieldName)) { + deserializedRestorePolicyProperties.minRestoreTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedRestorePolicyProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Restriction.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Restriction.java new file mode 100644 index 0000000000000..95ef9f4f4c603 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Restriction.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.List; + +/** + * The restriction because of which SKU cannot be used. + */ +@Fluent +public final class Restriction implements JsonSerializable { + /* + * The type of restrictions. As of now only possible value for this is location. + */ + private String type; + + /* + * The value of restrictions. If the restriction type is set to location. This would be different locations where + * the SKU is restricted. + */ + private List values; + + /* + * The reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set + * when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The + * "NotAvailableForSubscription" is related to capacity at DC. + */ + private ReasonCode reasonCode; + + /** + * Creates an instance of Restriction class. + */ + public Restriction() { + } + + /** + * Get the type property: The type of restrictions. As of now only possible value for this is location. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the values property: The value of restrictions. If the restriction type is set to location. This would be + * different locations where the SKU is restricted. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Get the reasonCode property: The reason for the restriction. As of now this can be "QuotaId" or + * "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the subscription does + * not belong to that quota. The "NotAvailableForSubscription" is related to capacity at DC. + * + * @return the reasonCode value. + */ + public ReasonCode reasonCode() { + return this.reasonCode; + } + + /** + * Set the reasonCode property: The reason for the restriction. As of now this can be "QuotaId" or + * "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the subscription does + * not belong to that quota. The "NotAvailableForSubscription" is related to capacity at DC. + * + * @param reasonCode the reasonCode value to set. + * @return the Restriction object itself. + */ + public Restriction withReasonCode(ReasonCode reasonCode) { + this.reasonCode = reasonCode; + 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("reasonCode", this.reasonCode == null ? null : this.reasonCode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Restriction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Restriction 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 Restriction. + */ + public static Restriction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Restriction deserializedRestriction = new Restriction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedRestriction.type = reader.getString(); + } else if ("values".equals(fieldName)) { + List values = reader.readArray(reader1 -> reader1.getString()); + deserializedRestriction.values = values; + } else if ("reasonCode".equals(fieldName)) { + deserializedRestriction.reasonCode = ReasonCode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRestriction; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RootSquashType.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RootSquashType.java new file mode 100644 index 0000000000000..5792b1223d69d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RootSquashType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The property is for NFS share only. The default is NoRootSquash. + */ +public final class RootSquashType extends ExpandableStringEnum { + /** + * Static value NoRootSquash for RootSquashType. + */ + public static final RootSquashType NO_ROOT_SQUASH = fromString("NoRootSquash"); + + /** + * Static value RootSquash for RootSquashType. + */ + public static final RootSquashType ROOT_SQUASH = fromString("RootSquash"); + + /** + * Static value AllSquash for RootSquashType. + */ + public static final RootSquashType ALL_SQUASH = fromString("AllSquash"); + + /** + * Creates a new instance of RootSquashType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RootSquashType() { + } + + /** + * Creates or finds a RootSquashType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RootSquashType. + */ + public static RootSquashType fromString(String name) { + return fromString(name, RootSquashType.class); + } + + /** + * Gets known RootSquashType values. + * + * @return known RootSquashType values. + */ + public static Collection values() { + return values(RootSquashType.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RoutingChoice.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RoutingChoice.java new file mode 100644 index 0000000000000..2fcc059598216 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RoutingChoice.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Routing Choice defines the kind of network routing opted by the user. + */ +public final class RoutingChoice extends ExpandableStringEnum { + /** + * Static value MicrosoftRouting for RoutingChoice. + */ + public static final RoutingChoice MICROSOFT_ROUTING = fromString("MicrosoftRouting"); + + /** + * Static value InternetRouting for RoutingChoice. + */ + public static final RoutingChoice INTERNET_ROUTING = fromString("InternetRouting"); + + /** + * Creates a new instance of RoutingChoice value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RoutingChoice() { + } + + /** + * Creates or finds a RoutingChoice from its string representation. + * + * @param name a name to look for. + * @return the corresponding RoutingChoice. + */ + public static RoutingChoice fromString(String name) { + return fromString(name, RoutingChoice.class); + } + + /** + * Gets known RoutingChoice values. + * + * @return known RoutingChoice values. + */ + public static Collection values() { + return values(RoutingChoice.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RoutingPreference.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RoutingPreference.java new file mode 100644 index 0000000000000..9d1d05bd8631c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RoutingPreference.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Routing preference defines the type of network, either microsoft or internet routing to be used to deliver the user + * data, the default option is microsoft routing. + */ +@Fluent +public final class RoutingPreference implements JsonSerializable { + /* + * Routing Choice defines the kind of network routing opted by the user. + */ + private RoutingChoice routingChoice; + + /* + * A boolean flag which indicates whether microsoft routing storage endpoints are to be published + */ + private Boolean publishMicrosoftEndpoints; + + /* + * A boolean flag which indicates whether internet routing storage endpoints are to be published + */ + private Boolean publishInternetEndpoints; + + /** + * Creates an instance of RoutingPreference class. + */ + public RoutingPreference() { + } + + /** + * Get the routingChoice property: Routing Choice defines the kind of network routing opted by the user. + * + * @return the routingChoice value. + */ + public RoutingChoice routingChoice() { + return this.routingChoice; + } + + /** + * Set the routingChoice property: Routing Choice defines the kind of network routing opted by the user. + * + * @param routingChoice the routingChoice value to set. + * @return the RoutingPreference object itself. + */ + public RoutingPreference withRoutingChoice(RoutingChoice routingChoice) { + this.routingChoice = routingChoice; + return this; + } + + /** + * Get the publishMicrosoftEndpoints property: A boolean flag which indicates whether microsoft routing storage + * endpoints are to be published. + * + * @return the publishMicrosoftEndpoints value. + */ + public Boolean publishMicrosoftEndpoints() { + return this.publishMicrosoftEndpoints; + } + + /** + * Set the publishMicrosoftEndpoints property: A boolean flag which indicates whether microsoft routing storage + * endpoints are to be published. + * + * @param publishMicrosoftEndpoints the publishMicrosoftEndpoints value to set. + * @return the RoutingPreference object itself. + */ + public RoutingPreference withPublishMicrosoftEndpoints(Boolean publishMicrosoftEndpoints) { + this.publishMicrosoftEndpoints = publishMicrosoftEndpoints; + return this; + } + + /** + * Get the publishInternetEndpoints property: A boolean flag which indicates whether internet routing storage + * endpoints are to be published. + * + * @return the publishInternetEndpoints value. + */ + public Boolean publishInternetEndpoints() { + return this.publishInternetEndpoints; + } + + /** + * Set the publishInternetEndpoints property: A boolean flag which indicates whether internet routing storage + * endpoints are to be published. + * + * @param publishInternetEndpoints the publishInternetEndpoints value to set. + * @return the RoutingPreference object itself. + */ + public RoutingPreference withPublishInternetEndpoints(Boolean publishInternetEndpoints) { + this.publishInternetEndpoints = publishInternetEndpoints; + 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("routingChoice", this.routingChoice == null ? null : this.routingChoice.toString()); + jsonWriter.writeBooleanField("publishMicrosoftEndpoints", this.publishMicrosoftEndpoints); + jsonWriter.writeBooleanField("publishInternetEndpoints", this.publishInternetEndpoints); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RoutingPreference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RoutingPreference 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 RoutingPreference. + */ + public static RoutingPreference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RoutingPreference deserializedRoutingPreference = new RoutingPreference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("routingChoice".equals(fieldName)) { + deserializedRoutingPreference.routingChoice = RoutingChoice.fromString(reader.getString()); + } else if ("publishMicrosoftEndpoints".equals(fieldName)) { + deserializedRoutingPreference.publishMicrosoftEndpoints + = reader.getNullable(JsonReader::getBoolean); + } else if ("publishInternetEndpoints".equals(fieldName)) { + deserializedRoutingPreference.publishInternetEndpoints = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedRoutingPreference; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RuleType.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RuleType.java new file mode 100644 index 0000000000000..88178a162571a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RuleType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The valid value is Lifecycle. + */ +public final class RuleType extends ExpandableStringEnum { + /** + * Static value Lifecycle for RuleType. + */ + public static final RuleType LIFECYCLE = fromString("Lifecycle"); + + /** + * Creates a new instance of RuleType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RuleType() { + } + + /** + * Creates or finds a RuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleType. + */ + public static RuleType fromString(String name) { + return fromString(name, RuleType.class); + } + + /** + * Gets known RuleType values. + * + * @return known RuleType values. + */ + public static Collection values() { + return values(RuleType.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RunResult.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RunResult.java new file mode 100644 index 0000000000000..54285b4cf75e3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RunResult.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Represents the overall result of the execution for the run instance. + */ +public final class RunResult extends ExpandableStringEnum { + /** + * Static value Succeeded for RunResult. + */ + public static final RunResult SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for RunResult. + */ + public static final RunResult FAILED = fromString("Failed"); + + /** + * Creates a new instance of RunResult value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RunResult() { + } + + /** + * Creates or finds a RunResult from its string representation. + * + * @param name a name to look for. + * @return the corresponding RunResult. + */ + public static RunResult fromString(String name) { + return fromString(name, RunResult.class); + } + + /** + * Gets known RunResult values. + * + * @return known RunResult values. + */ + public static Collection values() { + return values(RunResult.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RunStatusEnum.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RunStatusEnum.java new file mode 100644 index 0000000000000..c1656537223b0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RunStatusEnum.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Represents the status of the execution. + */ +public final class RunStatusEnum extends ExpandableStringEnum { + /** + * Static value InProgress for RunStatusEnum. + */ + public static final RunStatusEnum IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Finished for RunStatusEnum. + */ + public static final RunStatusEnum FINISHED = fromString("Finished"); + + /** + * Creates a new instance of RunStatusEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RunStatusEnum() { + } + + /** + * Creates or finds a RunStatusEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding RunStatusEnum. + */ + public static RunStatusEnum fromString(String name) { + return fromString(name, RunStatusEnum.class); + } + + /** + * Gets known RunStatusEnum values. + * + * @return known RunStatusEnum values. + */ + public static Collection values() { + return values(RunStatusEnum.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SasPolicy.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SasPolicy.java new file mode 100644 index 0000000000000..006805041953d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SasPolicy.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * SasPolicy assigned to the storage account. + */ +@Fluent +public final class SasPolicy implements JsonSerializable { + /* + * The SAS expiration period, DD.HH:MM:SS. + */ + private String sasExpirationPeriod; + + /* + * The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The + * 'Log' action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS + * tokens that do not adhere to the sas policy expiration period. + */ + private ExpirationAction expirationAction; + + /** + * Creates an instance of SasPolicy class. + */ + public SasPolicy() { + } + + /** + * Get the sasExpirationPeriod property: The SAS expiration period, DD.HH:MM:SS. + * + * @return the sasExpirationPeriod value. + */ + public String sasExpirationPeriod() { + return this.sasExpirationPeriod; + } + + /** + * Set the sasExpirationPeriod property: The SAS expiration period, DD.HH:MM:SS. + * + * @param sasExpirationPeriod the sasExpirationPeriod value to set. + * @return the SasPolicy object itself. + */ + public SasPolicy withSasExpirationPeriod(String sasExpirationPeriod) { + this.sasExpirationPeriod = sasExpirationPeriod; + return this; + } + + /** + * Get the expirationAction property: The SAS Expiration Action defines the action to be performed when + * sasPolicy.sasExpirationPeriod is violated. The 'Log' action can be used for audit purposes and the 'Block' action + * can be used to block and deny the usage of SAS tokens that do not adhere to the sas policy expiration period. + * + * @return the expirationAction value. + */ + public ExpirationAction expirationAction() { + return this.expirationAction; + } + + /** + * Set the expirationAction property: The SAS Expiration Action defines the action to be performed when + * sasPolicy.sasExpirationPeriod is violated. The 'Log' action can be used for audit purposes and the 'Block' action + * can be used to block and deny the usage of SAS tokens that do not adhere to the sas policy expiration period. + * + * @param expirationAction the expirationAction value to set. + * @return the SasPolicy object itself. + */ + public SasPolicy withExpirationAction(ExpirationAction expirationAction) { + this.expirationAction = expirationAction; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sasExpirationPeriod() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property sasExpirationPeriod in model SasPolicy")); + } + if (expirationAction() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property expirationAction in model SasPolicy")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SasPolicy.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sasExpirationPeriod", this.sasExpirationPeriod); + jsonWriter.writeStringField("expirationAction", + this.expirationAction == null ? null : this.expirationAction.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SasPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SasPolicy 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 SasPolicy. + */ + public static SasPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SasPolicy deserializedSasPolicy = new SasPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sasExpirationPeriod".equals(fieldName)) { + deserializedSasPolicy.sasExpirationPeriod = reader.getString(); + } else if ("expirationAction".equals(fieldName)) { + deserializedSasPolicy.expirationAction = ExpirationAction.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSasPolicy; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Schedule.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Schedule.java new file mode 100644 index 0000000000000..81ce4eede1158 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Schedule.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * This is a required field. This field is used to schedule an inventory formation. + */ +public final class Schedule extends ExpandableStringEnum { + /** + * Static value Daily for Schedule. + */ + public static final Schedule DAILY = fromString("Daily"); + + /** + * Static value Weekly for Schedule. + */ + public static final Schedule WEEKLY = fromString("Weekly"); + + /** + * Creates a new instance of Schedule value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Schedule() { + } + + /** + * Creates or finds a Schedule from its string representation. + * + * @param name a name to look for. + * @return the corresponding Schedule. + */ + public static Schedule fromString(String name) { + return fromString(name, Schedule.class); + } + + /** + * Gets known Schedule values. + * + * @return known Schedule values. + */ + public static Collection values() { + return values(Schedule.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ServiceSasParameters.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ServiceSasParameters.java new file mode 100644 index 0000000000000..1b9232cd535e3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ServiceSasParameters.java @@ -0,0 +1,598 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +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.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * The parameters to list service SAS credentials of a specific resource. + */ +@Fluent +public final class ServiceSasParameters implements JsonSerializable { + /* + * The canonical path to the signed resource. + */ + private String canonicalizedResource; + + /* + * The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), + * Share (s). + */ + private SignedResource resource; + + /* + * The signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), + * Add (a), Create (c), Update (u) and Process (p). + */ + private Permissions permissions; + + /* + * An IP address or a range of IP addresses from which to accept requests. + */ + private String ipAddressOrRange; + + /* + * The protocol permitted for a request made with the account SAS. + */ + private HttpProtocol protocols; + + /* + * The time at which the SAS becomes valid. + */ + private OffsetDateTime sharedAccessStartTime; + + /* + * The time at which the shared access signature becomes invalid. + */ + private OffsetDateTime sharedAccessExpiryTime; + + /* + * A unique value up to 64 characters in length that correlates to an access policy specified for the container, + * queue, or table. + */ + private String identifier; + + /* + * The start of partition key. + */ + private String partitionKeyStart; + + /* + * The end of partition key. + */ + private String partitionKeyEnd; + + /* + * The start of row key. + */ + private String rowKeyStart; + + /* + * The end of row key. + */ + private String rowKeyEnd; + + /* + * The key to sign the account SAS token with. + */ + private String keyToSign; + + /* + * The response header override for cache control. + */ + private String cacheControl; + + /* + * The response header override for content disposition. + */ + private String contentDisposition; + + /* + * The response header override for content encoding. + */ + private String contentEncoding; + + /* + * The response header override for content language. + */ + private String contentLanguage; + + /* + * The response header override for content type. + */ + private String contentType; + + /** + * Creates an instance of ServiceSasParameters class. + */ + public ServiceSasParameters() { + } + + /** + * Get the canonicalizedResource property: The canonical path to the signed resource. + * + * @return the canonicalizedResource value. + */ + public String canonicalizedResource() { + return this.canonicalizedResource; + } + + /** + * Set the canonicalizedResource property: The canonical path to the signed resource. + * + * @param canonicalizedResource the canonicalizedResource value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withCanonicalizedResource(String canonicalizedResource) { + this.canonicalizedResource = canonicalizedResource; + return this; + } + + /** + * Get the resource property: The signed services accessible with the service SAS. Possible values include: Blob + * (b), Container (c), File (f), Share (s). + * + * @return the resource value. + */ + public SignedResource resource() { + return this.resource; + } + + /** + * Set the resource property: The signed services accessible with the service SAS. Possible values include: Blob + * (b), Container (c), File (f), Share (s). + * + * @param resource the resource value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withResource(SignedResource resource) { + this.resource = resource; + return this; + } + + /** + * Get the permissions property: The signed permissions for the service SAS. Possible values include: Read (r), + * Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). + * + * @return the permissions value. + */ + public Permissions permissions() { + return this.permissions; + } + + /** + * Set the permissions property: The signed permissions for the service SAS. Possible values include: Read (r), + * Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). + * + * @param permissions the permissions value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withPermissions(Permissions permissions) { + this.permissions = permissions; + return this; + } + + /** + * Get the ipAddressOrRange property: An IP address or a range of IP addresses from which to accept requests. + * + * @return the ipAddressOrRange value. + */ + public String ipAddressOrRange() { + return this.ipAddressOrRange; + } + + /** + * Set the ipAddressOrRange property: An IP address or a range of IP addresses from which to accept requests. + * + * @param ipAddressOrRange the ipAddressOrRange value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withIpAddressOrRange(String ipAddressOrRange) { + this.ipAddressOrRange = ipAddressOrRange; + return this; + } + + /** + * Get the protocols property: The protocol permitted for a request made with the account SAS. + * + * @return the protocols value. + */ + public HttpProtocol protocols() { + return this.protocols; + } + + /** + * Set the protocols property: The protocol permitted for a request made with the account SAS. + * + * @param protocols the protocols value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withProtocols(HttpProtocol protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get the sharedAccessStartTime property: The time at which the SAS becomes valid. + * + * @return the sharedAccessStartTime value. + */ + public OffsetDateTime sharedAccessStartTime() { + return this.sharedAccessStartTime; + } + + /** + * Set the sharedAccessStartTime property: The time at which the SAS becomes valid. + * + * @param sharedAccessStartTime the sharedAccessStartTime value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withSharedAccessStartTime(OffsetDateTime sharedAccessStartTime) { + this.sharedAccessStartTime = sharedAccessStartTime; + return this; + } + + /** + * Get the sharedAccessExpiryTime property: The time at which the shared access signature becomes invalid. + * + * @return the sharedAccessExpiryTime value. + */ + public OffsetDateTime sharedAccessExpiryTime() { + return this.sharedAccessExpiryTime; + } + + /** + * Set the sharedAccessExpiryTime property: The time at which the shared access signature becomes invalid. + * + * @param sharedAccessExpiryTime the sharedAccessExpiryTime value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withSharedAccessExpiryTime(OffsetDateTime sharedAccessExpiryTime) { + this.sharedAccessExpiryTime = sharedAccessExpiryTime; + return this; + } + + /** + * Get the identifier property: A unique value up to 64 characters in length that correlates to an access policy + * specified for the container, queue, or table. + * + * @return the identifier value. + */ + public String identifier() { + return this.identifier; + } + + /** + * Set the identifier property: A unique value up to 64 characters in length that correlates to an access policy + * specified for the container, queue, or table. + * + * @param identifier the identifier value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withIdentifier(String identifier) { + this.identifier = identifier; + return this; + } + + /** + * Get the partitionKeyStart property: The start of partition key. + * + * @return the partitionKeyStart value. + */ + public String partitionKeyStart() { + return this.partitionKeyStart; + } + + /** + * Set the partitionKeyStart property: The start of partition key. + * + * @param partitionKeyStart the partitionKeyStart value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withPartitionKeyStart(String partitionKeyStart) { + this.partitionKeyStart = partitionKeyStart; + return this; + } + + /** + * Get the partitionKeyEnd property: The end of partition key. + * + * @return the partitionKeyEnd value. + */ + public String partitionKeyEnd() { + return this.partitionKeyEnd; + } + + /** + * Set the partitionKeyEnd property: The end of partition key. + * + * @param partitionKeyEnd the partitionKeyEnd value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withPartitionKeyEnd(String partitionKeyEnd) { + this.partitionKeyEnd = partitionKeyEnd; + return this; + } + + /** + * Get the rowKeyStart property: The start of row key. + * + * @return the rowKeyStart value. + */ + public String rowKeyStart() { + return this.rowKeyStart; + } + + /** + * Set the rowKeyStart property: The start of row key. + * + * @param rowKeyStart the rowKeyStart value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withRowKeyStart(String rowKeyStart) { + this.rowKeyStart = rowKeyStart; + return this; + } + + /** + * Get the rowKeyEnd property: The end of row key. + * + * @return the rowKeyEnd value. + */ + public String rowKeyEnd() { + return this.rowKeyEnd; + } + + /** + * Set the rowKeyEnd property: The end of row key. + * + * @param rowKeyEnd the rowKeyEnd value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withRowKeyEnd(String rowKeyEnd) { + this.rowKeyEnd = rowKeyEnd; + return this; + } + + /** + * Get the keyToSign property: The key to sign the account SAS token with. + * + * @return the keyToSign value. + */ + public String keyToSign() { + return this.keyToSign; + } + + /** + * Set the keyToSign property: The key to sign the account SAS token with. + * + * @param keyToSign the keyToSign value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withKeyToSign(String keyToSign) { + this.keyToSign = keyToSign; + return this; + } + + /** + * Get the cacheControl property: The response header override for cache control. + * + * @return the cacheControl value. + */ + public String cacheControl() { + return this.cacheControl; + } + + /** + * Set the cacheControl property: The response header override for cache control. + * + * @param cacheControl the cacheControl value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withCacheControl(String cacheControl) { + this.cacheControl = cacheControl; + return this; + } + + /** + * Get the contentDisposition property: The response header override for content disposition. + * + * @return the contentDisposition value. + */ + public String contentDisposition() { + return this.contentDisposition; + } + + /** + * Set the contentDisposition property: The response header override for content disposition. + * + * @param contentDisposition the contentDisposition value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withContentDisposition(String contentDisposition) { + this.contentDisposition = contentDisposition; + return this; + } + + /** + * Get the contentEncoding property: The response header override for content encoding. + * + * @return the contentEncoding value. + */ + public String contentEncoding() { + return this.contentEncoding; + } + + /** + * Set the contentEncoding property: The response header override for content encoding. + * + * @param contentEncoding the contentEncoding value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withContentEncoding(String contentEncoding) { + this.contentEncoding = contentEncoding; + return this; + } + + /** + * Get the contentLanguage property: The response header override for content language. + * + * @return the contentLanguage value. + */ + public String contentLanguage() { + return this.contentLanguage; + } + + /** + * Set the contentLanguage property: The response header override for content language. + * + * @param contentLanguage the contentLanguage value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withContentLanguage(String contentLanguage) { + this.contentLanguage = contentLanguage; + return this; + } + + /** + * Get the contentType property: The response header override for content type. + * + * @return the contentType value. + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType property: The response header override for content type. + * + * @param contentType the contentType value to set. + * @return the ServiceSasParameters object itself. + */ + public ServiceSasParameters withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (canonicalizedResource() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property canonicalizedResource in model ServiceSasParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ServiceSasParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("canonicalizedResource", this.canonicalizedResource); + jsonWriter.writeStringField("signedResource", this.resource == null ? null : this.resource.toString()); + jsonWriter.writeStringField("signedPermission", this.permissions == null ? null : this.permissions.toString()); + jsonWriter.writeStringField("signedIp", this.ipAddressOrRange); + jsonWriter.writeStringField("signedProtocol", this.protocols == null ? null : this.protocols.toString()); + jsonWriter.writeStringField("signedStart", + this.sharedAccessStartTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.sharedAccessStartTime)); + jsonWriter.writeStringField("signedExpiry", + this.sharedAccessExpiryTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.sharedAccessExpiryTime)); + jsonWriter.writeStringField("signedIdentifier", this.identifier); + jsonWriter.writeStringField("startPk", this.partitionKeyStart); + jsonWriter.writeStringField("endPk", this.partitionKeyEnd); + jsonWriter.writeStringField("startRk", this.rowKeyStart); + jsonWriter.writeStringField("endRk", this.rowKeyEnd); + jsonWriter.writeStringField("keyToSign", this.keyToSign); + jsonWriter.writeStringField("rscc", this.cacheControl); + jsonWriter.writeStringField("rscd", this.contentDisposition); + jsonWriter.writeStringField("rsce", this.contentEncoding); + jsonWriter.writeStringField("rscl", this.contentLanguage); + jsonWriter.writeStringField("rsct", this.contentType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceSasParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceSasParameters 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 ServiceSasParameters. + */ + public static ServiceSasParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceSasParameters deserializedServiceSasParameters = new ServiceSasParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("canonicalizedResource".equals(fieldName)) { + deserializedServiceSasParameters.canonicalizedResource = reader.getString(); + } else if ("signedResource".equals(fieldName)) { + deserializedServiceSasParameters.resource = SignedResource.fromString(reader.getString()); + } else if ("signedPermission".equals(fieldName)) { + deserializedServiceSasParameters.permissions = Permissions.fromString(reader.getString()); + } else if ("signedIp".equals(fieldName)) { + deserializedServiceSasParameters.ipAddressOrRange = reader.getString(); + } else if ("signedProtocol".equals(fieldName)) { + deserializedServiceSasParameters.protocols = HttpProtocol.fromString(reader.getString()); + } else if ("signedStart".equals(fieldName)) { + deserializedServiceSasParameters.sharedAccessStartTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("signedExpiry".equals(fieldName)) { + deserializedServiceSasParameters.sharedAccessExpiryTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("signedIdentifier".equals(fieldName)) { + deserializedServiceSasParameters.identifier = reader.getString(); + } else if ("startPk".equals(fieldName)) { + deserializedServiceSasParameters.partitionKeyStart = reader.getString(); + } else if ("endPk".equals(fieldName)) { + deserializedServiceSasParameters.partitionKeyEnd = reader.getString(); + } else if ("startRk".equals(fieldName)) { + deserializedServiceSasParameters.rowKeyStart = reader.getString(); + } else if ("endRk".equals(fieldName)) { + deserializedServiceSasParameters.rowKeyEnd = reader.getString(); + } else if ("keyToSign".equals(fieldName)) { + deserializedServiceSasParameters.keyToSign = reader.getString(); + } else if ("rscc".equals(fieldName)) { + deserializedServiceSasParameters.cacheControl = reader.getString(); + } else if ("rscd".equals(fieldName)) { + deserializedServiceSasParameters.contentDisposition = reader.getString(); + } else if ("rsce".equals(fieldName)) { + deserializedServiceSasParameters.contentEncoding = reader.getString(); + } else if ("rscl".equals(fieldName)) { + deserializedServiceSasParameters.contentLanguage = reader.getString(); + } else if ("rsct".equals(fieldName)) { + deserializedServiceSasParameters.contentType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceSasParameters; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ServiceSpecification.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ServiceSpecification.java new file mode 100644 index 0000000000000..2cfe098e2dc0a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ServiceSpecification.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.List; + +/** + * One property of operation, include metric specifications. + */ +@Fluent +public final class ServiceSpecification implements JsonSerializable { + /* + * Metric specifications of operation. + */ + private List metricSpecifications; + + /** + * Creates an instance of ServiceSpecification class. + */ + public ServiceSpecification() { + } + + /** + * Get the metricSpecifications property: Metric specifications of operation. + * + * @return the metricSpecifications value. + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set the metricSpecifications property: Metric specifications of operation. + * + * @param metricSpecifications the metricSpecifications value to set. + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metricSpecifications() != null) { + metricSpecifications().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("metricSpecifications", this.metricSpecifications, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceSpecification 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 ServiceSpecification. + */ + public static ServiceSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceSpecification deserializedServiceSpecification = new ServiceSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metricSpecifications".equals(fieldName)) { + List metricSpecifications + = reader.readArray(reader1 -> MetricSpecification.fromJson(reader1)); + deserializedServiceSpecification.metricSpecifications = metricSpecifications; + } else { + reader.skipChildren(); + } + } + + return deserializedServiceSpecification; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Services.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Services.java new file mode 100644 index 0000000000000..210bcf0c77ce3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Services.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File + * (f). + */ +public final class Services extends ExpandableStringEnum { + /** + * Static value b for Services. + */ + public static final Services B = fromString("b"); + + /** + * Static value q for Services. + */ + public static final Services Q = fromString("q"); + + /** + * Static value t for Services. + */ + public static final Services T = fromString("t"); + + /** + * Static value f for Services. + */ + public static final Services F = fromString("f"); + + /** + * Creates a new instance of Services value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Services() { + } + + /** + * Creates or finds a Services from its string representation. + * + * @param name a name to look for. + * @return the corresponding Services. + */ + public static Services fromString(String name) { + return fromString(name, Services.class); + } + + /** + * Gets known Services values. + * + * @return known Services values. + */ + public static Collection values() { + return values(Services.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Severity.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Severity.java new file mode 100644 index 0000000000000..60a8fb3c80d8f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Severity.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Severity of the issue. + */ +public final class Severity extends ExpandableStringEnum { + /** + * Static value Warning for Severity. + */ + public static final Severity WARNING = fromString("Warning"); + + /** + * Static value Error for Severity. + */ + public static final Severity ERROR = fromString("Error"); + + /** + * Creates a new instance of Severity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Severity() { + } + + /** + * Creates or finds a Severity from its string representation. + * + * @param name a name to look for. + * @return the corresponding Severity. + */ + public static Severity fromString(String name) { + return fromString(name, Severity.class); + } + + /** + * Gets known Severity values. + * + * @return known Severity values. + */ + public static Collection values() { + return values(Severity.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ShareAccessTier.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ShareAccessTier.java new file mode 100644 index 0000000000000..40529761aeb10 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ShareAccessTier.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. + * FileStorage account can choose Premium. + */ +public final class ShareAccessTier extends ExpandableStringEnum { + /** + * Static value TransactionOptimized for ShareAccessTier. + */ + public static final ShareAccessTier TRANSACTION_OPTIMIZED = fromString("TransactionOptimized"); + + /** + * Static value Hot for ShareAccessTier. + */ + public static final ShareAccessTier HOT = fromString("Hot"); + + /** + * Static value Cool for ShareAccessTier. + */ + public static final ShareAccessTier COOL = fromString("Cool"); + + /** + * Static value Premium for ShareAccessTier. + */ + public static final ShareAccessTier PREMIUM = fromString("Premium"); + + /** + * Creates a new instance of ShareAccessTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ShareAccessTier() { + } + + /** + * Creates or finds a ShareAccessTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding ShareAccessTier. + */ + public static ShareAccessTier fromString(String name) { + return fromString(name, ShareAccessTier.class); + } + + /** + * Gets known ShareAccessTier values. + * + * @return known ShareAccessTier values. + */ + public static Collection values() { + return values(ShareAccessTier.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SignedIdentifier.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SignedIdentifier.java new file mode 100644 index 0000000000000..aed70c93356dd --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SignedIdentifier.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 SignedIdentifier model. + */ +@Fluent +public final class SignedIdentifier implements JsonSerializable { + /* + * An unique identifier of the stored access policy. + */ + private String id; + + /* + * Access policy + */ + private AccessPolicy accessPolicy; + + /** + * Creates an instance of SignedIdentifier class. + */ + public SignedIdentifier() { + } + + /** + * Get the id property: An unique identifier of the stored access policy. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: An unique identifier of the stored access policy. + * + * @param id the id value to set. + * @return the SignedIdentifier object itself. + */ + public SignedIdentifier withId(String id) { + this.id = id; + return this; + } + + /** + * Get the accessPolicy property: Access policy. + * + * @return the accessPolicy value. + */ + public AccessPolicy accessPolicy() { + return this.accessPolicy; + } + + /** + * Set the accessPolicy property: Access policy. + * + * @param accessPolicy the accessPolicy value to set. + * @return the SignedIdentifier object itself. + */ + public SignedIdentifier withAccessPolicy(AccessPolicy accessPolicy) { + this.accessPolicy = accessPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (accessPolicy() != null) { + accessPolicy().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("accessPolicy", this.accessPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SignedIdentifier from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SignedIdentifier 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 SignedIdentifier. + */ + public static SignedIdentifier fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SignedIdentifier deserializedSignedIdentifier = new SignedIdentifier(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSignedIdentifier.id = reader.getString(); + } else if ("accessPolicy".equals(fieldName)) { + deserializedSignedIdentifier.accessPolicy = AccessPolicy.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSignedIdentifier; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SignedResource.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SignedResource.java new file mode 100644 index 0000000000000..115411d9dbccf --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SignedResource.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), + * Share (s). + */ +public final class SignedResource extends ExpandableStringEnum { + /** + * Static value b for SignedResource. + */ + public static final SignedResource B = fromString("b"); + + /** + * Static value c for SignedResource. + */ + public static final SignedResource C = fromString("c"); + + /** + * Static value f for SignedResource. + */ + public static final SignedResource F = fromString("f"); + + /** + * Static value s for SignedResource. + */ + public static final SignedResource S = fromString("s"); + + /** + * Creates a new instance of SignedResource value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SignedResource() { + } + + /** + * Creates or finds a SignedResource from its string representation. + * + * @param name a name to look for. + * @return the corresponding SignedResource. + */ + public static SignedResource fromString(String name) { + return fromString(name, SignedResource.class); + } + + /** + * Gets known SignedResource values. + * + * @return known SignedResource values. + */ + public static Collection values() { + return values(SignedResource.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SignedResourceTypes.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SignedResourceTypes.java new file mode 100644 index 0000000000000..d919d88619f1f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SignedResourceTypes.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; + * Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, + * table entities, and files. + */ +public final class SignedResourceTypes extends ExpandableStringEnum { + /** + * Static value s for SignedResourceTypes. + */ + public static final SignedResourceTypes S = fromString("s"); + + /** + * Static value c for SignedResourceTypes. + */ + public static final SignedResourceTypes C = fromString("c"); + + /** + * Static value o for SignedResourceTypes. + */ + public static final SignedResourceTypes O = fromString("o"); + + /** + * Creates a new instance of SignedResourceTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SignedResourceTypes() { + } + + /** + * Creates or finds a SignedResourceTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding SignedResourceTypes. + */ + public static SignedResourceTypes fromString(String name) { + return fromString(name, SignedResourceTypes.class); + } + + /** + * Gets known SignedResourceTypes values. + * + * @return known SignedResourceTypes values. + */ + public static Collection values() { + return values(SignedResourceTypes.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Sku.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Sku.java new file mode 100644 index 0000000000000..4cfd5d82d26a6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Sku.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * The SKU of the storage account. + */ +@Fluent +public final class Sku implements JsonSerializable { + /* + * The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was + * called accountType. + */ + private SkuName name; + + /* + * The SKU tier. This is based on the SKU name. + */ + private SkuTier tier; + + /** + * Creates an instance of Sku class. + */ + public Sku() { + } + + /** + * Get the name property: The SKU name. Required for account creation; optional for update. Note that in older + * versions, SKU name was called accountType. + * + * @return the name value. + */ + public SkuName name() { + return this.name; + } + + /** + * Set the name property: The SKU name. Required for account creation; optional for update. Note that in older + * versions, SKU name was called accountType. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The SKU tier. This is based on the SKU name. + * + * @return the tier value. + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property name in model Sku")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Sku.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Sku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Sku 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 Sku. + */ + public static Sku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Sku deserializedSku = new Sku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSku.name = SkuName.fromString(reader.getString()); + } else if ("tier".equals(fieldName)) { + deserializedSku.tier = SkuTier.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSku; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuCapability.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuCapability.java new file mode 100644 index 0000000000000..cc8da02df6383 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuCapability.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * The capability information in the specified SKU, including file encryption, network ACLs, change notification, etc. + */ +@Immutable +public final class SkuCapability implements JsonSerializable { + /* + * The name of capability, The capability information in the specified SKU, including file encryption, network ACLs, + * change notification, etc. + */ + private String name; + + /* + * A string value to indicate states of given capability. Possibly 'true' or 'false'. + */ + private String value; + + /** + * Creates an instance of SkuCapability class. + */ + public SkuCapability() { + } + + /** + * Get the name property: The name of capability, The capability information in the specified SKU, including file + * encryption, network ACLs, change notification, etc. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the value property: A string value to indicate states of given capability. Possibly 'true' or 'false'. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * 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 SkuCapability from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SkuCapability 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 SkuCapability. + */ + public static SkuCapability fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SkuCapability deserializedSkuCapability = new SkuCapability(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSkuCapability.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedSkuCapability.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSkuCapability; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuConversionStatus.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuConversionStatus.java new file mode 100644 index 0000000000000..22864a4fc65f3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuConversionStatus.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * This property indicates the current sku conversion status. + */ +public final class SkuConversionStatus extends ExpandableStringEnum { + /** + * Static value InProgress for SkuConversionStatus. + */ + public static final SkuConversionStatus IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Succeeded for SkuConversionStatus. + */ + public static final SkuConversionStatus SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for SkuConversionStatus. + */ + public static final SkuConversionStatus FAILED = fromString("Failed"); + + /** + * Creates a new instance of SkuConversionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SkuConversionStatus() { + } + + /** + * Creates or finds a SkuConversionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuConversionStatus. + */ + public static SkuConversionStatus fromString(String name) { + return fromString(name, SkuConversionStatus.class); + } + + /** + * Gets known SkuConversionStatus values. + * + * @return known SkuConversionStatus values. + */ + public static Collection values() { + return values(SkuConversionStatus.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuInformation.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuInformation.java new file mode 100644 index 0000000000000..70a4b74d8700d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuInformation.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.SkuInformationInner; +import java.util.List; + +/** + * An immutable client-side representation of SkuInformation. + */ +public interface SkuInformation { + /** + * Gets the name property: The SKU name. Required for account creation; optional for update. Note that in older + * versions, SKU name was called accountType. + * + * @return the name value. + */ + SkuName name(); + + /** + * Gets the tier property: The SKU tier. This is based on the SKU name. + * + * @return the tier value. + */ + SkuTier tier(); + + /** + * Gets the resourceType property: The type of the resource, usually it is 'storageAccounts'. + * + * @return the resourceType value. + */ + String resourceType(); + + /** + * Gets the kind property: Indicates the type of storage account. + * + * @return the kind value. + */ + Kind kind(); + + /** + * Gets the locations property: The set of locations that the SKU is available. This will be supported and + * registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). + * + * @return the locations value. + */ + List locations(); + + /** + * Gets the capabilities property: The capability information in the specified SKU, including file encryption, + * network ACLs, change notification, etc. + * + * @return the capabilities value. + */ + List capabilities(); + + /** + * Gets the restrictions property: The restrictions because of which SKU cannot be used. This is empty if there are + * no restrictions. + * + * @return the restrictions value. + */ + List restrictions(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.SkuInformationInner object. + * + * @return the inner object. + */ + SkuInformationInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuName.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuName.java new file mode 100644 index 0000000000000..1c674a191170d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuName.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called + * accountType. + */ +public final class SkuName extends ExpandableStringEnum { + /** + * Static value Standard_LRS for SkuName. + */ + public static final SkuName STANDARD_LRS = fromString("Standard_LRS"); + + /** + * Static value Standard_GRS for SkuName. + */ + public static final SkuName STANDARD_GRS = fromString("Standard_GRS"); + + /** + * Static value Standard_RAGRS for SkuName. + */ + public static final SkuName STANDARD_RAGRS = fromString("Standard_RAGRS"); + + /** + * Static value Standard_ZRS for SkuName. + */ + public static final SkuName STANDARD_ZRS = fromString("Standard_ZRS"); + + /** + * Static value Premium_LRS for SkuName. + */ + public static final SkuName PREMIUM_LRS = fromString("Premium_LRS"); + + /** + * Static value Premium_ZRS for SkuName. + */ + public static final SkuName PREMIUM_ZRS = fromString("Premium_ZRS"); + + /** + * Static value Standard_GZRS for SkuName. + */ + public static final SkuName STANDARD_GZRS = fromString("Standard_GZRS"); + + /** + * Static value Standard_RAGZRS for SkuName. + */ + public static final SkuName STANDARD_RAGZRS = fromString("Standard_RAGZRS"); + + /** + * Static value StandardV2_LRS for SkuName. + */ + public static final SkuName STANDARD_V2_LRS = fromString("StandardV2_LRS"); + + /** + * Static value StandardV2_GRS for SkuName. + */ + public static final SkuName STANDARD_V2_GRS = fromString("StandardV2_GRS"); + + /** + * Static value StandardV2_ZRS for SkuName. + */ + public static final SkuName STANDARD_V2_ZRS = fromString("StandardV2_ZRS"); + + /** + * Static value StandardV2_GZRS for SkuName. + */ + public static final SkuName STANDARD_V2_GZRS = fromString("StandardV2_GZRS"); + + /** + * Static value PremiumV2_LRS for SkuName. + */ + public static final SkuName PREMIUM_V2_LRS = fromString("PremiumV2_LRS"); + + /** + * Static value PremiumV2_ZRS for SkuName. + */ + public static final SkuName PREMIUM_V2_ZRS = fromString("PremiumV2_ZRS"); + + /** + * Creates a new instance of SkuName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SkuName() { + } + + /** + * Creates or finds a SkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuName. + */ + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** + * Gets known SkuName values. + * + * @return known SkuName values. + */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuTier.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuTier.java new file mode 100644 index 0000000000000..26f54a2c32e8d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuTier.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +/** + * The SKU tier. This is based on the SKU name. + */ +public enum SkuTier { + /** + * Enum value Standard. + */ + STANDARD("Standard"), + + /** + * Enum value Premium. + */ + PREMIUM("Premium"); + + /** + * The actual serialized value for a SkuTier instance. + */ + private final String value; + + SkuTier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SkuTier instance. + * + * @param value the serialized value to parse. + * @return the parsed SkuTier object, or null if unable to parse. + */ + public static SkuTier fromString(String value) { + if (value == null) { + return null; + } + SkuTier[] items = SkuTier.values(); + for (SkuTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Skus.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Skus.java new file mode 100644 index 0000000000000..386a3180997da --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Skus.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of Skus. + */ +public interface Skus { + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @throws com.azure.core.management.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 from the List Storage SKUs operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists the available SKUs supported by Microsoft.Storage for given subscription. + * + * @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 from the List Storage SKUs operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SmbSetting.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SmbSetting.java new file mode 100644 index 0000000000000..090afd1d81405 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SmbSetting.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Setting for SMB protocol. + */ +@Fluent +public final class SmbSetting implements JsonSerializable { + /* + * Multichannel setting. Applies to Premium FileStorage only. + */ + private Multichannel multichannel; + + /* + * SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, SMB3.1.1. Should be passed as a + * string with delimiter ';'. + */ + private String versions; + + /* + * SMB authentication methods supported by server. Valid values are NTLMv2, Kerberos. Should be passed as a string + * with delimiter ';'. + */ + private String authenticationMethods; + + /* + * Kerberos ticket encryption supported by server. Valid values are RC4-HMAC, AES-256. Should be passed as a string + * with delimiter ';' + */ + private String kerberosTicketEncryption; + + /* + * SMB channel encryption supported by server. Valid values are AES-128-CCM, AES-128-GCM, AES-256-GCM. Should be + * passed as a string with delimiter ';'. + */ + private String channelEncryption; + + /** + * Creates an instance of SmbSetting class. + */ + public SmbSetting() { + } + + /** + * Get the multichannel property: Multichannel setting. Applies to Premium FileStorage only. + * + * @return the multichannel value. + */ + public Multichannel multichannel() { + return this.multichannel; + } + + /** + * Set the multichannel property: Multichannel setting. Applies to Premium FileStorage only. + * + * @param multichannel the multichannel value to set. + * @return the SmbSetting object itself. + */ + public SmbSetting withMultichannel(Multichannel multichannel) { + this.multichannel = multichannel; + return this; + } + + /** + * Get the versions property: SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, SMB3.1.1. + * Should be passed as a string with delimiter ';'. + * + * @return the versions value. + */ + public String versions() { + return this.versions; + } + + /** + * Set the versions property: SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, SMB3.1.1. + * Should be passed as a string with delimiter ';'. + * + * @param versions the versions value to set. + * @return the SmbSetting object itself. + */ + public SmbSetting withVersions(String versions) { + this.versions = versions; + return this; + } + + /** + * Get the authenticationMethods property: SMB authentication methods supported by server. Valid values are NTLMv2, + * Kerberos. Should be passed as a string with delimiter ';'. + * + * @return the authenticationMethods value. + */ + public String authenticationMethods() { + return this.authenticationMethods; + } + + /** + * Set the authenticationMethods property: SMB authentication methods supported by server. Valid values are NTLMv2, + * Kerberos. Should be passed as a string with delimiter ';'. + * + * @param authenticationMethods the authenticationMethods value to set. + * @return the SmbSetting object itself. + */ + public SmbSetting withAuthenticationMethods(String authenticationMethods) { + this.authenticationMethods = authenticationMethods; + return this; + } + + /** + * Get the kerberosTicketEncryption property: Kerberos ticket encryption supported by server. Valid values are + * RC4-HMAC, AES-256. Should be passed as a string with delimiter ';'. + * + * @return the kerberosTicketEncryption value. + */ + public String kerberosTicketEncryption() { + return this.kerberosTicketEncryption; + } + + /** + * Set the kerberosTicketEncryption property: Kerberos ticket encryption supported by server. Valid values are + * RC4-HMAC, AES-256. Should be passed as a string with delimiter ';'. + * + * @param kerberosTicketEncryption the kerberosTicketEncryption value to set. + * @return the SmbSetting object itself. + */ + public SmbSetting withKerberosTicketEncryption(String kerberosTicketEncryption) { + this.kerberosTicketEncryption = kerberosTicketEncryption; + return this; + } + + /** + * Get the channelEncryption property: SMB channel encryption supported by server. Valid values are AES-128-CCM, + * AES-128-GCM, AES-256-GCM. Should be passed as a string with delimiter ';'. + * + * @return the channelEncryption value. + */ + public String channelEncryption() { + return this.channelEncryption; + } + + /** + * Set the channelEncryption property: SMB channel encryption supported by server. Valid values are AES-128-CCM, + * AES-128-GCM, AES-256-GCM. Should be passed as a string with delimiter ';'. + * + * @param channelEncryption the channelEncryption value to set. + * @return the SmbSetting object itself. + */ + public SmbSetting withChannelEncryption(String channelEncryption) { + this.channelEncryption = channelEncryption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (multichannel() != null) { + multichannel().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("multichannel", this.multichannel); + jsonWriter.writeStringField("versions", this.versions); + jsonWriter.writeStringField("authenticationMethods", this.authenticationMethods); + jsonWriter.writeStringField("kerberosTicketEncryption", this.kerberosTicketEncryption); + jsonWriter.writeStringField("channelEncryption", this.channelEncryption); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SmbSetting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SmbSetting 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 SmbSetting. + */ + public static SmbSetting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SmbSetting deserializedSmbSetting = new SmbSetting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("multichannel".equals(fieldName)) { + deserializedSmbSetting.multichannel = Multichannel.fromJson(reader); + } else if ("versions".equals(fieldName)) { + deserializedSmbSetting.versions = reader.getString(); + } else if ("authenticationMethods".equals(fieldName)) { + deserializedSmbSetting.authenticationMethods = reader.getString(); + } else if ("kerberosTicketEncryption".equals(fieldName)) { + deserializedSmbSetting.kerberosTicketEncryption = reader.getString(); + } else if ("channelEncryption".equals(fieldName)) { + deserializedSmbSetting.channelEncryption = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSmbSetting; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SshPublicKey.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SshPublicKey.java new file mode 100644 index 0000000000000..3c1fe08e7a720 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SshPublicKey.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 SshPublicKey model. + */ +@Fluent +public final class SshPublicKey implements JsonSerializable { + /* + * Optional. It is used to store the function/usage of the key + */ + private String description; + + /* + * Ssh public key base64 encoded. The format should be: ' ', e.g. ssh-rsa AAAABBBB + */ + private String key; + + /** + * Creates an instance of SshPublicKey class. + */ + public SshPublicKey() { + } + + /** + * Get the description property: Optional. It is used to store the function/usage of the key. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Optional. It is used to store the function/usage of the key. + * + * @param description the description value to set. + * @return the SshPublicKey object itself. + */ + public SshPublicKey withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the key property: Ssh public key base64 encoded. The format should be: '<keyType> <keyData>', + * e.g. ssh-rsa AAAABBBB. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: Ssh public key base64 encoded. The format should be: '<keyType> <keyData>', + * e.g. ssh-rsa AAAABBBB. + * + * @param key the key value to set. + * @return the SshPublicKey object itself. + */ + public SshPublicKey withKey(String key) { + this.key = key; + 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("description", this.description); + jsonWriter.writeStringField("key", this.key); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SshPublicKey from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SshPublicKey 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 SshPublicKey. + */ + public static SshPublicKey fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SshPublicKey deserializedSshPublicKey = new SshPublicKey(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedSshPublicKey.description = reader.getString(); + } else if ("key".equals(fieldName)) { + deserializedSshPublicKey.key = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSshPublicKey; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/State.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/State.java new file mode 100644 index 0000000000000..05368ab77819b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/State.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Gets the state of virtual network rule. + */ +public final class State extends ExpandableStringEnum { + /** + * Static value Provisioning for State. + */ + public static final State PROVISIONING = fromString("Provisioning"); + + /** + * Static value Deprovisioning for State. + */ + public static final State DEPROVISIONING = fromString("Deprovisioning"); + + /** + * Static value Succeeded for State. + */ + public static final State SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for State. + */ + public static final State FAILED = fromString("Failed"); + + /** + * Static value NetworkSourceDeleted for State. + */ + public static final State NETWORK_SOURCE_DELETED = fromString("NetworkSourceDeleted"); + + /** + * Creates a new instance of State value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public State() { + } + + /** + * Creates or finds a State from its string representation. + * + * @param name a name to look for. + * @return the corresponding State. + */ + public static State fromString(String name) { + return fromString(name, State.class); + } + + /** + * Gets known State values. + * + * @return known State values. + */ + public static Collection values() { + return values(State.class); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccount.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccount.java new file mode 100644 index 0000000000000..4fd2e6a51d668 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccount.java @@ -0,0 +1,1611 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountInner; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountMigrationInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of StorageAccount. + */ +public interface StorageAccount { + /** + * 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 sku property: Gets the SKU. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the kind property: Gets the Kind. + * + * @return the kind value. + */ + Kind kind(); + + /** + * Gets the identity property: The identity of the resource. + * + * @return the identity value. + */ + Identity identity(); + + /** + * Gets the extendedLocation property: The extendedLocation of the resource. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the provisioningState property: Gets the status of the storage account at the time the operation was called. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the primaryEndpoints property: Gets the URLs that are used to perform a retrieval of a public blob, queue, + * or table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob endpoint. + * + * @return the primaryEndpoints value. + */ + Endpoints primaryEndpoints(); + + /** + * Gets the primaryLocation property: Gets the location of the primary data center for the storage account. + * + * @return the primaryLocation value. + */ + String primaryLocation(); + + /** + * Gets the statusOfPrimary property: Gets the status indicating whether the primary location of the storage account + * is available or unavailable. + * + * @return the statusOfPrimary value. + */ + AccountStatus statusOfPrimary(); + + /** + * Gets the lastGeoFailoverTime property: Gets the timestamp of the most recent instance of a failover to the + * secondary location. Only the most recent timestamp is retained. This element is not returned if there has never + * been a failover instance. Only available if the accountType is Standard_GRS or Standard_RAGRS. + * + * @return the lastGeoFailoverTime value. + */ + OffsetDateTime lastGeoFailoverTime(); + + /** + * Gets the secondaryLocation property: Gets the location of the geo-replicated secondary for the storage account. + * Only available if the accountType is Standard_GRS or Standard_RAGRS. + * + * @return the secondaryLocation value. + */ + String secondaryLocation(); + + /** + * Gets the statusOfSecondary property: Gets the status indicating whether the secondary location of the storage + * account is available or unavailable. Only available if the SKU name is Standard_GRS or Standard_RAGRS. + * + * @return the statusOfSecondary value. + */ + AccountStatus statusOfSecondary(); + + /** + * Gets the creationTime property: Gets the creation date and time of the storage account in UTC. + * + * @return the creationTime value. + */ + OffsetDateTime creationTime(); + + /** + * Gets the customDomain property: Gets the custom domain the user assigned to this storage account. + * + * @return the customDomain value. + */ + CustomDomain customDomain(); + + /** + * Gets the sasPolicy property: SasPolicy assigned to the storage account. + * + * @return the sasPolicy value. + */ + SasPolicy sasPolicy(); + + /** + * Gets the keyPolicy property: KeyPolicy assigned to the storage account. + * + * @return the keyPolicy value. + */ + KeyPolicy keyPolicy(); + + /** + * Gets the keyCreationTime property: Storage account keys creation time. + * + * @return the keyCreationTime value. + */ + KeyCreationTime keyCreationTime(); + + /** + * Gets the secondaryEndpoints property: Gets the URLs that are used to perform a retrieval of a public blob, queue, + * or table object from the secondary location of the storage account. Only available if the SKU name is + * Standard_RAGRS. + * + * @return the secondaryEndpoints value. + */ + Endpoints secondaryEndpoints(); + + /** + * Gets the encryption property: Encryption settings to be used for server-side encryption for the storage account. + * + * @return the encryption value. + */ + Encryption encryption(); + + /** + * Gets the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier is used for + * billing. The 'Premium' access tier is the default value for premium block blobs storage account type and it + * cannot be changed for the premium block blobs storage account type. + * + * @return the accessTier value. + */ + AccessTier accessTier(); + + /** + * Gets the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @return the azureFilesIdentityBasedAuthentication value. + */ + AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication(); + + /** + * Gets the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. + * + * @return the enableHttpsTrafficOnly value. + */ + Boolean enableHttpsTrafficOnly(); + + /** + * Gets the networkRuleSet property: Network rule set. + * + * @return the networkRuleSet value. + */ + NetworkRuleSet networkRuleSet(); + + /** + * Gets the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @return the isSftpEnabled value. + */ + Boolean isSftpEnabled(); + + /** + * Gets the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @return the isLocalUserEnabled value. + */ + Boolean isLocalUserEnabled(); + + /** + * Gets the enableExtendedGroups property: Enables extended group support with local users feature, if set to true. + * + * @return the enableExtendedGroups value. + */ + Boolean enableExtendedGroups(); + + /** + * Gets the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. + * + * @return the isHnsEnabled value. + */ + Boolean isHnsEnabled(); + + /** + * Gets the geoReplicationStats property: Geo Replication Stats. + * + * @return the geoReplicationStats value. + */ + GeoReplicationStats geoReplicationStats(); + + /** + * Gets the failoverInProgress property: If the failover is in progress, the value will be true, otherwise, it will + * be null. + * + * @return the failoverInProgress value. + */ + Boolean failoverInProgress(); + + /** + * Gets the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @return the largeFileSharesState value. + */ + LargeFileSharesState largeFileSharesState(); + + /** + * Gets the privateEndpointConnections property: List of private endpoint connection associated with the specified + * storage account. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @return the routingPreference value. + */ + RoutingPreference routingPreference(); + + /** + * Gets the blobRestoreStatus property: Blob restore status. + * + * @return the blobRestoreStatus value. + */ + BlobRestoreStatus blobRestoreStatus(); + + /** + * Gets the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the + * storage account. The default interpretation is false for this property. + * + * @return the allowBlobPublicAccess value. + */ + Boolean allowBlobPublicAccess(); + + /** + * Gets the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @return the minimumTlsVersion value. + */ + MinimumTlsVersion minimumTlsVersion(); + + /** + * Gets the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be authorized + * with the account access key via Shared Key. If false, then all requests, including shared access signatures, must + * be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. + * + * @return the allowSharedKeyAccess value. + */ + Boolean allowSharedKeyAccess(); + + /** + * Gets the enableNfsV3 property: NFS 3.0 protocol support enabled if set to true. + * + * @return the enableNfsV3 value. + */ + Boolean enableNfsV3(); + + /** + * Gets the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. Set this + * property to true for new or existing accounts only if object replication policies will involve storage accounts + * in different AAD tenants. The default interpretation is false for new accounts to follow best security practices + * by default. + * + * @return the allowCrossTenantReplication value. + */ + Boolean allowCrossTenantReplication(); + + /** + * Gets the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @return the defaultToOAuthAuthentication value. + */ + Boolean defaultToOAuthAuthentication(); + + /** + * Gets the publicNetworkAccess property: Allow, disallow, or let Network Security Perimeter configuration to + * evaluate public network access to Storage Account. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * Gets the immutableStorageWithVersioning property: The property is immutable and can only be set to true at the + * account creation time. When set to true, it enables object level immutability for all the containers in the + * account by default. + * + * @return the immutableStorageWithVersioning value. + */ + ImmutableStorageAccount immutableStorageWithVersioning(); + + /** + * Gets the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @return the allowedCopyScope value. + */ + AllowedCopyScope allowedCopyScope(); + + /** + * Gets the storageAccountSkuConversionStatus property: This property is readOnly and is set by server during + * asynchronous storage account sku conversion operations. + * + * @return the storageAccountSkuConversionStatus value. + */ + StorageAccountSkuConversionStatus storageAccountSkuConversionStatus(); + + /** + * Gets the dnsEndpointType property: Allows you to specify the type of endpoint. Set this to AzureDNSZone to create + * a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint + * URL will have an alphanumeric DNS Zone identifier. + * + * @return the dnsEndpointType value. + */ + DnsEndpointType dnsEndpointType(); + + /** + * Gets the isSkuConversionBlocked property: This property will be set to true or false on an event of ongoing + * migration. Default value is null. + * + * @return the isSkuConversionBlocked value. + */ + Boolean isSkuConversionBlocked(); + + /** + * Gets the accountMigrationInProgress property: If customer initiated account migration is in progress, the value + * will be true else it will be null. + * + * @return the accountMigrationInProgress value. + */ + Boolean accountMigrationInProgress(); + + /** + * 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.storage.generated.fluent.models.StorageAccountInner object. + * + * @return the inner object. + */ + StorageAccountInner innerModel(); + + /** + * The entirety of the StorageAccount definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, + DefinitionStages.WithSku, DefinitionStages.WithKind, DefinitionStages.WithCreate { + } + + /** + * The StorageAccount definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the StorageAccount definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the StorageAccount definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location Required. Gets or sets the location of the resource. This will be one of the supported + * and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + * resource cannot be changed once it is created, but if an identical geo region is specified on update, the + * request will succeed. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location Required. Gets or sets the location of the resource. This will be one of the supported + * and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + * resource cannot be changed once it is created, but if an identical geo region is specified on update, the + * request will succeed. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the StorageAccount definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @return the next definition stage. + */ + WithSku withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the StorageAccount definition allowing to specify sku. + */ + interface WithSku { + /** + * Specifies the sku property: Required. Gets or sets the SKU name.. + * + * @param sku Required. Gets or sets the SKU name. + * @return the next definition stage. + */ + WithKind withSku(Sku sku); + } + + /** + * The stage of the StorageAccount definition allowing to specify kind. + */ + interface WithKind { + /** + * Specifies the kind property: Required. Indicates the type of storage account.. + * + * @param kind Required. Indicates the type of storage account. + * @return the next definition stage. + */ + WithCreate withKind(Kind kind); + } + + /** + * The stage of the StorageAccount 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.WithExtendedLocation, DefinitionStages.WithIdentity, + DefinitionStages.WithAllowedCopyScope, DefinitionStages.WithPublicNetworkAccess, + DefinitionStages.WithSasPolicy, DefinitionStages.WithKeyPolicy, DefinitionStages.WithCustomDomain, + DefinitionStages.WithEncryption, DefinitionStages.WithNetworkRuleSet, DefinitionStages.WithAccessTier, + DefinitionStages.WithAzureFilesIdentityBasedAuthentication, DefinitionStages.WithEnableHttpsTrafficOnly, + DefinitionStages.WithIsSftpEnabled, DefinitionStages.WithIsLocalUserEnabled, + DefinitionStages.WithEnableExtendedGroups, DefinitionStages.WithIsHnsEnabled, + DefinitionStages.WithLargeFileSharesState, DefinitionStages.WithRoutingPreference, + DefinitionStages.WithAllowBlobPublicAccess, DefinitionStages.WithMinimumTlsVersion, + DefinitionStages.WithAllowSharedKeyAccess, DefinitionStages.WithEnableNfsV3, + DefinitionStages.WithAllowCrossTenantReplication, DefinitionStages.WithDefaultToOAuthAuthentication, + DefinitionStages.WithImmutableStorageWithVersioning, DefinitionStages.WithDnsEndpointType { + /** + * Executes the create request. + * + * @return the created resource. + */ + StorageAccount create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + StorageAccount create(Context context); + } + + /** + * The stage of the StorageAccount definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Gets or sets a list of key value pairs that describe the resource. These + * tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags + * can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and + * a value with a length no greater than 256 characters.. + * + * @param tags Gets or sets a list of key value pairs that describe the resource. These tags can be used for + * viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a + * resource. Each tag must have a key with a length no greater than 128 characters and a value with a length + * no greater than 256 characters. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the StorageAccount definition allowing to specify extendedLocation. + */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: Optional. Set the extended location of the resource. If not set, + * the storage account will be created in Azure main region. Otherwise it will be created in the specified + * extended location. + * + * @param extendedLocation Optional. Set the extended location of the resource. If not set, the storage + * account will be created in Azure main region. Otherwise it will be created in the specified extended + * location. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + + /** + * The stage of the StorageAccount definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the resource.. + * + * @param identity The identity of the resource. + * @return the next definition stage. + */ + WithCreate withIdentity(Identity identity); + } + + /** + * The stage of the StorageAccount definition allowing to specify allowedCopyScope. + */ + interface WithAllowedCopyScope { + /** + * Specifies the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant + * or with Private Links to the same VNet.. + * + * @param allowedCopyScope Restrict copy to and from Storage Accounts within an AAD tenant or with Private + * Links to the same VNet. + * @return the next definition stage. + */ + WithCreate withAllowedCopyScope(AllowedCopyScope allowedCopyScope); + } + + /** + * The stage of the StorageAccount definition allowing to specify publicNetworkAccess. + */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Allow, disallow, or let Network Security Perimeter + * configuration to evaluate public network access to Storage Account. Value is optional but if passed in, + * must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'.. + * + * @param publicNetworkAccess Allow, disallow, or let Network Security Perimeter configuration to evaluate + * public network access to Storage Account. Value is optional but if passed in, must be 'Enabled', + * 'Disabled' or 'SecuredByPerimeter'. + * @return the next definition stage. + */ + WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + + /** + * The stage of the StorageAccount definition allowing to specify sasPolicy. + */ + interface WithSasPolicy { + /** + * Specifies the sasPolicy property: SasPolicy assigned to the storage account.. + * + * @param sasPolicy SasPolicy assigned to the storage account. + * @return the next definition stage. + */ + WithCreate withSasPolicy(SasPolicy sasPolicy); + } + + /** + * The stage of the StorageAccount definition allowing to specify keyPolicy. + */ + interface WithKeyPolicy { + /** + * Specifies the keyPolicy property: KeyPolicy assigned to the storage account.. + * + * @param keyPolicy KeyPolicy assigned to the storage account. + * @return the next definition stage. + */ + WithCreate withKeyPolicy(KeyPolicy keyPolicy); + } + + /** + * The stage of the StorageAccount definition allowing to specify customDomain. + */ + interface WithCustomDomain { + /** + * Specifies the customDomain property: User domain assigned to the storage account. Name is the CNAME + * source. Only one custom domain is supported per storage account at this time. To clear the existing + * custom domain, use an empty string for the custom domain name property.. + * + * @param customDomain User domain assigned to the storage account. Name is the CNAME source. Only one + * custom domain is supported per storage account at this time. To clear the existing custom domain, use an + * empty string for the custom domain name property. + * @return the next definition stage. + */ + WithCreate withCustomDomain(CustomDomain customDomain); + } + + /** + * The stage of the StorageAccount definition allowing to specify encryption. + */ + interface WithEncryption { + /** + * Specifies the encryption property: Encryption settings to be used for server-side encryption for the + * storage account.. + * + * @param encryption Encryption settings to be used for server-side encryption for the storage account. + * @return the next definition stage. + */ + WithCreate withEncryption(Encryption encryption); + } + + /** + * The stage of the StorageAccount definition allowing to specify networkRuleSet. + */ + interface WithNetworkRuleSet { + /** + * Specifies the networkRuleSet property: Network rule set. + * + * @param networkRuleSet Network rule set. + * @return the next definition stage. + */ + WithCreate withNetworkRuleSet(NetworkRuleSet networkRuleSet); + } + + /** + * The stage of the StorageAccount definition allowing to specify accessTier. + */ + interface WithAccessTier { + /** + * Specifies the accessTier property: Required for storage accounts where kind = BlobStorage. The access + * tier is used for billing. The 'Premium' access tier is the default value for premium block blobs storage + * account type and it cannot be changed for the premium block blobs storage account type.. + * + * @param accessTier Required for storage accounts where kind = BlobStorage. The access tier is used for + * billing. The 'Premium' access tier is the default value for premium block blobs storage account type and + * it cannot be changed for the premium block blobs storage account type. + * @return the next definition stage. + */ + WithCreate withAccessTier(AccessTier accessTier); + } + + /** + * The stage of the StorageAccount definition allowing to specify azureFilesIdentityBasedAuthentication. + */ + interface WithAzureFilesIdentityBasedAuthentication { + /** + * Specifies the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication + * settings for Azure Files.. + * + * @param azureFilesIdentityBasedAuthentication Provides the identity based authentication settings for + * Azure Files. + * @return the next definition stage. + */ + WithCreate withAzureFilesIdentityBasedAuthentication( + AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication); + } + + /** + * The stage of the StorageAccount definition allowing to specify enableHttpsTrafficOnly. + */ + interface WithEnableHttpsTrafficOnly { + /** + * Specifies the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to + * true. The default value is true since API version 2019-04-01.. + * + * @param enableHttpsTrafficOnly Allows https traffic only to storage service if sets to true. The default + * value is true since API version 2019-04-01. + * @return the next definition stage. + */ + WithCreate withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly); + } + + /** + * The stage of the StorageAccount definition allowing to specify isSftpEnabled. + */ + interface WithIsSftpEnabled { + /** + * Specifies the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @param isSftpEnabled Enables Secure File Transfer Protocol, if set to true. + * @return the next definition stage. + */ + WithCreate withIsSftpEnabled(Boolean isSftpEnabled); + } + + /** + * The stage of the StorageAccount definition allowing to specify isLocalUserEnabled. + */ + interface WithIsLocalUserEnabled { + /** + * Specifies the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @param isLocalUserEnabled Enables local users feature, if set to true. + * @return the next definition stage. + */ + WithCreate withIsLocalUserEnabled(Boolean isLocalUserEnabled); + } + + /** + * The stage of the StorageAccount definition allowing to specify enableExtendedGroups. + */ + interface WithEnableExtendedGroups { + /** + * Specifies the enableExtendedGroups property: Enables extended group support with local users feature, if + * set to true. + * + * @param enableExtendedGroups Enables extended group support with local users feature, if set to true. + * @return the next definition stage. + */ + WithCreate withEnableExtendedGroups(Boolean enableExtendedGroups); + } + + /** + * The stage of the StorageAccount definition allowing to specify isHnsEnabled. + */ + interface WithIsHnsEnabled { + /** + * Specifies the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true.. + * + * @param isHnsEnabled Account HierarchicalNamespace enabled if sets to true. + * @return the next definition stage. + */ + WithCreate withIsHnsEnabled(Boolean isHnsEnabled); + } + + /** + * The stage of the StorageAccount definition allowing to specify largeFileSharesState. + */ + interface WithLargeFileSharesState { + /** + * Specifies the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be + * disabled once it is enabled.. + * + * @param largeFileSharesState Allow large file shares if sets to Enabled. It cannot be disabled once it is + * enabled. + * @return the next definition stage. + */ + WithCreate withLargeFileSharesState(LargeFileSharesState largeFileSharesState); + } + + /** + * The stage of the StorageAccount definition allowing to specify routingPreference. + */ + interface WithRoutingPreference { + /** + * Specifies the routingPreference property: Maintains information about the network routing choice opted by + * the user for data transfer. + * + * @param routingPreference Maintains information about the network routing choice opted by the user for + * data transfer. + * @return the next definition stage. + */ + WithCreate withRoutingPreference(RoutingPreference routingPreference); + } + + /** + * The stage of the StorageAccount definition allowing to specify allowBlobPublicAccess. + */ + interface WithAllowBlobPublicAccess { + /** + * Specifies the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers + * in the storage account. The default interpretation is false for this property.. + * + * @param allowBlobPublicAccess Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is false for this property. + * @return the next definition stage. + */ + WithCreate withAllowBlobPublicAccess(Boolean allowBlobPublicAccess); + } + + /** + * The stage of the StorageAccount definition allowing to specify minimumTlsVersion. + */ + interface WithMinimumTlsVersion { + /** + * Specifies the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to + * storage. The default interpretation is TLS 1.0 for this property.. + * + * @param minimumTlsVersion Set the minimum TLS version to be permitted on requests to storage. The default + * interpretation is TLS 1.0 for this property. + * @return the next definition stage. + */ + WithCreate withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion); + } + + /** + * The stage of the StorageAccount definition allowing to specify allowSharedKeyAccess. + */ + interface WithAllowSharedKeyAccess { + /** + * Specifies the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be + * authorized with the account access key via Shared Key. If false, then all requests, including shared + * access signatures, must be authorized with Azure Active Directory (Azure AD). The default value is null, + * which is equivalent to true.. + * + * @param allowSharedKeyAccess Indicates whether the storage account permits requests to be authorized with + * the account access key via Shared Key. If false, then all requests, including shared access signatures, + * must be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent + * to true. + * @return the next definition stage. + */ + WithCreate withAllowSharedKeyAccess(Boolean allowSharedKeyAccess); + } + + /** + * The stage of the StorageAccount definition allowing to specify enableNfsV3. + */ + interface WithEnableNfsV3 { + /** + * Specifies the enableNfsV3 property: NFS 3.0 protocol support enabled if set to true.. + * + * @param enableNfsV3 NFS 3.0 protocol support enabled if set to true. + * @return the next definition stage. + */ + WithCreate withEnableNfsV3(Boolean enableNfsV3); + } + + /** + * The stage of the StorageAccount definition allowing to specify allowCrossTenantReplication. + */ + interface WithAllowCrossTenantReplication { + /** + * Specifies the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object + * replication. Set this property to true for new or existing accounts only if object replication policies + * will involve storage accounts in different AAD tenants. The default interpretation is false for new + * accounts to follow best security practices by default.. + * + * @param allowCrossTenantReplication Allow or disallow cross AAD tenant object replication. Set this + * property to true for new or existing accounts only if object replication policies will involve storage + * accounts in different AAD tenants. The default interpretation is false for new accounts to follow best + * security practices by default. + * @return the next definition stage. + */ + WithCreate withAllowCrossTenantReplication(Boolean allowCrossTenantReplication); + } + + /** + * The stage of the StorageAccount definition allowing to specify defaultToOAuthAuthentication. + */ + interface WithDefaultToOAuthAuthentication { + /** + * Specifies the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default + * authentication is OAuth or not. The default interpretation is false for this property.. + * + * @param defaultToOAuthAuthentication A boolean flag which indicates whether the default authentication is + * OAuth or not. The default interpretation is false for this property. + * @return the next definition stage. + */ + WithCreate withDefaultToOAuthAuthentication(Boolean defaultToOAuthAuthentication); + } + + /** + * The stage of the StorageAccount definition allowing to specify immutableStorageWithVersioning. + */ + interface WithImmutableStorageWithVersioning { + /** + * Specifies the immutableStorageWithVersioning property: The property is immutable and can only be set to + * true at the account creation time. When set to true, it enables object level immutability for all the new + * containers in the account by default.. + * + * @param immutableStorageWithVersioning The property is immutable and can only be set to true at the + * account creation time. When set to true, it enables object level immutability for all the new containers + * in the account by default. + * @return the next definition stage. + */ + WithCreate withImmutableStorageWithVersioning(ImmutableStorageAccount immutableStorageWithVersioning); + } + + /** + * The stage of the StorageAccount definition allowing to specify dnsEndpointType. + */ + interface WithDnsEndpointType { + /** + * Specifies the dnsEndpointType property: Allows you to specify the type of endpoint. Set this to + * AzureDNSZone to create a large number of accounts in a single subscription, which creates accounts in an + * Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier.. + * + * @param dnsEndpointType Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a + * large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the + * endpoint URL will have an alphanumeric DNS Zone identifier. + * @return the next definition stage. + */ + WithCreate withDnsEndpointType(DnsEndpointType dnsEndpointType); + } + } + + /** + * Begins update for the StorageAccount resource. + * + * @return the stage of resource update. + */ + StorageAccount.Update update(); + + /** + * The template for StorageAccount update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithSku, UpdateStages.WithIdentity, + UpdateStages.WithKind, UpdateStages.WithCustomDomain, UpdateStages.WithEncryption, UpdateStages.WithSasPolicy, + UpdateStages.WithKeyPolicy, UpdateStages.WithAccessTier, UpdateStages.WithAzureFilesIdentityBasedAuthentication, + UpdateStages.WithEnableHttpsTrafficOnly, UpdateStages.WithIsSftpEnabled, UpdateStages.WithIsLocalUserEnabled, + UpdateStages.WithEnableExtendedGroups, UpdateStages.WithNetworkRuleSet, UpdateStages.WithLargeFileSharesState, + UpdateStages.WithRoutingPreference, UpdateStages.WithAllowBlobPublicAccess, UpdateStages.WithMinimumTlsVersion, + UpdateStages.WithAllowSharedKeyAccess, UpdateStages.WithAllowCrossTenantReplication, + UpdateStages.WithDefaultToOAuthAuthentication, UpdateStages.WithPublicNetworkAccess, + UpdateStages.WithImmutableStorageWithVersioning, UpdateStages.WithAllowedCopyScope, + UpdateStages.WithDnsEndpointType { + /** + * Executes the update request. + * + * @return the updated resource. + */ + StorageAccount apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + StorageAccount apply(Context context); + } + + /** + * The StorageAccount update stages. + */ + interface UpdateStages { + /** + * The stage of the StorageAccount update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Gets or sets a list of key value pairs that describe the resource. These + * tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + * be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value + * no greater in length than 256 characters.. + * + * @param tags Gets or sets a list of key value pairs that describe the resource. These tags can be used in + * viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a + * resource. Each tag must have a key no greater in length than 128 characters and a value no greater in + * length than 256 characters. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the StorageAccount update allowing to specify sku. + */ + interface WithSku { + /** + * Specifies the sku property: Gets or sets the SKU name. Note that the SKU name cannot be updated to + * Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of those SKU names be updated to any other + * value.. + * + * @param sku Gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, + * Premium_LRS or Premium_ZRS, nor can accounts of those SKU names be updated to any other value. + * @return the next definition stage. + */ + Update withSku(Sku sku); + } + + /** + * The stage of the StorageAccount update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the resource.. + * + * @param identity The identity of the resource. + * @return the next definition stage. + */ + Update withIdentity(Identity identity); + } + + /** + * The stage of the StorageAccount update allowing to specify kind. + */ + interface WithKind { + /** + * Specifies the kind property: Optional. Indicates the type of storage account. Currently only StorageV2 + * value supported by server.. + * + * @param kind Optional. Indicates the type of storage account. Currently only StorageV2 value supported by + * server. + * @return the next definition stage. + */ + Update withKind(Kind kind); + } + + /** + * The stage of the StorageAccount update allowing to specify customDomain. + */ + interface WithCustomDomain { + /** + * Specifies the customDomain property: Custom domain assigned to the storage account by the user. Name is + * the CNAME source. Only one custom domain is supported per storage account at this time. To clear the + * existing custom domain, use an empty string for the custom domain name property.. + * + * @param customDomain Custom domain assigned to the storage account by the user. Name is the CNAME source. + * Only one custom domain is supported per storage account at this time. To clear the existing custom + * domain, use an empty string for the custom domain name property. + * @return the next definition stage. + */ + Update withCustomDomain(CustomDomain customDomain); + } + + /** + * The stage of the StorageAccount update allowing to specify encryption. + */ + interface WithEncryption { + /** + * Specifies the encryption property: Not applicable. Azure Storage encryption at rest is enabled by default + * for all storage accounts and cannot be disabled.. + * + * @param encryption Not applicable. Azure Storage encryption at rest is enabled by default for all storage + * accounts and cannot be disabled. + * @return the next definition stage. + */ + Update withEncryption(Encryption encryption); + } + + /** + * The stage of the StorageAccount update allowing to specify sasPolicy. + */ + interface WithSasPolicy { + /** + * Specifies the sasPolicy property: SasPolicy assigned to the storage account.. + * + * @param sasPolicy SasPolicy assigned to the storage account. + * @return the next definition stage. + */ + Update withSasPolicy(SasPolicy sasPolicy); + } + + /** + * The stage of the StorageAccount update allowing to specify keyPolicy. + */ + interface WithKeyPolicy { + /** + * Specifies the keyPolicy property: KeyPolicy assigned to the storage account.. + * + * @param keyPolicy KeyPolicy assigned to the storage account. + * @return the next definition stage. + */ + Update withKeyPolicy(KeyPolicy keyPolicy); + } + + /** + * The stage of the StorageAccount update allowing to specify accessTier. + */ + interface WithAccessTier { + /** + * Specifies the accessTier property: Required for storage accounts where kind = BlobStorage. The access + * tier is used for billing. The 'Premium' access tier is the default value for premium block blobs storage + * account type and it cannot be changed for the premium block blobs storage account type.. + * + * @param accessTier Required for storage accounts where kind = BlobStorage. The access tier is used for + * billing. The 'Premium' access tier is the default value for premium block blobs storage account type and + * it cannot be changed for the premium block blobs storage account type. + * @return the next definition stage. + */ + Update withAccessTier(AccessTier accessTier); + } + + /** + * The stage of the StorageAccount update allowing to specify azureFilesIdentityBasedAuthentication. + */ + interface WithAzureFilesIdentityBasedAuthentication { + /** + * Specifies the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication + * settings for Azure Files.. + * + * @param azureFilesIdentityBasedAuthentication Provides the identity based authentication settings for + * Azure Files. + * @return the next definition stage. + */ + Update withAzureFilesIdentityBasedAuthentication( + AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication); + } + + /** + * The stage of the StorageAccount update allowing to specify enableHttpsTrafficOnly. + */ + interface WithEnableHttpsTrafficOnly { + /** + * Specifies the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to + * true.. + * + * @param enableHttpsTrafficOnly Allows https traffic only to storage service if sets to true. + * @return the next definition stage. + */ + Update withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly); + } + + /** + * The stage of the StorageAccount update allowing to specify isSftpEnabled. + */ + interface WithIsSftpEnabled { + /** + * Specifies the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @param isSftpEnabled Enables Secure File Transfer Protocol, if set to true. + * @return the next definition stage. + */ + Update withIsSftpEnabled(Boolean isSftpEnabled); + } + + /** + * The stage of the StorageAccount update allowing to specify isLocalUserEnabled. + */ + interface WithIsLocalUserEnabled { + /** + * Specifies the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @param isLocalUserEnabled Enables local users feature, if set to true. + * @return the next definition stage. + */ + Update withIsLocalUserEnabled(Boolean isLocalUserEnabled); + } + + /** + * The stage of the StorageAccount update allowing to specify enableExtendedGroups. + */ + interface WithEnableExtendedGroups { + /** + * Specifies the enableExtendedGroups property: Enables extended group support with local users feature, if + * set to true. + * + * @param enableExtendedGroups Enables extended group support with local users feature, if set to true. + * @return the next definition stage. + */ + Update withEnableExtendedGroups(Boolean enableExtendedGroups); + } + + /** + * The stage of the StorageAccount update allowing to specify networkRuleSet. + */ + interface WithNetworkRuleSet { + /** + * Specifies the networkRuleSet property: Network rule set. + * + * @param networkRuleSet Network rule set. + * @return the next definition stage. + */ + Update withNetworkRuleSet(NetworkRuleSet networkRuleSet); + } + + /** + * The stage of the StorageAccount update allowing to specify largeFileSharesState. + */ + interface WithLargeFileSharesState { + /** + * Specifies the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be + * disabled once it is enabled.. + * + * @param largeFileSharesState Allow large file shares if sets to Enabled. It cannot be disabled once it is + * enabled. + * @return the next definition stage. + */ + Update withLargeFileSharesState(LargeFileSharesState largeFileSharesState); + } + + /** + * The stage of the StorageAccount update allowing to specify routingPreference. + */ + interface WithRoutingPreference { + /** + * Specifies the routingPreference property: Maintains information about the network routing choice opted by + * the user for data transfer. + * + * @param routingPreference Maintains information about the network routing choice opted by the user for + * data transfer. + * @return the next definition stage. + */ + Update withRoutingPreference(RoutingPreference routingPreference); + } + + /** + * The stage of the StorageAccount update allowing to specify allowBlobPublicAccess. + */ + interface WithAllowBlobPublicAccess { + /** + * Specifies the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers + * in the storage account. The default interpretation is false for this property.. + * + * @param allowBlobPublicAccess Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is false for this property. + * @return the next definition stage. + */ + Update withAllowBlobPublicAccess(Boolean allowBlobPublicAccess); + } + + /** + * The stage of the StorageAccount update allowing to specify minimumTlsVersion. + */ + interface WithMinimumTlsVersion { + /** + * Specifies the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to + * storage. The default interpretation is TLS 1.0 for this property.. + * + * @param minimumTlsVersion Set the minimum TLS version to be permitted on requests to storage. The default + * interpretation is TLS 1.0 for this property. + * @return the next definition stage. + */ + Update withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion); + } + + /** + * The stage of the StorageAccount update allowing to specify allowSharedKeyAccess. + */ + interface WithAllowSharedKeyAccess { + /** + * Specifies the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be + * authorized with the account access key via Shared Key. If false, then all requests, including shared + * access signatures, must be authorized with Azure Active Directory (Azure AD). The default value is null, + * which is equivalent to true.. + * + * @param allowSharedKeyAccess Indicates whether the storage account permits requests to be authorized with + * the account access key via Shared Key. If false, then all requests, including shared access signatures, + * must be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent + * to true. + * @return the next definition stage. + */ + Update withAllowSharedKeyAccess(Boolean allowSharedKeyAccess); + } + + /** + * The stage of the StorageAccount update allowing to specify allowCrossTenantReplication. + */ + interface WithAllowCrossTenantReplication { + /** + * Specifies the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object + * replication. Set this property to true for new or existing accounts only if object replication policies + * will involve storage accounts in different AAD tenants. The default interpretation is false for new + * accounts to follow best security practices by default.. + * + * @param allowCrossTenantReplication Allow or disallow cross AAD tenant object replication. Set this + * property to true for new or existing accounts only if object replication policies will involve storage + * accounts in different AAD tenants. The default interpretation is false for new accounts to follow best + * security practices by default. + * @return the next definition stage. + */ + Update withAllowCrossTenantReplication(Boolean allowCrossTenantReplication); + } + + /** + * The stage of the StorageAccount update allowing to specify defaultToOAuthAuthentication. + */ + interface WithDefaultToOAuthAuthentication { + /** + * Specifies the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default + * authentication is OAuth or not. The default interpretation is false for this property.. + * + * @param defaultToOAuthAuthentication A boolean flag which indicates whether the default authentication is + * OAuth or not. The default interpretation is false for this property. + * @return the next definition stage. + */ + Update withDefaultToOAuthAuthentication(Boolean defaultToOAuthAuthentication); + } + + /** + * The stage of the StorageAccount update allowing to specify publicNetworkAccess. + */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Allow, disallow, or let Network Security Perimeter + * configuration to evaluate public network access to Storage Account. Value is optional but if passed in, + * must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'.. + * + * @param publicNetworkAccess Allow, disallow, or let Network Security Perimeter configuration to evaluate + * public network access to Storage Account. Value is optional but if passed in, must be 'Enabled', + * 'Disabled' or 'SecuredByPerimeter'. + * @return the next definition stage. + */ + Update withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + + /** + * The stage of the StorageAccount update allowing to specify immutableStorageWithVersioning. + */ + interface WithImmutableStorageWithVersioning { + /** + * Specifies the immutableStorageWithVersioning property: The property is immutable and can only be set to + * true at the account creation time. When set to true, it enables object level immutability for all the + * containers in the account by default.. + * + * @param immutableStorageWithVersioning The property is immutable and can only be set to true at the + * account creation time. When set to true, it enables object level immutability for all the containers in + * the account by default. + * @return the next definition stage. + */ + Update withImmutableStorageWithVersioning(ImmutableStorageAccount immutableStorageWithVersioning); + } + + /** + * The stage of the StorageAccount update allowing to specify allowedCopyScope. + */ + interface WithAllowedCopyScope { + /** + * Specifies the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant + * or with Private Links to the same VNet.. + * + * @param allowedCopyScope Restrict copy to and from Storage Accounts within an AAD tenant or with Private + * Links to the same VNet. + * @return the next definition stage. + */ + Update withAllowedCopyScope(AllowedCopyScope allowedCopyScope); + } + + /** + * The stage of the StorageAccount update allowing to specify dnsEndpointType. + */ + interface WithDnsEndpointType { + /** + * Specifies the dnsEndpointType property: Allows you to specify the type of endpoint. Set this to + * AzureDNSZone to create a large number of accounts in a single subscription, which creates accounts in an + * Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier.. + * + * @param dnsEndpointType Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a + * large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the + * endpoint URL will have an alphanumeric DNS Zone identifier. + * @return the next definition stage. + */ + Update withDnsEndpointType(DnsEndpointType dnsEndpointType); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + StorageAccount refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + StorageAccount refresh(Context context); + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param expand Specifies type of the key to be listed. Possible value is kerb. + * @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 from the ListKeys operation along with {@link Response}. + */ + Response listKeysWithResponse(ListKeyExpand expand, Context context); + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @throws com.azure.core.management.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 from the ListKeys operation. + */ + StorageAccountListKeysResult listKeys(); + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. + * @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 from the ListKeys operation along with {@link Response}. + */ + Response + regenerateKeyWithResponse(StorageAccountRegenerateKeyParameters regenerateKey, Context context); + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 from the ListKeys operation. + */ + StorageAccountListKeysResult regenerateKey(StorageAccountRegenerateKeyParameters regenerateKey); + + /** + * List SAS credentials of a storage account. + * + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List SAS credentials operation response along with {@link Response}. + */ + Response listAccountSasWithResponse(AccountSasParameters parameters, Context context); + + /** + * List SAS credentials of a storage account. + * + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List SAS credentials operation response. + */ + ListAccountSasResponse listAccountSas(AccountSasParameters parameters); + + /** + * List service SAS credentials of a specific resource. + * + * @param parameters The parameters to provide to list service SAS credentials. + * @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 List service SAS credentials operation response along with {@link Response}. + */ + Response listServiceSasWithResponse(ServiceSasParameters parameters, Context context); + + /** + * List service SAS credentials of a specific resource. + * + * @param parameters The parameters to provide to list service SAS credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List service SAS credentials operation response. + */ + ListServiceSasResponse listServiceSas(ServiceSasParameters parameters); + + /** + * A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable for + * any reason. The failover occurs from the storage account's primary cluster to the secondary cluster for RA-GRS + * accounts. The secondary cluster will become primary after failover and the account is converted to LRS. In the + * case of a Planned Failover, the primary and secondary clusters are swapped after failover and the account remains + * geo-replicated. Failover should continue to be used in the event of availability issues as Planned failover is + * only available while the primary and secondary endpoints are available. The primary use case of a Planned + * Failover is disaster recovery testing drills. This type of failover is invoked by setting FailoverType parameter + * to 'Planned'. Learn more about the failover options here- + * https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance. + * + * @throws com.azure.core.management.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 failover(); + + /** + * A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable for + * any reason. The failover occurs from the storage account's primary cluster to the secondary cluster for RA-GRS + * accounts. The secondary cluster will become primary after failover and the account is converted to LRS. In the + * case of a Planned Failover, the primary and secondary clusters are swapped after failover and the account remains + * geo-replicated. Failover should continue to be used in the event of availability issues as Planned failover is + * only available while the primary and secondary endpoints are available. The primary use case of a Planned + * Failover is disaster recovery testing drills. This type of failover is invoked by setting FailoverType parameter + * to 'Planned'. Learn more about the failover options here- + * https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance. + * + * @param failoverType The parameter is set to 'Planned' to indicate whether a Planned failover is requested. + * @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 failover(FailoverType failoverType, Context context); + + /** + * Account Migration request can be triggered for a storage account to change its redundancy level. The migration + * updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have + * better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously + * across three Azure availability zones in the primary region. + * + * @param parameters The request parameters required to perform storage account migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 customerInitiatedMigration(StorageAccountMigrationInner parameters); + + /** + * Account Migration request can be triggered for a storage account to change its redundancy level. The migration + * updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have + * better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously + * across three Azure availability zones in the primary region. + * + * @param parameters The request parameters required to perform storage account migration. + * @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 customerInitiatedMigration(StorageAccountMigrationInner parameters, Context context); + + /** + * Restore blobs in the specified blob ranges. + * + * @param parameters The parameters to provide for restore blob ranges. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 blob restore status. + */ + BlobRestoreStatus restoreBlobRanges(BlobRestoreParameters parameters); + + /** + * Restore blobs in the specified blob ranges. + * + * @param parameters The parameters to provide for restore blob ranges. + * @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 blob restore status. + */ + BlobRestoreStatus restoreBlobRanges(BlobRestoreParameters parameters, Context context); + + /** + * Revoke user delegation keys. + * + * @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 Response}. + */ + Response revokeUserDelegationKeysWithResponse(Context context); + + /** + * Revoke user delegation keys. + * + * @throws com.azure.core.management.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 revokeUserDelegationKeys(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountCheckNameAvailabilityParameters.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountCheckNameAvailabilityParameters.java new file mode 100644 index 0000000000000..58bbe67bdc655 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountCheckNameAvailabilityParameters.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * The parameters used to check the availability of the storage account name. + */ +@Fluent +public final class StorageAccountCheckNameAvailabilityParameters + implements JsonSerializable { + /* + * The storage account name. + */ + private String name; + + /* + * The type of resource, Microsoft.Storage/storageAccounts + */ + private final String type = "Microsoft.Storage/storageAccounts"; + + /** + * Creates an instance of StorageAccountCheckNameAvailabilityParameters class. + */ + public StorageAccountCheckNameAvailabilityParameters() { + } + + /** + * Get the name property: The storage account name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The storage account name. + * + * @param name the name value to set. + * @return the StorageAccountCheckNameAvailabilityParameters object itself. + */ + public StorageAccountCheckNameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of resource, Microsoft.Storage/storageAccounts. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property name in model StorageAccountCheckNameAvailabilityParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageAccountCheckNameAvailabilityParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountCheckNameAvailabilityParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountCheckNameAvailabilityParameters 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 StorageAccountCheckNameAvailabilityParameters. + */ + public static StorageAccountCheckNameAvailabilityParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountCheckNameAvailabilityParameters deserializedStorageAccountCheckNameAvailabilityParameters + = new StorageAccountCheckNameAvailabilityParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedStorageAccountCheckNameAvailabilityParameters.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountCheckNameAvailabilityParameters; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountCreateParameters.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountCreateParameters.java new file mode 100644 index 0000000000000..70aa5fee7a614 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountCreateParameters.java @@ -0,0 +1,905 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountPropertiesCreateParameters; +import java.io.IOException; +import java.util.Map; + +/** + * The parameters used when creating a storage account. + */ +@Fluent +public final class StorageAccountCreateParameters implements JsonSerializable { + /* + * Required. Gets or sets the SKU name. + */ + private Sku sku; + + /* + * Required. Indicates the type of storage account. + */ + private Kind kind; + + /* + * Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo + * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is + * created, but if an identical geo region is specified on update, the request will succeed. + */ + private String location; + + /* + * Optional. Set the extended location of the resource. If not set, the storage account will be created in Azure + * main region. Otherwise it will be created in the specified extended location + */ + private ExtendedLocation extendedLocation; + + /* + * Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and + * grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag + * must have a key with a length no greater than 128 characters and a value with a length no greater than 256 + * characters. + */ + private Map tags; + + /* + * The identity of the resource. + */ + private Identity identity; + + /* + * The parameters used to create the storage account. + */ + private StorageAccountPropertiesCreateParameters innerProperties; + + /** + * Creates an instance of StorageAccountCreateParameters class. + */ + public StorageAccountCreateParameters() { + } + + /** + * Get the sku property: Required. Gets or sets the SKU name. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Required. Gets or sets the SKU name. + * + * @param sku the sku value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the kind property: Required. Indicates the type of storage account. + * + * @return the kind value. + */ + public Kind kind() { + return this.kind; + } + + /** + * Set the kind property: Required. Indicates the type of storage account. + * + * @param kind the kind value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withKind(Kind kind) { + this.kind = kind; + return this; + } + + /** + * Get the location property: Required. Gets or sets the location of the resource. This will be one of the supported + * and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource + * cannot be changed once it is created, but if an identical geo region is specified on update, the request will + * succeed. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Required. Gets or sets the location of the resource. This will be one of the supported + * and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource + * cannot be changed once it is created, but if an identical geo region is specified on update, the request will + * succeed. + * + * @param location the location value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the extendedLocation property: Optional. Set the extended location of the resource. If not set, the storage + * account will be created in Azure main region. Otherwise it will be created in the specified extended location. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: Optional. Set the extended location of the resource. If not set, the storage + * account will be created in Azure main region. Otherwise it will be created in the specified extended location. + * + * @param extendedLocation the extendedLocation value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the tags property: Gets or sets a list of key value pairs that describe the resource. These tags can be used + * for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a + * resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no + * greater than 256 characters. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Gets or sets a list of key value pairs that describe the resource. These tags can be used + * for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a + * resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no + * greater than 256 characters. + * + * @param tags the tags value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity property: The identity of the resource. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the resource. + * + * @param identity the identity value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: The parameters used to create the storage account. + * + * @return the innerProperties value. + */ + private StorageAccountPropertiesCreateParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @return the allowedCopyScope value. + */ + public AllowedCopyScope allowedCopyScope() { + return this.innerProperties() == null ? null : this.innerProperties().allowedCopyScope(); + } + + /** + * Set the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @param allowedCopyScope the allowedCopyScope value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withAllowedCopyScope(AllowedCopyScope allowedCopyScope) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withAllowedCopyScope(allowedCopyScope); + return this; + } + + /** + * Get the publicNetworkAccess property: Allow, disallow, or let Network Security Perimeter configuration to + * evaluate public network access to Storage Account. Value is optional but if passed in, must be 'Enabled', + * 'Disabled' or 'SecuredByPerimeter'. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: Allow, disallow, or let Network Security Perimeter configuration to + * evaluate public network access to Storage Account. Value is optional but if passed in, must be 'Enabled', + * 'Disabled' or 'SecuredByPerimeter'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Get the sasPolicy property: SasPolicy assigned to the storage account. + * + * @return the sasPolicy value. + */ + public SasPolicy sasPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().sasPolicy(); + } + + /** + * Set the sasPolicy property: SasPolicy assigned to the storage account. + * + * @param sasPolicy the sasPolicy value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withSasPolicy(SasPolicy sasPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withSasPolicy(sasPolicy); + return this; + } + + /** + * Get the keyPolicy property: KeyPolicy assigned to the storage account. + * + * @return the keyPolicy value. + */ + public KeyPolicy keyPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().keyPolicy(); + } + + /** + * Set the keyPolicy property: KeyPolicy assigned to the storage account. + * + * @param keyPolicy the keyPolicy value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withKeyPolicy(KeyPolicy keyPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withKeyPolicy(keyPolicy); + return this; + } + + /** + * Get the customDomain property: User domain assigned to the storage account. Name is the CNAME source. Only one + * custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty + * string for the custom domain name property. + * + * @return the customDomain value. + */ + public CustomDomain customDomain() { + return this.innerProperties() == null ? null : this.innerProperties().customDomain(); + } + + /** + * Set the customDomain property: User domain assigned to the storage account. Name is the CNAME source. Only one + * custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty + * string for the custom domain name property. + * + * @param customDomain the customDomain value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withCustomDomain(CustomDomain customDomain) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withCustomDomain(customDomain); + return this; + } + + /** + * Get the encryption property: Encryption settings to be used for server-side encryption for the storage account. + * + * @return the encryption value. + */ + public Encryption encryption() { + return this.innerProperties() == null ? null : this.innerProperties().encryption(); + } + + /** + * Set the encryption property: Encryption settings to be used for server-side encryption for the storage account. + * + * @param encryption the encryption value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withEncryption(Encryption encryption) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withEncryption(encryption); + return this; + } + + /** + * Get the networkRuleSet property: Network rule set. + * + * @return the networkRuleSet value. + */ + public NetworkRuleSet networkRuleSet() { + return this.innerProperties() == null ? null : this.innerProperties().networkRuleSet(); + } + + /** + * Set the networkRuleSet property: Network rule set. + * + * @param networkRuleSet the networkRuleSet value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withNetworkRuleSet(networkRuleSet); + return this; + } + + /** + * Get the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier is used for + * billing. The 'Premium' access tier is the default value for premium block blobs storage account type and it + * cannot be changed for the premium block blobs storage account type. + * + * @return the accessTier value. + */ + public AccessTier accessTier() { + return this.innerProperties() == null ? null : this.innerProperties().accessTier(); + } + + /** + * Set the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier is used for + * billing. The 'Premium' access tier is the default value for premium block blobs storage account type and it + * cannot be changed for the premium block blobs storage account type. + * + * @param accessTier the accessTier value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withAccessTier(AccessTier accessTier) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withAccessTier(accessTier); + return this; + } + + /** + * Get the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @return the azureFilesIdentityBasedAuthentication value. + */ + public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { + return this.innerProperties() == null ? null : this.innerProperties().azureFilesIdentityBasedAuthentication(); + } + + /** + * Set the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @param azureFilesIdentityBasedAuthentication the azureFilesIdentityBasedAuthentication value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withAzureFilesIdentityBasedAuthentication( + AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withAzureFilesIdentityBasedAuthentication(azureFilesIdentityBasedAuthentication); + return this; + } + + /** + * Get the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. The + * default value is true since API version 2019-04-01. + * + * @return the enableHttpsTrafficOnly value. + */ + public Boolean enableHttpsTrafficOnly() { + return this.innerProperties() == null ? null : this.innerProperties().enableHttpsTrafficOnly(); + } + + /** + * Set the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. The + * default value is true since API version 2019-04-01. + * + * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withEnableHttpsTrafficOnly(enableHttpsTrafficOnly); + return this; + } + + /** + * Get the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @return the isSftpEnabled value. + */ + public Boolean isSftpEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isSftpEnabled(); + } + + /** + * Set the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @param isSftpEnabled the isSftpEnabled value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withIsSftpEnabled(Boolean isSftpEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withIsSftpEnabled(isSftpEnabled); + return this; + } + + /** + * Get the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @return the isLocalUserEnabled value. + */ + public Boolean isLocalUserEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isLocalUserEnabled(); + } + + /** + * Set the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @param isLocalUserEnabled the isLocalUserEnabled value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withIsLocalUserEnabled(Boolean isLocalUserEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withIsLocalUserEnabled(isLocalUserEnabled); + return this; + } + + /** + * Get the enableExtendedGroups property: Enables extended group support with local users feature, if set to true. + * + * @return the enableExtendedGroups value. + */ + public Boolean enableExtendedGroups() { + return this.innerProperties() == null ? null : this.innerProperties().enableExtendedGroups(); + } + + /** + * Set the enableExtendedGroups property: Enables extended group support with local users feature, if set to true. + * + * @param enableExtendedGroups the enableExtendedGroups value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withEnableExtendedGroups(Boolean enableExtendedGroups) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withEnableExtendedGroups(enableExtendedGroups); + return this; + } + + /** + * Get the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. + * + * @return the isHnsEnabled value. + */ + public Boolean isHnsEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isHnsEnabled(); + } + + /** + * Set the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. + * + * @param isHnsEnabled the isHnsEnabled value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withIsHnsEnabled(Boolean isHnsEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withIsHnsEnabled(isHnsEnabled); + return this; + } + + /** + * Get the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @return the largeFileSharesState value. + */ + public LargeFileSharesState largeFileSharesState() { + return this.innerProperties() == null ? null : this.innerProperties().largeFileSharesState(); + } + + /** + * Set the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @param largeFileSharesState the largeFileSharesState value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withLargeFileSharesState(LargeFileSharesState largeFileSharesState) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withLargeFileSharesState(largeFileSharesState); + return this; + } + + /** + * Get the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @return the routingPreference value. + */ + public RoutingPreference routingPreference() { + return this.innerProperties() == null ? null : this.innerProperties().routingPreference(); + } + + /** + * Set the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @param routingPreference the routingPreference value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withRoutingPreference(RoutingPreference routingPreference) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withRoutingPreference(routingPreference); + return this; + } + + /** + * Get the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is false for this property. + * + * @return the allowBlobPublicAccess value. + */ + public Boolean allowBlobPublicAccess() { + return this.innerProperties() == null ? null : this.innerProperties().allowBlobPublicAccess(); + } + + /** + * Set the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is false for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withAllowBlobPublicAccess(allowBlobPublicAccess); + return this; + } + + /** + * Get the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @return the minimumTlsVersion value. + */ + public MinimumTlsVersion minimumTlsVersion() { + return this.innerProperties() == null ? null : this.innerProperties().minimumTlsVersion(); + } + + /** + * Set the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withMinimumTlsVersion(minimumTlsVersion); + return this; + } + + /** + * Get the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be authorized + * with the account access key via Shared Key. If false, then all requests, including shared access signatures, must + * be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. + * + * @return the allowSharedKeyAccess value. + */ + public Boolean allowSharedKeyAccess() { + return this.innerProperties() == null ? null : this.innerProperties().allowSharedKeyAccess(); + } + + /** + * Set the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be authorized + * with the account access key via Shared Key. If false, then all requests, including shared access signatures, must + * be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. + * + * @param allowSharedKeyAccess the allowSharedKeyAccess value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withAllowSharedKeyAccess(Boolean allowSharedKeyAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withAllowSharedKeyAccess(allowSharedKeyAccess); + return this; + } + + /** + * Get the enableNfsV3 property: NFS 3.0 protocol support enabled if set to true. + * + * @return the enableNfsV3 value. + */ + public Boolean enableNfsV3() { + return this.innerProperties() == null ? null : this.innerProperties().enableNfsV3(); + } + + /** + * Set the enableNfsV3 property: NFS 3.0 protocol support enabled if set to true. + * + * @param enableNfsV3 the enableNfsV3 value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withEnableNfsV3(Boolean enableNfsV3) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withEnableNfsV3(enableNfsV3); + return this; + } + + /** + * Get the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. Set this + * property to true for new or existing accounts only if object replication policies will involve storage accounts + * in different AAD tenants. The default interpretation is false for new accounts to follow best security practices + * by default. + * + * @return the allowCrossTenantReplication value. + */ + public Boolean allowCrossTenantReplication() { + return this.innerProperties() == null ? null : this.innerProperties().allowCrossTenantReplication(); + } + + /** + * Set the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. Set this + * property to true for new or existing accounts only if object replication policies will involve storage accounts + * in different AAD tenants. The default interpretation is false for new accounts to follow best security practices + * by default. + * + * @param allowCrossTenantReplication the allowCrossTenantReplication value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withAllowCrossTenantReplication(Boolean allowCrossTenantReplication) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withAllowCrossTenantReplication(allowCrossTenantReplication); + return this; + } + + /** + * Get the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @return the defaultToOAuthAuthentication value. + */ + public Boolean defaultToOAuthAuthentication() { + return this.innerProperties() == null ? null : this.innerProperties().defaultToOAuthAuthentication(); + } + + /** + * Set the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @param defaultToOAuthAuthentication the defaultToOAuthAuthentication value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withDefaultToOAuthAuthentication(Boolean defaultToOAuthAuthentication) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withDefaultToOAuthAuthentication(defaultToOAuthAuthentication); + return this; + } + + /** + * Get the immutableStorageWithVersioning property: The property is immutable and can only be set to true at the + * account creation time. When set to true, it enables object level immutability for all the new containers in the + * account by default. + * + * @return the immutableStorageWithVersioning value. + */ + public ImmutableStorageAccount immutableStorageWithVersioning() { + return this.innerProperties() == null ? null : this.innerProperties().immutableStorageWithVersioning(); + } + + /** + * Set the immutableStorageWithVersioning property: The property is immutable and can only be set to true at the + * account creation time. When set to true, it enables object level immutability for all the new containers in the + * account by default. + * + * @param immutableStorageWithVersioning the immutableStorageWithVersioning value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters + withImmutableStorageWithVersioning(ImmutableStorageAccount immutableStorageWithVersioning) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withImmutableStorageWithVersioning(immutableStorageWithVersioning); + return this; + } + + /** + * Get the dnsEndpointType property: Allows you to specify the type of endpoint. Set this to AzureDNSZone to create + * a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint + * URL will have an alphanumeric DNS Zone identifier. + * + * @return the dnsEndpointType value. + */ + public DnsEndpointType dnsEndpointType() { + return this.innerProperties() == null ? null : this.innerProperties().dnsEndpointType(); + } + + /** + * Set the dnsEndpointType property: Allows you to specify the type of endpoint. Set this to AzureDNSZone to create + * a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint + * URL will have an alphanumeric DNS Zone identifier. + * + * @param dnsEndpointType the dnsEndpointType value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withDnsEndpointType(DnsEndpointType dnsEndpointType) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesCreateParameters(); + } + this.innerProperties().withDnsEndpointType(dnsEndpointType); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sku in model StorageAccountCreateParameters")); + } else { + sku().validate(); + } + if (kind() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property kind in model StorageAccountCreateParameters")); + } + if (location() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property location in model StorageAccountCreateParameters")); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageAccountCreateParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountCreateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountCreateParameters 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 StorageAccountCreateParameters. + */ + public static StorageAccountCreateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountCreateParameters deserializedStorageAccountCreateParameters + = new StorageAccountCreateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sku".equals(fieldName)) { + deserializedStorageAccountCreateParameters.sku = Sku.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedStorageAccountCreateParameters.kind = Kind.fromString(reader.getString()); + } else if ("location".equals(fieldName)) { + deserializedStorageAccountCreateParameters.location = reader.getString(); + } else if ("extendedLocation".equals(fieldName)) { + deserializedStorageAccountCreateParameters.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedStorageAccountCreateParameters.tags = tags; + } else if ("identity".equals(fieldName)) { + deserializedStorageAccountCreateParameters.identity = Identity.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedStorageAccountCreateParameters.innerProperties + = StorageAccountPropertiesCreateParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountCreateParameters; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountExpand.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountExpand.java new file mode 100644 index 0000000000000..2796c18db706c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountExpand.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +/** + * Defines values for StorageAccountExpand. + */ +public enum StorageAccountExpand { + /** + * Enum value geoReplicationStats. + */ + GEO_REPLICATION_STATS("geoReplicationStats"), + + /** + * Enum value blobRestoreStatus. + */ + BLOB_RESTORE_STATUS("blobRestoreStatus"); + + /** + * The actual serialized value for a StorageAccountExpand instance. + */ + private final String value; + + StorageAccountExpand(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StorageAccountExpand instance. + * + * @param value the serialized value to parse. + * @return the parsed StorageAccountExpand object, or null if unable to parse. + */ + public static StorageAccountExpand fromString(String value) { + if (value == null) { + return null; + } + StorageAccountExpand[] items = StorageAccountExpand.values(); + for (StorageAccountExpand item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountInternetEndpoints.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountInternetEndpoints.java new file mode 100644 index 0000000000000..72994a87ae65d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountInternetEndpoints.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * The URIs that are used to perform a retrieval of a public blob, file, web or dfs object via a internet routing + * endpoint. + */ +@Immutable +public final class StorageAccountInternetEndpoints implements JsonSerializable { + /* + * Gets the blob endpoint. + */ + private String blob; + + /* + * Gets the file endpoint. + */ + private String file; + + /* + * Gets the web endpoint. + */ + private String web; + + /* + * Gets the dfs endpoint. + */ + private String dfs; + + /** + * Creates an instance of StorageAccountInternetEndpoints class. + */ + public StorageAccountInternetEndpoints() { + } + + /** + * Get the blob property: Gets the blob endpoint. + * + * @return the blob value. + */ + public String blob() { + return this.blob; + } + + /** + * Get the file property: Gets the file endpoint. + * + * @return the file value. + */ + public String file() { + return this.file; + } + + /** + * Get the web property: Gets the web endpoint. + * + * @return the web value. + */ + public String web() { + return this.web; + } + + /** + * Get the dfs property: Gets the dfs endpoint. + * + * @return the dfs value. + */ + public String dfs() { + return this.dfs; + } + + /** + * 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 StorageAccountInternetEndpoints from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountInternetEndpoints 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 StorageAccountInternetEndpoints. + */ + public static StorageAccountInternetEndpoints fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountInternetEndpoints deserializedStorageAccountInternetEndpoints + = new StorageAccountInternetEndpoints(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("blob".equals(fieldName)) { + deserializedStorageAccountInternetEndpoints.blob = reader.getString(); + } else if ("file".equals(fieldName)) { + deserializedStorageAccountInternetEndpoints.file = reader.getString(); + } else if ("web".equals(fieldName)) { + deserializedStorageAccountInternetEndpoints.web = reader.getString(); + } else if ("dfs".equals(fieldName)) { + deserializedStorageAccountInternetEndpoints.dfs = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountInternetEndpoints; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountKey.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountKey.java new file mode 100644 index 0000000000000..a0f4ffb26b467 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountKey.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +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.time.OffsetDateTime; + +/** + * An access key for the storage account. + */ +@Immutable +public final class StorageAccountKey implements JsonSerializable { + /* + * Name of the key. + */ + private String keyName; + + /* + * Base 64-encoded value of the key. + */ + private String value; + + /* + * Permissions for the key -- read-only or full permissions. + */ + private KeyPermission permissions; + + /* + * Creation time of the key, in round trip date format. + */ + private OffsetDateTime creationTime; + + /** + * Creates an instance of StorageAccountKey class. + */ + public StorageAccountKey() { + } + + /** + * Get the keyName property: Name of the key. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Get the value property: Base 64-encoded value of the key. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Get the permissions property: Permissions for the key -- read-only or full permissions. + * + * @return the permissions value. + */ + public KeyPermission permissions() { + return this.permissions; + } + + /** + * Get the creationTime property: Creation time of the key, in round trip date format. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * 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 StorageAccountKey from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountKey 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 StorageAccountKey. + */ + public static StorageAccountKey fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountKey deserializedStorageAccountKey = new StorageAccountKey(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyName".equals(fieldName)) { + deserializedStorageAccountKey.keyName = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedStorageAccountKey.value = reader.getString(); + } else if ("permissions".equals(fieldName)) { + deserializedStorageAccountKey.permissions = KeyPermission.fromString(reader.getString()); + } else if ("creationTime".equals(fieldName)) { + deserializedStorageAccountKey.creationTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountKey; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountListKeysResult.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountListKeysResult.java new file mode 100644 index 0000000000000..7d7459b81bfd7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountListKeysResult.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountListKeysResultInner; +import java.util.List; + +/** + * An immutable client-side representation of StorageAccountListKeysResult. + */ +public interface StorageAccountListKeysResult { + /** + * Gets the keys property: Gets the list of storage account keys and their properties for the specified storage + * account. + * + * @return the keys value. + */ + List keys(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountListKeysResultInner + * object. + * + * @return the inner object. + */ + StorageAccountListKeysResultInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountListResult.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountListResult.java new file mode 100644 index 0000000000000..c1221bd8ba0ce --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountListResult.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.models.StorageAccountInner; +import java.io.IOException; +import java.util.List; + +/** + * The response from the List Storage Accounts operation. + */ +@Immutable +public final class StorageAccountListResult implements JsonSerializable { + /* + * Gets the list of storage accounts and their properties. + */ + private List value; + + /* + * Request URL that can be used to query next page of storage accounts. Returned when total number of requested + * storage accounts exceed maximum page size. + */ + private String nextLink; + + /** + * Creates an instance of StorageAccountListResult class. + */ + public StorageAccountListResult() { + } + + /** + * Get the value property: Gets the list of storage accounts and their properties. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Request URL that can be used to query next page of storage accounts. Returned when + * total number of requested storage accounts exceed maximum page size. + * + * @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) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountListResult 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 StorageAccountListResult. + */ + public static StorageAccountListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountListResult deserializedStorageAccountListResult = new StorageAccountListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> StorageAccountInner.fromJson(reader1)); + deserializedStorageAccountListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedStorageAccountListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountListResult; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountMicrosoftEndpoints.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountMicrosoftEndpoints.java new file mode 100644 index 0000000000000..fdbaff7130163 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountMicrosoftEndpoints.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object via a microsoft + * routing endpoint. + */ +@Immutable +public final class StorageAccountMicrosoftEndpoints implements JsonSerializable { + /* + * Gets the blob endpoint. + */ + private String blob; + + /* + * Gets the queue endpoint. + */ + private String queue; + + /* + * Gets the table endpoint. + */ + private String table; + + /* + * Gets the file endpoint. + */ + private String file; + + /* + * Gets the web endpoint. + */ + private String web; + + /* + * Gets the dfs endpoint. + */ + private String dfs; + + /** + * Creates an instance of StorageAccountMicrosoftEndpoints class. + */ + public StorageAccountMicrosoftEndpoints() { + } + + /** + * Get the blob property: Gets the blob endpoint. + * + * @return the blob value. + */ + public String blob() { + return this.blob; + } + + /** + * Get the queue property: Gets the queue endpoint. + * + * @return the queue value. + */ + public String queue() { + return this.queue; + } + + /** + * Get the table property: Gets the table endpoint. + * + * @return the table value. + */ + public String table() { + return this.table; + } + + /** + * Get the file property: Gets the file endpoint. + * + * @return the file value. + */ + public String file() { + return this.file; + } + + /** + * Get the web property: Gets the web endpoint. + * + * @return the web value. + */ + public String web() { + return this.web; + } + + /** + * Get the dfs property: Gets the dfs endpoint. + * + * @return the dfs value. + */ + public String dfs() { + return this.dfs; + } + + /** + * 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 StorageAccountMicrosoftEndpoints from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountMicrosoftEndpoints 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 StorageAccountMicrosoftEndpoints. + */ + public static StorageAccountMicrosoftEndpoints fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountMicrosoftEndpoints deserializedStorageAccountMicrosoftEndpoints + = new StorageAccountMicrosoftEndpoints(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("blob".equals(fieldName)) { + deserializedStorageAccountMicrosoftEndpoints.blob = reader.getString(); + } else if ("queue".equals(fieldName)) { + deserializedStorageAccountMicrosoftEndpoints.queue = reader.getString(); + } else if ("table".equals(fieldName)) { + deserializedStorageAccountMicrosoftEndpoints.table = reader.getString(); + } else if ("file".equals(fieldName)) { + deserializedStorageAccountMicrosoftEndpoints.file = reader.getString(); + } else if ("web".equals(fieldName)) { + deserializedStorageAccountMicrosoftEndpoints.web = reader.getString(); + } else if ("dfs".equals(fieldName)) { + deserializedStorageAccountMicrosoftEndpoints.dfs = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountMicrosoftEndpoints; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountMigration.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountMigration.java new file mode 100644 index 0000000000000..f5b4d18b67407 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountMigration.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountMigrationInner; + +/** + * An immutable client-side representation of StorageAccountMigration. + */ +public interface StorageAccountMigration { + /** + * Gets the id property: Migration Resource Id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: current value is 'default' for customer initiated migration. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: SrpAccountMigrationType in ARM contract which is 'accountMigrations'. + * + * @return the type value. + */ + String type(); + + /** + * Gets the targetSkuName property: Target sku name for the account. + * + * @return the targetSkuName value. + */ + SkuName targetSkuName(); + + /** + * Gets the migrationStatus property: Current status of migration. + * + * @return the migrationStatus value. + */ + MigrationStatus migrationStatus(); + + /** + * Gets the migrationFailedReason property: Error code for migration failure. + * + * @return the migrationFailedReason value. + */ + String migrationFailedReason(); + + /** + * Gets the migrationFailedDetailedReason property: Reason for migration failure. + * + * @return the migrationFailedDetailedReason value. + */ + String migrationFailedDetailedReason(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountMigrationInner object. + * + * @return the inner object. + */ + StorageAccountMigrationInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountProperties.java new file mode 100644 index 0000000000000..e51948d74541a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountProperties.java @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountPropertiesInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * An immutable client-side representation of StorageAccountProperties. + */ +public interface StorageAccountProperties { + /** + * Gets the provisioningState property: Gets the status of the storage account at the time the operation was called. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the primaryEndpoints property: Gets the URLs that are used to perform a retrieval of a public blob, queue, + * or table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob endpoint. + * + * @return the primaryEndpoints value. + */ + Endpoints primaryEndpoints(); + + /** + * Gets the primaryLocation property: Gets the location of the primary data center for the storage account. + * + * @return the primaryLocation value. + */ + String primaryLocation(); + + /** + * Gets the statusOfPrimary property: Gets the status indicating whether the primary location of the storage account + * is available or unavailable. + * + * @return the statusOfPrimary value. + */ + AccountStatus statusOfPrimary(); + + /** + * Gets the lastGeoFailoverTime property: Gets the timestamp of the most recent instance of a failover to the + * secondary location. Only the most recent timestamp is retained. This element is not returned if there has never + * been a failover instance. Only available if the accountType is Standard_GRS or Standard_RAGRS. + * + * @return the lastGeoFailoverTime value. + */ + OffsetDateTime lastGeoFailoverTime(); + + /** + * Gets the secondaryLocation property: Gets the location of the geo-replicated secondary for the storage account. + * Only available if the accountType is Standard_GRS or Standard_RAGRS. + * + * @return the secondaryLocation value. + */ + String secondaryLocation(); + + /** + * Gets the statusOfSecondary property: Gets the status indicating whether the secondary location of the storage + * account is available or unavailable. Only available if the SKU name is Standard_GRS or Standard_RAGRS. + * + * @return the statusOfSecondary value. + */ + AccountStatus statusOfSecondary(); + + /** + * Gets the creationTime property: Gets the creation date and time of the storage account in UTC. + * + * @return the creationTime value. + */ + OffsetDateTime creationTime(); + + /** + * Gets the customDomain property: Gets the custom domain the user assigned to this storage account. + * + * @return the customDomain value. + */ + CustomDomain customDomain(); + + /** + * Gets the sasPolicy property: SasPolicy assigned to the storage account. + * + * @return the sasPolicy value. + */ + SasPolicy sasPolicy(); + + /** + * Gets the keyPolicy property: KeyPolicy assigned to the storage account. + * + * @return the keyPolicy value. + */ + KeyPolicy keyPolicy(); + + /** + * Gets the keyCreationTime property: Storage account keys creation time. + * + * @return the keyCreationTime value. + */ + KeyCreationTime keyCreationTime(); + + /** + * Gets the secondaryEndpoints property: Gets the URLs that are used to perform a retrieval of a public blob, queue, + * or table object from the secondary location of the storage account. Only available if the SKU name is + * Standard_RAGRS. + * + * @return the secondaryEndpoints value. + */ + Endpoints secondaryEndpoints(); + + /** + * Gets the encryption property: Encryption settings to be used for server-side encryption for the storage account. + * + * @return the encryption value. + */ + Encryption encryption(); + + /** + * Gets the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier is used for + * billing. The 'Premium' access tier is the default value for premium block blobs storage account type and it + * cannot be changed for the premium block blobs storage account type. + * + * @return the accessTier value. + */ + AccessTier accessTier(); + + /** + * Gets the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @return the azureFilesIdentityBasedAuthentication value. + */ + AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication(); + + /** + * Gets the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. + * + * @return the enableHttpsTrafficOnly value. + */ + Boolean enableHttpsTrafficOnly(); + + /** + * Gets the networkRuleSet property: Network rule set. + * + * @return the networkRuleSet value. + */ + NetworkRuleSet networkRuleSet(); + + /** + * Gets the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @return the isSftpEnabled value. + */ + Boolean isSftpEnabled(); + + /** + * Gets the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @return the isLocalUserEnabled value. + */ + Boolean isLocalUserEnabled(); + + /** + * Gets the enableExtendedGroups property: Enables extended group support with local users feature, if set to true. + * + * @return the enableExtendedGroups value. + */ + Boolean enableExtendedGroups(); + + /** + * Gets the isHnsEnabled property: Account HierarchicalNamespace enabled if sets to true. + * + * @return the isHnsEnabled value. + */ + Boolean isHnsEnabled(); + + /** + * Gets the geoReplicationStats property: Geo Replication Stats. + * + * @return the geoReplicationStats value. + */ + GeoReplicationStats geoReplicationStats(); + + /** + * Gets the failoverInProgress property: If the failover is in progress, the value will be true, otherwise, it will + * be null. + * + * @return the failoverInProgress value. + */ + Boolean failoverInProgress(); + + /** + * Gets the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @return the largeFileSharesState value. + */ + LargeFileSharesState largeFileSharesState(); + + /** + * Gets the privateEndpointConnections property: List of private endpoint connection associated with the specified + * storage account. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @return the routingPreference value. + */ + RoutingPreference routingPreference(); + + /** + * Gets the blobRestoreStatus property: Blob restore status. + * + * @return the blobRestoreStatus value. + */ + BlobRestoreStatus blobRestoreStatus(); + + /** + * Gets the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the + * storage account. The default interpretation is false for this property. + * + * @return the allowBlobPublicAccess value. + */ + Boolean allowBlobPublicAccess(); + + /** + * Gets the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @return the minimumTlsVersion value. + */ + MinimumTlsVersion minimumTlsVersion(); + + /** + * Gets the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be authorized + * with the account access key via Shared Key. If false, then all requests, including shared access signatures, must + * be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. + * + * @return the allowSharedKeyAccess value. + */ + Boolean allowSharedKeyAccess(); + + /** + * Gets the enableNfsV3 property: NFS 3.0 protocol support enabled if set to true. + * + * @return the enableNfsV3 value. + */ + Boolean enableNfsV3(); + + /** + * Gets the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. Set this + * property to true for new or existing accounts only if object replication policies will involve storage accounts + * in different AAD tenants. The default interpretation is false for new accounts to follow best security practices + * by default. + * + * @return the allowCrossTenantReplication value. + */ + Boolean allowCrossTenantReplication(); + + /** + * Gets the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @return the defaultToOAuthAuthentication value. + */ + Boolean defaultToOAuthAuthentication(); + + /** + * Gets the publicNetworkAccess property: Allow, disallow, or let Network Security Perimeter configuration to + * evaluate public network access to Storage Account. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * Gets the immutableStorageWithVersioning property: The property is immutable and can only be set to true at the + * account creation time. When set to true, it enables object level immutability for all the containers in the + * account by default. + * + * @return the immutableStorageWithVersioning value. + */ + ImmutableStorageAccount immutableStorageWithVersioning(); + + /** + * Gets the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @return the allowedCopyScope value. + */ + AllowedCopyScope allowedCopyScope(); + + /** + * Gets the storageAccountSkuConversionStatus property: This property is readOnly and is set by server during + * asynchronous storage account sku conversion operations. + * + * @return the storageAccountSkuConversionStatus value. + */ + StorageAccountSkuConversionStatus storageAccountSkuConversionStatus(); + + /** + * Gets the dnsEndpointType property: Allows you to specify the type of endpoint. Set this to AzureDNSZone to create + * a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint + * URL will have an alphanumeric DNS Zone identifier. + * + * @return the dnsEndpointType value. + */ + DnsEndpointType dnsEndpointType(); + + /** + * Gets the isSkuConversionBlocked property: This property will be set to true or false on an event of ongoing + * migration. Default value is null. + * + * @return the isSkuConversionBlocked value. + */ + Boolean isSkuConversionBlocked(); + + /** + * Gets the accountMigrationInProgress property: If customer initiated account migration is in progress, the value + * will be true else it will be null. + * + * @return the accountMigrationInProgress value. + */ + Boolean accountMigrationInProgress(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountPropertiesInner object. + * + * @return the inner object. + */ + StorageAccountPropertiesInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountRegenerateKeyParameters.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountRegenerateKeyParameters.java new file mode 100644 index 0000000000000..7f31829323f9c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountRegenerateKeyParameters.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * The parameters used to regenerate the storage account key. + */ +@Fluent +public final class StorageAccountRegenerateKeyParameters + implements JsonSerializable { + /* + * The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. + */ + private String keyName; + + /** + * Creates an instance of StorageAccountRegenerateKeyParameters class. + */ + public StorageAccountRegenerateKeyParameters() { + } + + /** + * Get the keyName property: The name of storage keys that want to be regenerated, possible values are key1, key2, + * kerb1, kerb2. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the keyName property: The name of storage keys that want to be regenerated, possible values are key1, key2, + * kerb1, kerb2. + * + * @param keyName the keyName value to set. + * @return the StorageAccountRegenerateKeyParameters object itself. + */ + public StorageAccountRegenerateKeyParameters withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property keyName in model StorageAccountRegenerateKeyParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageAccountRegenerateKeyParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyName", this.keyName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountRegenerateKeyParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountRegenerateKeyParameters 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 StorageAccountRegenerateKeyParameters. + */ + public static StorageAccountRegenerateKeyParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountRegenerateKeyParameters deserializedStorageAccountRegenerateKeyParameters + = new StorageAccountRegenerateKeyParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyName".equals(fieldName)) { + deserializedStorageAccountRegenerateKeyParameters.keyName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountRegenerateKeyParameters; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountSkuConversionStatus.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountSkuConversionStatus.java new file mode 100644 index 0000000000000..d90c9da2a2a9c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountSkuConversionStatus.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * This defines the sku conversion status object for asynchronous sku conversions. + */ +@Fluent +public final class StorageAccountSkuConversionStatus implements JsonSerializable { + /* + * This property indicates the current sku conversion status. + */ + private SkuConversionStatus skuConversionStatus; + + /* + * This property represents the target sku name to which the account sku is being converted asynchronously. + */ + private SkuName targetSkuName; + + /* + * This property represents the sku conversion start time. + */ + private String startTime; + + /* + * This property represents the sku conversion end time. + */ + private String endTime; + + /** + * Creates an instance of StorageAccountSkuConversionStatus class. + */ + public StorageAccountSkuConversionStatus() { + } + + /** + * Get the skuConversionStatus property: This property indicates the current sku conversion status. + * + * @return the skuConversionStatus value. + */ + public SkuConversionStatus skuConversionStatus() { + return this.skuConversionStatus; + } + + /** + * Get the targetSkuName property: This property represents the target sku name to which the account sku is being + * converted asynchronously. + * + * @return the targetSkuName value. + */ + public SkuName targetSkuName() { + return this.targetSkuName; + } + + /** + * Set the targetSkuName property: This property represents the target sku name to which the account sku is being + * converted asynchronously. + * + * @param targetSkuName the targetSkuName value to set. + * @return the StorageAccountSkuConversionStatus object itself. + */ + public StorageAccountSkuConversionStatus withTargetSkuName(SkuName targetSkuName) { + this.targetSkuName = targetSkuName; + return this; + } + + /** + * Get the startTime property: This property represents the sku conversion start time. + * + * @return the startTime value. + */ + public String startTime() { + return this.startTime; + } + + /** + * Get the endTime property: This property represents the sku conversion end time. + * + * @return the endTime value. + */ + public String endTime() { + return this.endTime; + } + + /** + * 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("targetSkuName", this.targetSkuName == null ? null : this.targetSkuName.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountSkuConversionStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountSkuConversionStatus 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 StorageAccountSkuConversionStatus. + */ + public static StorageAccountSkuConversionStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountSkuConversionStatus deserializedStorageAccountSkuConversionStatus + = new StorageAccountSkuConversionStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("skuConversionStatus".equals(fieldName)) { + deserializedStorageAccountSkuConversionStatus.skuConversionStatus + = SkuConversionStatus.fromString(reader.getString()); + } else if ("targetSkuName".equals(fieldName)) { + deserializedStorageAccountSkuConversionStatus.targetSkuName + = SkuName.fromString(reader.getString()); + } else if ("startTime".equals(fieldName)) { + deserializedStorageAccountSkuConversionStatus.startTime = reader.getString(); + } else if ("endTime".equals(fieldName)) { + deserializedStorageAccountSkuConversionStatus.endTime = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountSkuConversionStatus; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountUpdateParameters.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountUpdateParameters.java new file mode 100644 index 0000000000000..f86e0de12e71d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountUpdateParameters.java @@ -0,0 +1,775 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountPropertiesUpdateParameters; +import java.io.IOException; +import java.util.Map; + +/** + * The parameters that can be provided when updating the storage account properties. + */ +@Fluent +public final class StorageAccountUpdateParameters implements JsonSerializable { + /* + * Gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, + * nor can accounts of those SKU names be updated to any other value. + */ + private Sku sku; + + /* + * Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping + * this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a + * key no greater in length than 128 characters and a value no greater in length than 256 characters. + */ + private Map tags; + + /* + * The identity of the resource. + */ + private Identity identity; + + /* + * The parameters used when updating a storage account. + */ + private StorageAccountPropertiesUpdateParameters innerProperties; + + /* + * Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. + */ + private Kind kind; + + /** + * Creates an instance of StorageAccountUpdateParameters class. + */ + public StorageAccountUpdateParameters() { + } + + /** + * Get the sku property: Gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, + * Premium_LRS or Premium_ZRS, nor can accounts of those SKU names be updated to any other value. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, + * Premium_LRS or Premium_ZRS, nor can accounts of those SKU names be updated to any other value. + * + * @param sku the sku value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the tags property: Gets or sets a list of key value pairs that describe the resource. These tags can be used + * in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a + * resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than + * 256 characters. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Gets or sets a list of key value pairs that describe the resource. These tags can be used + * in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a + * resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than + * 256 characters. + * + * @param tags the tags value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity property: The identity of the resource. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the resource. + * + * @param identity the identity value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: The parameters used when updating a storage account. + * + * @return the innerProperties value. + */ + private StorageAccountPropertiesUpdateParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the kind property: Optional. Indicates the type of storage account. Currently only StorageV2 value supported + * by server. + * + * @return the kind value. + */ + public Kind kind() { + return this.kind; + } + + /** + * Set the kind property: Optional. Indicates the type of storage account. Currently only StorageV2 value supported + * by server. + * + * @param kind the kind value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withKind(Kind kind) { + this.kind = kind; + return this; + } + + /** + * Get the customDomain property: Custom domain assigned to the storage account by the user. Name is the CNAME + * source. Only one custom domain is supported per storage account at this time. To clear the existing custom + * domain, use an empty string for the custom domain name property. + * + * @return the customDomain value. + */ + public CustomDomain customDomain() { + return this.innerProperties() == null ? null : this.innerProperties().customDomain(); + } + + /** + * Set the customDomain property: Custom domain assigned to the storage account by the user. Name is the CNAME + * source. Only one custom domain is supported per storage account at this time. To clear the existing custom + * domain, use an empty string for the custom domain name property. + * + * @param customDomain the customDomain value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withCustomDomain(CustomDomain customDomain) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withCustomDomain(customDomain); + return this; + } + + /** + * Get the encryption property: Not applicable. Azure Storage encryption at rest is enabled by default for all + * storage accounts and cannot be disabled. + * + * @return the encryption value. + */ + public Encryption encryption() { + return this.innerProperties() == null ? null : this.innerProperties().encryption(); + } + + /** + * Set the encryption property: Not applicable. Azure Storage encryption at rest is enabled by default for all + * storage accounts and cannot be disabled. + * + * @param encryption the encryption value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withEncryption(Encryption encryption) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withEncryption(encryption); + return this; + } + + /** + * Get the sasPolicy property: SasPolicy assigned to the storage account. + * + * @return the sasPolicy value. + */ + public SasPolicy sasPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().sasPolicy(); + } + + /** + * Set the sasPolicy property: SasPolicy assigned to the storage account. + * + * @param sasPolicy the sasPolicy value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withSasPolicy(SasPolicy sasPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withSasPolicy(sasPolicy); + return this; + } + + /** + * Get the keyPolicy property: KeyPolicy assigned to the storage account. + * + * @return the keyPolicy value. + */ + public KeyPolicy keyPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().keyPolicy(); + } + + /** + * Set the keyPolicy property: KeyPolicy assigned to the storage account. + * + * @param keyPolicy the keyPolicy value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withKeyPolicy(KeyPolicy keyPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withKeyPolicy(keyPolicy); + return this; + } + + /** + * Get the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier is used for + * billing. The 'Premium' access tier is the default value for premium block blobs storage account type and it + * cannot be changed for the premium block blobs storage account type. + * + * @return the accessTier value. + */ + public AccessTier accessTier() { + return this.innerProperties() == null ? null : this.innerProperties().accessTier(); + } + + /** + * Set the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier is used for + * billing. The 'Premium' access tier is the default value for premium block blobs storage account type and it + * cannot be changed for the premium block blobs storage account type. + * + * @param accessTier the accessTier value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withAccessTier(AccessTier accessTier) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withAccessTier(accessTier); + return this; + } + + /** + * Get the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @return the azureFilesIdentityBasedAuthentication value. + */ + public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { + return this.innerProperties() == null ? null : this.innerProperties().azureFilesIdentityBasedAuthentication(); + } + + /** + * Set the azureFilesIdentityBasedAuthentication property: Provides the identity based authentication settings for + * Azure Files. + * + * @param azureFilesIdentityBasedAuthentication the azureFilesIdentityBasedAuthentication value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withAzureFilesIdentityBasedAuthentication( + AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withAzureFilesIdentityBasedAuthentication(azureFilesIdentityBasedAuthentication); + return this; + } + + /** + * Get the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. + * + * @return the enableHttpsTrafficOnly value. + */ + public Boolean enableHttpsTrafficOnly() { + return this.innerProperties() == null ? null : this.innerProperties().enableHttpsTrafficOnly(); + } + + /** + * Set the enableHttpsTrafficOnly property: Allows https traffic only to storage service if sets to true. + * + * @param enableHttpsTrafficOnly the enableHttpsTrafficOnly value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withEnableHttpsTrafficOnly(enableHttpsTrafficOnly); + return this; + } + + /** + * Get the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @return the isSftpEnabled value. + */ + public Boolean isSftpEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isSftpEnabled(); + } + + /** + * Set the isSftpEnabled property: Enables Secure File Transfer Protocol, if set to true. + * + * @param isSftpEnabled the isSftpEnabled value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withIsSftpEnabled(Boolean isSftpEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withIsSftpEnabled(isSftpEnabled); + return this; + } + + /** + * Get the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @return the isLocalUserEnabled value. + */ + public Boolean isLocalUserEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isLocalUserEnabled(); + } + + /** + * Set the isLocalUserEnabled property: Enables local users feature, if set to true. + * + * @param isLocalUserEnabled the isLocalUserEnabled value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withIsLocalUserEnabled(Boolean isLocalUserEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withIsLocalUserEnabled(isLocalUserEnabled); + return this; + } + + /** + * Get the enableExtendedGroups property: Enables extended group support with local users feature, if set to true. + * + * @return the enableExtendedGroups value. + */ + public Boolean enableExtendedGroups() { + return this.innerProperties() == null ? null : this.innerProperties().enableExtendedGroups(); + } + + /** + * Set the enableExtendedGroups property: Enables extended group support with local users feature, if set to true. + * + * @param enableExtendedGroups the enableExtendedGroups value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withEnableExtendedGroups(Boolean enableExtendedGroups) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withEnableExtendedGroups(enableExtendedGroups); + return this; + } + + /** + * Get the networkRuleSet property: Network rule set. + * + * @return the networkRuleSet value. + */ + public NetworkRuleSet networkRuleSet() { + return this.innerProperties() == null ? null : this.innerProperties().networkRuleSet(); + } + + /** + * Set the networkRuleSet property: Network rule set. + * + * @param networkRuleSet the networkRuleSet value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withNetworkRuleSet(networkRuleSet); + return this; + } + + /** + * Get the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @return the largeFileSharesState value. + */ + public LargeFileSharesState largeFileSharesState() { + return this.innerProperties() == null ? null : this.innerProperties().largeFileSharesState(); + } + + /** + * Set the largeFileSharesState property: Allow large file shares if sets to Enabled. It cannot be disabled once it + * is enabled. + * + * @param largeFileSharesState the largeFileSharesState value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withLargeFileSharesState(LargeFileSharesState largeFileSharesState) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withLargeFileSharesState(largeFileSharesState); + return this; + } + + /** + * Get the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @return the routingPreference value. + */ + public RoutingPreference routingPreference() { + return this.innerProperties() == null ? null : this.innerProperties().routingPreference(); + } + + /** + * Set the routingPreference property: Maintains information about the network routing choice opted by the user for + * data transfer. + * + * @param routingPreference the routingPreference value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withRoutingPreference(RoutingPreference routingPreference) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withRoutingPreference(routingPreference); + return this; + } + + /** + * Get the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is false for this property. + * + * @return the allowBlobPublicAccess value. + */ + public Boolean allowBlobPublicAccess() { + return this.innerProperties() == null ? null : this.innerProperties().allowBlobPublicAccess(); + } + + /** + * Set the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is false for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withAllowBlobPublicAccess(allowBlobPublicAccess); + return this; + } + + /** + * Get the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @return the minimumTlsVersion value. + */ + public MinimumTlsVersion minimumTlsVersion() { + return this.innerProperties() == null ? null : this.innerProperties().minimumTlsVersion(); + } + + /** + * Set the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withMinimumTlsVersion(minimumTlsVersion); + return this; + } + + /** + * Get the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be authorized + * with the account access key via Shared Key. If false, then all requests, including shared access signatures, must + * be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. + * + * @return the allowSharedKeyAccess value. + */ + public Boolean allowSharedKeyAccess() { + return this.innerProperties() == null ? null : this.innerProperties().allowSharedKeyAccess(); + } + + /** + * Set the allowSharedKeyAccess property: Indicates whether the storage account permits requests to be authorized + * with the account access key via Shared Key. If false, then all requests, including shared access signatures, must + * be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. + * + * @param allowSharedKeyAccess the allowSharedKeyAccess value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withAllowSharedKeyAccess(Boolean allowSharedKeyAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withAllowSharedKeyAccess(allowSharedKeyAccess); + return this; + } + + /** + * Get the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. Set this + * property to true for new or existing accounts only if object replication policies will involve storage accounts + * in different AAD tenants. The default interpretation is false for new accounts to follow best security practices + * by default. + * + * @return the allowCrossTenantReplication value. + */ + public Boolean allowCrossTenantReplication() { + return this.innerProperties() == null ? null : this.innerProperties().allowCrossTenantReplication(); + } + + /** + * Set the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. Set this + * property to true for new or existing accounts only if object replication policies will involve storage accounts + * in different AAD tenants. The default interpretation is false for new accounts to follow best security practices + * by default. + * + * @param allowCrossTenantReplication the allowCrossTenantReplication value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withAllowCrossTenantReplication(Boolean allowCrossTenantReplication) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withAllowCrossTenantReplication(allowCrossTenantReplication); + return this; + } + + /** + * Get the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @return the defaultToOAuthAuthentication value. + */ + public Boolean defaultToOAuthAuthentication() { + return this.innerProperties() == null ? null : this.innerProperties().defaultToOAuthAuthentication(); + } + + /** + * Set the defaultToOAuthAuthentication property: A boolean flag which indicates whether the default authentication + * is OAuth or not. The default interpretation is false for this property. + * + * @param defaultToOAuthAuthentication the defaultToOAuthAuthentication value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withDefaultToOAuthAuthentication(Boolean defaultToOAuthAuthentication) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withDefaultToOAuthAuthentication(defaultToOAuthAuthentication); + return this; + } + + /** + * Get the publicNetworkAccess property: Allow, disallow, or let Network Security Perimeter configuration to + * evaluate public network access to Storage Account. Value is optional but if passed in, must be 'Enabled', + * 'Disabled' or 'SecuredByPerimeter'. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: Allow, disallow, or let Network Security Perimeter configuration to + * evaluate public network access to Storage Account. Value is optional but if passed in, must be 'Enabled', + * 'Disabled' or 'SecuredByPerimeter'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Get the immutableStorageWithVersioning property: The property is immutable and can only be set to true at the + * account creation time. When set to true, it enables object level immutability for all the containers in the + * account by default. + * + * @return the immutableStorageWithVersioning value. + */ + public ImmutableStorageAccount immutableStorageWithVersioning() { + return this.innerProperties() == null ? null : this.innerProperties().immutableStorageWithVersioning(); + } + + /** + * Set the immutableStorageWithVersioning property: The property is immutable and can only be set to true at the + * account creation time. When set to true, it enables object level immutability for all the containers in the + * account by default. + * + * @param immutableStorageWithVersioning the immutableStorageWithVersioning value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters + withImmutableStorageWithVersioning(ImmutableStorageAccount immutableStorageWithVersioning) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withImmutableStorageWithVersioning(immutableStorageWithVersioning); + return this; + } + + /** + * Get the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @return the allowedCopyScope value. + */ + public AllowedCopyScope allowedCopyScope() { + return this.innerProperties() == null ? null : this.innerProperties().allowedCopyScope(); + } + + /** + * Set the allowedCopyScope property: Restrict copy to and from Storage Accounts within an AAD tenant or with + * Private Links to the same VNet. + * + * @param allowedCopyScope the allowedCopyScope value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withAllowedCopyScope(AllowedCopyScope allowedCopyScope) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withAllowedCopyScope(allowedCopyScope); + return this; + } + + /** + * Get the dnsEndpointType property: Allows you to specify the type of endpoint. Set this to AzureDNSZone to create + * a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint + * URL will have an alphanumeric DNS Zone identifier. + * + * @return the dnsEndpointType value. + */ + public DnsEndpointType dnsEndpointType() { + return this.innerProperties() == null ? null : this.innerProperties().dnsEndpointType(); + } + + /** + * Set the dnsEndpointType property: Allows you to specify the type of endpoint. Set this to AzureDNSZone to create + * a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint + * URL will have an alphanumeric DNS Zone identifier. + * + * @param dnsEndpointType the dnsEndpointType value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withDnsEndpointType(DnsEndpointType dnsEndpointType) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageAccountPropertiesUpdateParameters(); + } + this.innerProperties().withDnsEndpointType(dnsEndpointType); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountUpdateParameters 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 StorageAccountUpdateParameters. + */ + public static StorageAccountUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountUpdateParameters deserializedStorageAccountUpdateParameters + = new StorageAccountUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sku".equals(fieldName)) { + deserializedStorageAccountUpdateParameters.sku = Sku.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedStorageAccountUpdateParameters.tags = tags; + } else if ("identity".equals(fieldName)) { + deserializedStorageAccountUpdateParameters.identity = Identity.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedStorageAccountUpdateParameters.innerProperties + = StorageAccountPropertiesUpdateParameters.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedStorageAccountUpdateParameters.kind = Kind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountUpdateParameters; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccounts.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccounts.java new file mode 100644 index 0000000000000..2fca7a0fb1a19 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccounts.java @@ -0,0 +1,574 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountMigrationInner; + +/** + * Resource collection API of StorageAccounts. + */ +public interface StorageAccounts { + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 CheckNameAvailability operation response along with {@link Response}. + */ + Response + checkNameAvailabilityWithResponse(StorageAccountCheckNameAvailabilityParameters accountName, Context context); + + /** + * Checks that the storage account name is valid and is not already in use. + * + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 CheckNameAvailability operation response. + */ + CheckNameAvailabilityResult checkNameAvailability(StorageAccountCheckNameAvailabilityParameters accountName); + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 Response}. + */ + Response deleteByResourceGroupWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String accountName); + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, + * and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand May be used to expand the properties within account's properties. By default, data is not included + * when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. + * @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 storage account along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, + StorageAccountExpand expand, Context context); + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, + * and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 storage account. + */ + StorageAccount getByResourceGroup(String resourceGroupName, String accountName); + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the + * ListKeys operation for this. + * + * @throws com.azure.core.management.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 from the List Storage Accounts operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the + * ListKeys operation for this. + * + * @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 from the List Storage Accounts operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; + * use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 from the List Storage Accounts operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; + * use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 from the List Storage Accounts operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand Specifies type of the key to be listed. Possible value is kerb. + * @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 from the ListKeys operation along with {@link Response}. + */ + Response listKeysWithResponse(String resourceGroupName, String accountName, + ListKeyExpand expand, Context context); + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 from the ListKeys operation. + */ + StorageAccountListKeysResult listKeys(String resourceGroupName, String accountName); + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. + * @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 from the ListKeys operation along with {@link Response}. + */ + Response regenerateKeyWithResponse(String resourceGroupName, String accountName, + StorageAccountRegenerateKeyParameters regenerateKey, Context context); + + /** + * Regenerates one of the access keys or Kerberos keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param regenerateKey Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 from the ListKeys operation. + */ + StorageAccountListKeysResult regenerateKey(String resourceGroupName, String accountName, + StorageAccountRegenerateKeyParameters regenerateKey); + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List SAS credentials operation response along with {@link Response}. + */ + Response listAccountSasWithResponse(String resourceGroupName, String accountName, + AccountSasParameters parameters, Context context); + + /** + * List SAS credentials of a storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list SAS credentials for the storage account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List SAS credentials operation response. + */ + ListAccountSasResponse listAccountSas(String resourceGroupName, String accountName, + AccountSasParameters parameters); + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @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 List service SAS credentials operation response along with {@link Response}. + */ + Response listServiceSasWithResponse(String resourceGroupName, String accountName, + ServiceSasParameters parameters, Context context); + + /** + * List service SAS credentials of a specific resource. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to list service SAS credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List service SAS credentials operation response. + */ + ListServiceSasResponse listServiceSas(String resourceGroupName, String accountName, + ServiceSasParameters parameters); + + /** + * A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable for + * any reason. The failover occurs from the storage account's primary cluster to the secondary cluster for RA-GRS + * accounts. The secondary cluster will become primary after failover and the account is converted to LRS. In the + * case of a Planned Failover, the primary and secondary clusters are swapped after failover and the account remains + * geo-replicated. Failover should continue to be used in the event of availability issues as Planned failover is + * only available while the primary and secondary endpoints are available. The primary use case of a Planned + * Failover is disaster recovery testing drills. This type of failover is invoked by setting FailoverType parameter + * to 'Planned'. Learn more about the failover options here- + * https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 failover(String resourceGroupName, String accountName); + + /** + * A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable for + * any reason. The failover occurs from the storage account's primary cluster to the secondary cluster for RA-GRS + * accounts. The secondary cluster will become primary after failover and the account is converted to LRS. In the + * case of a Planned Failover, the primary and secondary clusters are swapped after failover and the account remains + * geo-replicated. Failover should continue to be used in the event of availability issues as Planned failover is + * only available while the primary and secondary endpoints are available. The primary use case of a Planned + * Failover is disaster recovery testing drills. This type of failover is invoked by setting FailoverType parameter + * to 'Planned'. Learn more about the failover options here- + * https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param failoverType The parameter is set to 'Planned' to indicate whether a Planned failover is requested. + * @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 failover(String resourceGroupName, String accountName, FailoverType failoverType, Context context); + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param requestType Required. Hierarchical namespace migration type can either be a hierarchical namespace + * validation request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation + * request will validate the migration whereas the hydration request will migrate the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void hierarchicalNamespaceMigration(String resourceGroupName, String accountName, String requestType); + + /** + * Live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param requestType Required. Hierarchical namespace migration type can either be a hierarchical namespace + * validation request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation + * request will validate the migration whereas the hydration request will migrate the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void hierarchicalNamespaceMigration(String resourceGroupName, String accountName, String requestType, + Context context); + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 abortHierarchicalNamespaceMigration(String resourceGroupName, String accountName); + + /** + * Abort live Migration of storage account to enable Hns. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 abortHierarchicalNamespaceMigration(String resourceGroupName, String accountName, Context context); + + /** + * Account Migration request can be triggered for a storage account to change its redundancy level. The migration + * updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have + * better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously + * across three Azure availability zones in the primary region. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The request parameters required to perform storage account migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 customerInitiatedMigration(String resourceGroupName, String accountName, + StorageAccountMigrationInner parameters); + + /** + * Account Migration request can be triggered for a storage account to change its redundancy level. The migration + * updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have + * better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously + * across three Azure availability zones in the primary region. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The request parameters required to perform storage account migration. + * @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 customerInitiatedMigration(String resourceGroupName, String accountName, + StorageAccountMigrationInner parameters, Context context); + + /** + * Gets the status of the ongoing migration for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param migrationName The name of the Storage Account Migration. It should always be 'default'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the ongoing migration for the specified storage account along with {@link Response}. + */ + Response getCustomerInitiatedMigrationWithResponse(String resourceGroupName, + String accountName, MigrationName migrationName, Context context); + + /** + * Gets the status of the ongoing migration for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param migrationName The name of the Storage Account Migration. It should always be 'default'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the ongoing migration for the specified storage account. + */ + StorageAccountMigration getCustomerInitiatedMigration(String resourceGroupName, String accountName, + MigrationName migrationName); + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 blob restore status. + */ + BlobRestoreStatus restoreBlobRanges(String resourceGroupName, String accountName, BlobRestoreParameters parameters); + + /** + * Restore blobs in the specified blob ranges. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for restore blob ranges. + * @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 blob restore status. + */ + BlobRestoreStatus restoreBlobRanges(String resourceGroupName, String accountName, BlobRestoreParameters parameters, + Context context); + + /** + * Revoke user delegation keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 Response}. + */ + Response revokeUserDelegationKeysWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * Revoke user delegation keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 revokeUserDelegationKeys(String resourceGroupName, String accountName); + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, + * and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account along with {@link Response}. + */ + StorageAccount getById(String id); + + /** + * Returns the properties for the specified storage account including but not limited to name, SKU name, location, + * and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @param id the resource ID. + * @param expand May be used to expand the properties within account's properties. By default, data is not included + * when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. + * @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 storage account along with {@link Response}. + */ + Response getByIdWithResponse(String id, StorageAccountExpand expand, Context context); + + /** + * Deletes a storage account in Microsoft Azure. + * + * @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); + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new StorageAccount resource. + * + * @param name resource name. + * @return the first stage of the new StorageAccount definition. + */ + StorageAccount.DefinitionStages.Blank define(String name); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageQueue.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageQueue.java new file mode 100644 index 0000000000000..32c1547380a70 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageQueue.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageQueueInner; +import java.util.Map; + +/** + * An immutable client-side representation of StorageQueue. + */ +public interface StorageQueue { + /** + * 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 metadata property: A name-value pair that represents queue metadata. + * + * @return the metadata value. + */ + Map metadata(); + + /** + * Gets the approximateMessageCount property: Integer indicating an approximate number of messages in the queue. + * This number is not lower than the actual number of messages in the queue, but could be higher. + * + * @return the approximateMessageCount value. + */ + Integer approximateMessageCount(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.StorageQueueInner object. + * + * @return the inner object. + */ + StorageQueueInner innerModel(); + + /** + * The entirety of the StorageQueue definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The StorageQueue definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the StorageQueue definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the StorageQueue definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the StorageQueue 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.WithMetadata { + /** + * Executes the create request. + * + * @return the created resource. + */ + StorageQueue create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + StorageQueue create(Context context); + } + + /** + * The stage of the StorageQueue definition allowing to specify metadata. + */ + interface WithMetadata { + /** + * Specifies the metadata property: A name-value pair that represents queue metadata.. + * + * @param metadata A name-value pair that represents queue metadata. + * @return the next definition stage. + */ + WithCreate withMetadata(Map metadata); + } + } + + /** + * Begins update for the StorageQueue resource. + * + * @return the stage of resource update. + */ + StorageQueue.Update update(); + + /** + * The template for StorageQueue update. + */ + interface Update extends UpdateStages.WithMetadata { + /** + * Executes the update request. + * + * @return the updated resource. + */ + StorageQueue apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + StorageQueue apply(Context context); + } + + /** + * The StorageQueue update stages. + */ + interface UpdateStages { + /** + * The stage of the StorageQueue update allowing to specify metadata. + */ + interface WithMetadata { + /** + * Specifies the metadata property: A name-value pair that represents queue metadata.. + * + * @param metadata A name-value pair that represents queue metadata. + * @return the next definition stage. + */ + Update withMetadata(Map metadata); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + StorageQueue refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + StorageQueue refresh(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageSkuListResult.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageSkuListResult.java new file mode 100644 index 0000000000000..6da240731c4e4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageSkuListResult.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.models.SkuInformationInner; +import java.io.IOException; +import java.util.List; + +/** + * The response from the List Storage SKUs operation. + */ +@Immutable +public final class StorageSkuListResult implements JsonSerializable { + /* + * Get the list result of storage SKUs and their properties. + */ + private List value; + + /** + * Creates an instance of StorageSkuListResult class. + */ + public StorageSkuListResult() { + } + + /** + * Get the value property: Get the list result of storage SKUs and their properties. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageSkuListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageSkuListResult 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 StorageSkuListResult. + */ + public static StorageSkuListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageSkuListResult deserializedStorageSkuListResult = new StorageSkuListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SkuInformationInner.fromJson(reader1)); + deserializedStorageSkuListResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedStorageSkuListResult; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignment.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignment.java new file mode 100644 index 0000000000000..0dbe98dba2539 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignment.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageTaskAssignmentInner; + +/** + * An immutable client-side representation of StorageTaskAssignment. + */ +public interface StorageTaskAssignment { + /** + * 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 properties property: Properties of the storage task assignment. + * + * @return the properties value. + */ + StorageTaskAssignmentProperties properties(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.StorageTaskAssignmentInner object. + * + * @return the inner object. + */ + StorageTaskAssignmentInner innerModel(); + + /** + * The entirety of the StorageTaskAssignment definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * The StorageTaskAssignment definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the StorageTaskAssignment definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the StorageTaskAssignment definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithProperties withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the StorageTaskAssignment definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the storage task assignment.. + * + * @param properties Properties of the storage task assignment. + * @return the next definition stage. + */ + WithCreate withProperties(StorageTaskAssignmentProperties properties); + } + + /** + * The stage of the StorageTaskAssignment definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + StorageTaskAssignment create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + StorageTaskAssignment create(Context context); + } + } + + /** + * Begins update for the StorageTaskAssignment resource. + * + * @return the stage of resource update. + */ + StorageTaskAssignment.Update update(); + + /** + * The template for StorageTaskAssignment update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + StorageTaskAssignment apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + StorageTaskAssignment apply(Context context); + } + + /** + * The StorageTaskAssignment update stages. + */ + interface UpdateStages { + /** + * The stage of the StorageTaskAssignment update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the storage task assignment.. + * + * @param properties Properties of the storage task assignment. + * @return the next definition stage. + */ + Update withProperties(StorageTaskAssignmentUpdateProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + StorageTaskAssignment refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + StorageTaskAssignment refresh(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentExecutionContext.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentExecutionContext.java new file mode 100644 index 0000000000000..23e3a6aa56db4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentExecutionContext.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Execution context of the storage task assignment. + */ +@Fluent +public final class StorageTaskAssignmentExecutionContext + implements JsonSerializable { + /* + * Execution target of the storage task assignment + */ + private ExecutionTarget target; + + /* + * Execution trigger of the storage task assignment + */ + private ExecutionTrigger trigger; + + /** + * Creates an instance of StorageTaskAssignmentExecutionContext class. + */ + public StorageTaskAssignmentExecutionContext() { + } + + /** + * Get the target property: Execution target of the storage task assignment. + * + * @return the target value. + */ + public ExecutionTarget target() { + return this.target; + } + + /** + * Set the target property: Execution target of the storage task assignment. + * + * @param target the target value to set. + * @return the StorageTaskAssignmentExecutionContext object itself. + */ + public StorageTaskAssignmentExecutionContext withTarget(ExecutionTarget target) { + this.target = target; + return this; + } + + /** + * Get the trigger property: Execution trigger of the storage task assignment. + * + * @return the trigger value. + */ + public ExecutionTrigger trigger() { + return this.trigger; + } + + /** + * Set the trigger property: Execution trigger of the storage task assignment. + * + * @param trigger the trigger value to set. + * @return the StorageTaskAssignmentExecutionContext object itself. + */ + public StorageTaskAssignmentExecutionContext withTrigger(ExecutionTrigger trigger) { + this.trigger = trigger; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (target() != null) { + target().validate(); + } + if (trigger() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property trigger in model StorageTaskAssignmentExecutionContext")); + } else { + trigger().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageTaskAssignmentExecutionContext.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("trigger", this.trigger); + jsonWriter.writeJsonField("target", this.target); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageTaskAssignmentExecutionContext from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTaskAssignmentExecutionContext 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 StorageTaskAssignmentExecutionContext. + */ + public static StorageTaskAssignmentExecutionContext fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTaskAssignmentExecutionContext deserializedStorageTaskAssignmentExecutionContext + = new StorageTaskAssignmentExecutionContext(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("trigger".equals(fieldName)) { + deserializedStorageTaskAssignmentExecutionContext.trigger = ExecutionTrigger.fromJson(reader); + } else if ("target".equals(fieldName)) { + deserializedStorageTaskAssignmentExecutionContext.target = ExecutionTarget.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTaskAssignmentExecutionContext; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentInstancesReports.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentInstancesReports.java new file mode 100644 index 0000000000000..2ecd78ae1033f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentInstancesReports.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of StorageTaskAssignmentInstancesReports. + */ +public interface StorageTaskAssignmentInstancesReports { + /** + * Fetch the report summary of a single storage task assignment's instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, + String storageTaskAssignmentName); + + /** + * Fetch the report summary of a single storage task assignment's instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment instances to be included in + * the list response. + * @param filter Optional. When specified, it can be used to query using reporting properties. See [Constructing + * Filter + * Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) + * for details. + * @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 fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, + String storageTaskAssignmentName, Integer maxpagesize, String filter, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentProperties.java new file mode 100644 index 0000000000000..a186da4f7d9bf --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentProperties.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 of the storage task assignment. + */ +@Fluent +public final class StorageTaskAssignmentProperties implements JsonSerializable { + /* + * Id of the corresponding storage task + */ + private String taskId; + + /* + * Whether the storage task assignment is enabled or not + */ + private boolean enabled; + + /* + * Text that describes the purpose of the storage task assignment + */ + private String description; + + /* + * The storage task assignment execution context + */ + private StorageTaskAssignmentExecutionContext executionContext; + + /* + * The storage task assignment report + */ + private StorageTaskAssignmentReport report; + + /* + * Represents the provisioning state of the storage task assignment. + */ + private ProvisioningState provisioningState; + + /* + * Run status of storage task assignment + */ + private StorageTaskReportProperties runStatus; + + /** + * Creates an instance of StorageTaskAssignmentProperties class. + */ + public StorageTaskAssignmentProperties() { + } + + /** + * Get the taskId property: Id of the corresponding storage task. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the taskId property: Id of the corresponding storage task. + * + * @param taskId the taskId value to set. + * @return the StorageTaskAssignmentProperties object itself. + */ + public StorageTaskAssignmentProperties withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get the enabled property: Whether the storage task assignment is enabled or not. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether the storage task assignment is enabled or not. + * + * @param enabled the enabled value to set. + * @return the StorageTaskAssignmentProperties object itself. + */ + public StorageTaskAssignmentProperties withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the description property: Text that describes the purpose of the storage task assignment. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Text that describes the purpose of the storage task assignment. + * + * @param description the description value to set. + * @return the StorageTaskAssignmentProperties object itself. + */ + public StorageTaskAssignmentProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the executionContext property: The storage task assignment execution context. + * + * @return the executionContext value. + */ + public StorageTaskAssignmentExecutionContext executionContext() { + return this.executionContext; + } + + /** + * Set the executionContext property: The storage task assignment execution context. + * + * @param executionContext the executionContext value to set. + * @return the StorageTaskAssignmentProperties object itself. + */ + public StorageTaskAssignmentProperties + withExecutionContext(StorageTaskAssignmentExecutionContext executionContext) { + this.executionContext = executionContext; + return this; + } + + /** + * Get the report property: The storage task assignment report. + * + * @return the report value. + */ + public StorageTaskAssignmentReport report() { + return this.report; + } + + /** + * Set the report property: The storage task assignment report. + * + * @param report the report value to set. + * @return the StorageTaskAssignmentProperties object itself. + */ + public StorageTaskAssignmentProperties withReport(StorageTaskAssignmentReport report) { + this.report = report; + return this; + } + + /** + * Get the provisioningState property: Represents the provisioning state of the storage task assignment. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the runStatus property: Run status of storage task assignment. + * + * @return the runStatus value. + */ + public StorageTaskReportProperties runStatus() { + return this.runStatus; + } + + /** + * Set the runStatus property: Run status of storage task assignment. + * + * @param runStatus the runStatus value to set. + * @return the StorageTaskAssignmentProperties object itself. + */ + public StorageTaskAssignmentProperties withRunStatus(StorageTaskReportProperties runStatus) { + this.runStatus = runStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (taskId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property taskId in model StorageTaskAssignmentProperties")); + } + if (description() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property description in model StorageTaskAssignmentProperties")); + } + if (executionContext() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property executionContext in model StorageTaskAssignmentProperties")); + } else { + executionContext().validate(); + } + if (report() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property report in model StorageTaskAssignmentProperties")); + } else { + report().validate(); + } + if (runStatus() != null) { + runStatus().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageTaskAssignmentProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("taskId", this.taskId); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("executionContext", this.executionContext); + jsonWriter.writeJsonField("report", this.report); + jsonWriter.writeJsonField("runStatus", this.runStatus); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageTaskAssignmentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTaskAssignmentProperties 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 StorageTaskAssignmentProperties. + */ + public static StorageTaskAssignmentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTaskAssignmentProperties deserializedStorageTaskAssignmentProperties + = new StorageTaskAssignmentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("taskId".equals(fieldName)) { + deserializedStorageTaskAssignmentProperties.taskId = reader.getString(); + } else if ("enabled".equals(fieldName)) { + deserializedStorageTaskAssignmentProperties.enabled = reader.getBoolean(); + } else if ("description".equals(fieldName)) { + deserializedStorageTaskAssignmentProperties.description = reader.getString(); + } else if ("executionContext".equals(fieldName)) { + deserializedStorageTaskAssignmentProperties.executionContext + = StorageTaskAssignmentExecutionContext.fromJson(reader); + } else if ("report".equals(fieldName)) { + deserializedStorageTaskAssignmentProperties.report = StorageTaskAssignmentReport.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedStorageTaskAssignmentProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("runStatus".equals(fieldName)) { + deserializedStorageTaskAssignmentProperties.runStatus + = StorageTaskReportProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTaskAssignmentProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentReport.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentReport.java new file mode 100644 index 0000000000000..01ca6a498be85 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentReport.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * The storage task assignment report. + */ +@Fluent +public final class StorageTaskAssignmentReport implements JsonSerializable { + /* + * The container prefix for the location of storage task assignment report + */ + private String prefix; + + /** + * Creates an instance of StorageTaskAssignmentReport class. + */ + public StorageTaskAssignmentReport() { + } + + /** + * Get the prefix property: The container prefix for the location of storage task assignment report. + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: The container prefix for the location of storage task assignment report. + * + * @param prefix the prefix value to set. + * @return the StorageTaskAssignmentReport object itself. + */ + public StorageTaskAssignmentReport withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (prefix() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property prefix in model StorageTaskAssignmentReport")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageTaskAssignmentReport.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("prefix", this.prefix); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageTaskAssignmentReport from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTaskAssignmentReport 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 StorageTaskAssignmentReport. + */ + public static StorageTaskAssignmentReport fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTaskAssignmentReport deserializedStorageTaskAssignmentReport = new StorageTaskAssignmentReport(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("prefix".equals(fieldName)) { + deserializedStorageTaskAssignmentReport.prefix = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTaskAssignmentReport; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentUpdateExecutionContext.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentUpdateExecutionContext.java new file mode 100644 index 0000000000000..c102ca3c3d7e1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentUpdateExecutionContext.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Execution context of the storage task assignment update. + */ +@Fluent +public final class StorageTaskAssignmentUpdateExecutionContext + implements JsonSerializable { + /* + * Execution target of the storage task assignment + */ + private ExecutionTarget target; + + /* + * Execution trigger of the storage task assignment + */ + private ExecutionTriggerUpdate trigger; + + /** + * Creates an instance of StorageTaskAssignmentUpdateExecutionContext class. + */ + public StorageTaskAssignmentUpdateExecutionContext() { + } + + /** + * Get the target property: Execution target of the storage task assignment. + * + * @return the target value. + */ + public ExecutionTarget target() { + return this.target; + } + + /** + * Set the target property: Execution target of the storage task assignment. + * + * @param target the target value to set. + * @return the StorageTaskAssignmentUpdateExecutionContext object itself. + */ + public StorageTaskAssignmentUpdateExecutionContext withTarget(ExecutionTarget target) { + this.target = target; + return this; + } + + /** + * Get the trigger property: Execution trigger of the storage task assignment. + * + * @return the trigger value. + */ + public ExecutionTriggerUpdate trigger() { + return this.trigger; + } + + /** + * Set the trigger property: Execution trigger of the storage task assignment. + * + * @param trigger the trigger value to set. + * @return the StorageTaskAssignmentUpdateExecutionContext object itself. + */ + public StorageTaskAssignmentUpdateExecutionContext withTrigger(ExecutionTriggerUpdate trigger) { + this.trigger = trigger; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (target() != null) { + target().validate(); + } + if (trigger() != null) { + trigger().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("target", this.target); + jsonWriter.writeJsonField("trigger", this.trigger); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageTaskAssignmentUpdateExecutionContext from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTaskAssignmentUpdateExecutionContext 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 StorageTaskAssignmentUpdateExecutionContext. + */ + public static StorageTaskAssignmentUpdateExecutionContext fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTaskAssignmentUpdateExecutionContext deserializedStorageTaskAssignmentUpdateExecutionContext + = new StorageTaskAssignmentUpdateExecutionContext(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("target".equals(fieldName)) { + deserializedStorageTaskAssignmentUpdateExecutionContext.target = ExecutionTarget.fromJson(reader); + } else if ("trigger".equals(fieldName)) { + deserializedStorageTaskAssignmentUpdateExecutionContext.trigger + = ExecutionTriggerUpdate.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTaskAssignmentUpdateExecutionContext; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentUpdateParameters.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentUpdateParameters.java new file mode 100644 index 0000000000000..e32dc0ab055f6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentUpdateParameters.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Parameters of the storage task assignment update request. + */ +@Fluent +public final class StorageTaskAssignmentUpdateParameters + implements JsonSerializable { + /* + * Properties of the storage task assignment. + */ + private StorageTaskAssignmentUpdateProperties properties; + + /** + * Creates an instance of StorageTaskAssignmentUpdateParameters class. + */ + public StorageTaskAssignmentUpdateParameters() { + } + + /** + * Get the properties property: Properties of the storage task assignment. + * + * @return the properties value. + */ + public StorageTaskAssignmentUpdateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the storage task assignment. + * + * @param properties the properties value to set. + * @return the StorageTaskAssignmentUpdateParameters object itself. + */ + public StorageTaskAssignmentUpdateParameters withProperties(StorageTaskAssignmentUpdateProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageTaskAssignmentUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTaskAssignmentUpdateParameters 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 StorageTaskAssignmentUpdateParameters. + */ + public static StorageTaskAssignmentUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTaskAssignmentUpdateParameters deserializedStorageTaskAssignmentUpdateParameters + = new StorageTaskAssignmentUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedStorageTaskAssignmentUpdateParameters.properties + = StorageTaskAssignmentUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTaskAssignmentUpdateParameters; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentUpdateProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentUpdateProperties.java new file mode 100644 index 0000000000000..dcacc102ef42a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentUpdateProperties.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Properties of the storage task update assignment. + */ +@Fluent +public final class StorageTaskAssignmentUpdateProperties + implements JsonSerializable { + /* + * Id of the corresponding storage task + */ + private String taskId; + + /* + * Whether the storage task assignment is enabled or not + */ + private Boolean enabled; + + /* + * Text that describes the purpose of the storage task assignment + */ + private String description; + + /* + * The storage task assignment execution context + */ + private StorageTaskAssignmentUpdateExecutionContext executionContext; + + /* + * The storage task assignment report + */ + private StorageTaskAssignmentUpdateReport report; + + /* + * Represents the provisioning state of the storage task assignment. + */ + private ProvisioningState provisioningState; + + /* + * Run status of storage task assignment + */ + private StorageTaskReportProperties runStatus; + + /** + * Creates an instance of StorageTaskAssignmentUpdateProperties class. + */ + public StorageTaskAssignmentUpdateProperties() { + } + + /** + * Get the taskId property: Id of the corresponding storage task. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Get the enabled property: Whether the storage task assignment is enabled or not. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether the storage task assignment is enabled or not. + * + * @param enabled the enabled value to set. + * @return the StorageTaskAssignmentUpdateProperties object itself. + */ + public StorageTaskAssignmentUpdateProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the description property: Text that describes the purpose of the storage task assignment. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Text that describes the purpose of the storage task assignment. + * + * @param description the description value to set. + * @return the StorageTaskAssignmentUpdateProperties object itself. + */ + public StorageTaskAssignmentUpdateProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the executionContext property: The storage task assignment execution context. + * + * @return the executionContext value. + */ + public StorageTaskAssignmentUpdateExecutionContext executionContext() { + return this.executionContext; + } + + /** + * Set the executionContext property: The storage task assignment execution context. + * + * @param executionContext the executionContext value to set. + * @return the StorageTaskAssignmentUpdateProperties object itself. + */ + public StorageTaskAssignmentUpdateProperties + withExecutionContext(StorageTaskAssignmentUpdateExecutionContext executionContext) { + this.executionContext = executionContext; + return this; + } + + /** + * Get the report property: The storage task assignment report. + * + * @return the report value. + */ + public StorageTaskAssignmentUpdateReport report() { + return this.report; + } + + /** + * Set the report property: The storage task assignment report. + * + * @param report the report value to set. + * @return the StorageTaskAssignmentUpdateProperties object itself. + */ + public StorageTaskAssignmentUpdateProperties withReport(StorageTaskAssignmentUpdateReport report) { + this.report = report; + return this; + } + + /** + * Get the provisioningState property: Represents the provisioning state of the storage task assignment. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the runStatus property: Run status of storage task assignment. + * + * @return the runStatus value. + */ + public StorageTaskReportProperties runStatus() { + return this.runStatus; + } + + /** + * Set the runStatus property: Run status of storage task assignment. + * + * @param runStatus the runStatus value to set. + * @return the StorageTaskAssignmentUpdateProperties object itself. + */ + public StorageTaskAssignmentUpdateProperties withRunStatus(StorageTaskReportProperties runStatus) { + this.runStatus = runStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (executionContext() != null) { + executionContext().validate(); + } + if (report() != null) { + report().validate(); + } + if (runStatus() != null) { + runStatus().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("executionContext", this.executionContext); + jsonWriter.writeJsonField("report", this.report); + jsonWriter.writeJsonField("runStatus", this.runStatus); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageTaskAssignmentUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTaskAssignmentUpdateProperties 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 StorageTaskAssignmentUpdateProperties. + */ + public static StorageTaskAssignmentUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTaskAssignmentUpdateProperties deserializedStorageTaskAssignmentUpdateProperties + = new StorageTaskAssignmentUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("taskId".equals(fieldName)) { + deserializedStorageTaskAssignmentUpdateProperties.taskId = reader.getString(); + } else if ("enabled".equals(fieldName)) { + deserializedStorageTaskAssignmentUpdateProperties.enabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("description".equals(fieldName)) { + deserializedStorageTaskAssignmentUpdateProperties.description = reader.getString(); + } else if ("executionContext".equals(fieldName)) { + deserializedStorageTaskAssignmentUpdateProperties.executionContext + = StorageTaskAssignmentUpdateExecutionContext.fromJson(reader); + } else if ("report".equals(fieldName)) { + deserializedStorageTaskAssignmentUpdateProperties.report + = StorageTaskAssignmentUpdateReport.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedStorageTaskAssignmentUpdateProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("runStatus".equals(fieldName)) { + deserializedStorageTaskAssignmentUpdateProperties.runStatus + = StorageTaskReportProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTaskAssignmentUpdateProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentUpdateReport.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentUpdateReport.java new file mode 100644 index 0000000000000..1f01ae0935d0f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentUpdateReport.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 storage task assignment report. + */ +@Fluent +public final class StorageTaskAssignmentUpdateReport implements JsonSerializable { + /* + * The prefix of the storage task assignment report + */ + private String prefix; + + /** + * Creates an instance of StorageTaskAssignmentUpdateReport class. + */ + public StorageTaskAssignmentUpdateReport() { + } + + /** + * Get the prefix property: The prefix of the storage task assignment report. + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: The prefix of the storage task assignment report. + * + * @param prefix the prefix value to set. + * @return the StorageTaskAssignmentUpdateReport object itself. + */ + public StorageTaskAssignmentUpdateReport withPrefix(String prefix) { + this.prefix = prefix; + 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("prefix", this.prefix); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageTaskAssignmentUpdateReport from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTaskAssignmentUpdateReport 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 StorageTaskAssignmentUpdateReport. + */ + public static StorageTaskAssignmentUpdateReport fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTaskAssignmentUpdateReport deserializedStorageTaskAssignmentUpdateReport + = new StorageTaskAssignmentUpdateReport(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("prefix".equals(fieldName)) { + deserializedStorageTaskAssignmentUpdateReport.prefix = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTaskAssignmentUpdateReport; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignments.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignments.java new file mode 100644 index 0000000000000..18fe341dc595c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignments.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 StorageTaskAssignments. + */ +public interface StorageTaskAssignments { + /** + * Get the storage task assignment properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @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 storage task assignment properties along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String accountName, + String storageTaskAssignmentName, Context context); + + /** + * Get the storage task assignment properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 storage task assignment properties. + */ + StorageTaskAssignment get(String resourceGroupName, String accountName, String storageTaskAssignmentName); + + /** + * Delete the storage task assignment sub-resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String storageTaskAssignmentName); + + /** + * Delete the storage task assignment sub-resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param storageTaskAssignmentName The name of the storage task assignment within the specified resource group. + * Storage task assignment names must be between 3 and 24 characters in length and use numbers and lower-case + * letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String storageTaskAssignmentName, Context context); + + /** + * List all the storage task assignments in an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of storage task assignments for the storage account as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List all the storage task assignments in an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the + * list response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of storage task assignments for the storage account as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, Integer maxpagesize, + Context context); + + /** + * Get the storage task assignment properties. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage task assignment properties along with {@link Response}. + */ + StorageTaskAssignment getById(String id); + + /** + * Get the storage task assignment properties. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage task assignment properties along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the storage task assignment sub-resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete the storage task assignment sub-resource. + * + * @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 StorageTaskAssignment resource. + * + * @param name resource name. + * @return the first stage of the new StorageTaskAssignment definition. + */ + StorageTaskAssignment.DefinitionStages.Blank define(String name); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentsInstancesReports.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentsInstancesReports.java new file mode 100644 index 0000000000000..69353f02f3c27 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentsInstancesReports.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of StorageTaskAssignmentsInstancesReports. + */ +public interface StorageTaskAssignmentsInstancesReports { + /** + * Fetch the report summary of all the storage task assignments and instances in an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Fetch the report summary of all the storage task assignments and instances in an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment instances to be included in + * the list response. + * @param filter Optional. When specified, it can be used to query using reporting properties. See [Constructing + * Filter + * Strings](https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings) + * for details. + * @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 fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, Integer maxpagesize, + String filter, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentsList.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentsList.java new file mode 100644 index 0000000000000..7781ac5550606 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskAssignmentsList.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.models.StorageTaskAssignmentInner; +import java.io.IOException; +import java.util.List; + +/** + * List of storage task assignments for the storage account. + */ +@Immutable +public final class StorageTaskAssignmentsList implements JsonSerializable { + /* + * Gets the list of storage task assignments and their properties. + */ + private List value; + + /* + * Request URL that can be used to query next page of storage task assignments. Returned when total number of + * requested storage task assignments exceed maximum page size. + */ + private String nextLink; + + /** + * Creates an instance of StorageTaskAssignmentsList class. + */ + public StorageTaskAssignmentsList() { + } + + /** + * Get the value property: Gets the list of storage task assignments and their properties. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Request URL that can be used to query next page of storage task assignments. Returned + * when total number of requested storage task assignments exceed maximum page size. + * + * @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) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageTaskAssignmentsList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTaskAssignmentsList 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 StorageTaskAssignmentsList. + */ + public static StorageTaskAssignmentsList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTaskAssignmentsList deserializedStorageTaskAssignmentsList = new StorageTaskAssignmentsList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> StorageTaskAssignmentInner.fromJson(reader1)); + deserializedStorageTaskAssignmentsList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedStorageTaskAssignmentsList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTaskAssignmentsList; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskReportInstance.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskReportInstance.java new file mode 100644 index 0000000000000..365674bcbb713 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskReportInstance.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.StorageTaskReportInstanceInner; + +/** + * An immutable client-side representation of StorageTaskReportInstance. + */ +public interface StorageTaskReportInstance { + /** + * 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 properties property: Storage task execution report for a run instance. + * + * @return the properties value. + */ + StorageTaskReportProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.StorageTaskReportInstanceInner object. + * + * @return the inner object. + */ + StorageTaskReportInstanceInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskReportProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskReportProperties.java new file mode 100644 index 0000000000000..1b6bcc68ca9ae --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskReportProperties.java @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Storage task execution report for a run instance. + */ +@Immutable +public final class StorageTaskReportProperties implements JsonSerializable { + /* + * Represents the Storage Task Assignment Id associated with the storage task that provided an execution context. + */ + private String taskAssignmentId; + + /* + * Represents the Storage Account Id where the storage task definition was applied and executed. + */ + private String storageAccountId; + + /* + * Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other + * comparison operators can be used as described for DateTime properties in + * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison- + * operators + */ + private String startTime; + + /* + * End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other + * comparison operators can be used as described for DateTime properties in + * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison- + * operators + */ + private String finishTime; + + /* + * Total number of objects that meet the condition as defined in the storage task assignment execution context. + * Filter options such as objectsTargetedCount gt 50 and other comparison operators can be used as described for + * Numerical properties in + * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison- + * operators + */ + private String objectsTargetedCount; + + /* + * Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as + * objectsOperatedOnCount ge 100 and other comparison operators can be used as described for Numerical properties in + * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison- + * operators + */ + private String objectsOperatedOnCount; + + /* + * Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount + * eq 0 and other comparison operators can be used as described for Numerical properties in + * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison- + * operators + */ + private String objectFailedCount; + + /* + * Total number of objects where task operation succeeded when was attempted.Filter options such as + * objectsSucceededCount gt 150 and other comparison operators can be used as described for Numerical properties in + * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison- + * operators + */ + private String objectsSucceededCount; + + /* + * Well known Azure Storage error code that represents the error encountered during execution of the run instance. + */ + private String runStatusError; + + /* + * Represents the status of the execution. + */ + private RunStatusEnum runStatusEnum; + + /* + * Full path to the verbose report stored in the reporting container as specified in the assignment execution + * context for the storage account. + */ + private String summaryReportPath; + + /* + * Storage Task Arm Id. + */ + private String taskId; + + /* + * Storage Task Version + */ + private String taskVersion; + + /* + * Represents the overall result of the execution for the run instance + */ + private RunResult runResult; + + /** + * Creates an instance of StorageTaskReportProperties class. + */ + public StorageTaskReportProperties() { + } + + /** + * Get the taskAssignmentId property: Represents the Storage Task Assignment Id associated with the storage task + * that provided an execution context. + * + * @return the taskAssignmentId value. + */ + public String taskAssignmentId() { + return this.taskAssignmentId; + } + + /** + * Get the storageAccountId property: Represents the Storage Account Id where the storage task definition was + * applied and executed. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Get the startTime property: Start time of the run instance. Filter options such as startTime gt + * '2023-06-26T20:51:24.4494016Z' and other comparison operators can be used as described for DateTime properties in + * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators. + * + * @return the startTime value. + */ + public String startTime() { + return this.startTime; + } + + /** + * Get the finishTime property: End time of the run instance. Filter options such as startTime gt + * '2023-06-26T20:51:24.4494016Z' and other comparison operators can be used as described for DateTime properties in + * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators. + * + * @return the finishTime value. + */ + public String finishTime() { + return this.finishTime; + } + + /** + * Get the objectsTargetedCount property: Total number of objects that meet the condition as defined in the storage + * task assignment execution context. Filter options such as objectsTargetedCount gt 50 and other comparison + * operators can be used as described for Numerical properties in + * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators. + * + * @return the objectsTargetedCount value. + */ + public String objectsTargetedCount() { + return this.objectsTargetedCount; + } + + /** + * Get the objectsOperatedOnCount property: Total number of objects that meet the storage tasks condition and were + * operated upon. Filter options such as objectsOperatedOnCount ge 100 and other comparison operators can be used as + * described for Numerical properties in + * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators. + * + * @return the objectsOperatedOnCount value. + */ + public String objectsOperatedOnCount() { + return this.objectsOperatedOnCount; + } + + /** + * Get the objectFailedCount property: Total number of objects where task operation failed when was attempted. + * Filter options such as objectFailedCount eq 0 and other comparison operators can be used as described for + * Numerical properties in + * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators. + * + * @return the objectFailedCount value. + */ + public String objectFailedCount() { + return this.objectFailedCount; + } + + /** + * Get the objectsSucceededCount property: Total number of objects where task operation succeeded when was + * attempted.Filter options such as objectsSucceededCount gt 150 and other comparison operators can be used as + * described for Numerical properties in + * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators. + * + * @return the objectsSucceededCount value. + */ + public String objectsSucceededCount() { + return this.objectsSucceededCount; + } + + /** + * Get the runStatusError property: Well known Azure Storage error code that represents the error encountered during + * execution of the run instance. + * + * @return the runStatusError value. + */ + public String runStatusError() { + return this.runStatusError; + } + + /** + * Get the runStatusEnum property: Represents the status of the execution. + * + * @return the runStatusEnum value. + */ + public RunStatusEnum runStatusEnum() { + return this.runStatusEnum; + } + + /** + * Get the summaryReportPath property: Full path to the verbose report stored in the reporting container as + * specified in the assignment execution context for the storage account. + * + * @return the summaryReportPath value. + */ + public String summaryReportPath() { + return this.summaryReportPath; + } + + /** + * Get the taskId property: Storage Task Arm Id. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Get the taskVersion property: Storage Task Version. + * + * @return the taskVersion value. + */ + public String taskVersion() { + return this.taskVersion; + } + + /** + * Get the runResult property: Represents the overall result of the execution for the run instance. + * + * @return the runResult value. + */ + public RunResult runResult() { + return this.runResult; + } + + /** + * 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 StorageTaskReportProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTaskReportProperties 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 StorageTaskReportProperties. + */ + public static StorageTaskReportProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTaskReportProperties deserializedStorageTaskReportProperties = new StorageTaskReportProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("taskAssignmentId".equals(fieldName)) { + deserializedStorageTaskReportProperties.taskAssignmentId = reader.getString(); + } else if ("storageAccountId".equals(fieldName)) { + deserializedStorageTaskReportProperties.storageAccountId = reader.getString(); + } else if ("startTime".equals(fieldName)) { + deserializedStorageTaskReportProperties.startTime = reader.getString(); + } else if ("finishTime".equals(fieldName)) { + deserializedStorageTaskReportProperties.finishTime = reader.getString(); + } else if ("objectsTargetedCount".equals(fieldName)) { + deserializedStorageTaskReportProperties.objectsTargetedCount = reader.getString(); + } else if ("objectsOperatedOnCount".equals(fieldName)) { + deserializedStorageTaskReportProperties.objectsOperatedOnCount = reader.getString(); + } else if ("objectFailedCount".equals(fieldName)) { + deserializedStorageTaskReportProperties.objectFailedCount = reader.getString(); + } else if ("objectsSucceededCount".equals(fieldName)) { + deserializedStorageTaskReportProperties.objectsSucceededCount = reader.getString(); + } else if ("runStatusError".equals(fieldName)) { + deserializedStorageTaskReportProperties.runStatusError = reader.getString(); + } else if ("runStatusEnum".equals(fieldName)) { + deserializedStorageTaskReportProperties.runStatusEnum + = RunStatusEnum.fromString(reader.getString()); + } else if ("summaryReportPath".equals(fieldName)) { + deserializedStorageTaskReportProperties.summaryReportPath = reader.getString(); + } else if ("taskId".equals(fieldName)) { + deserializedStorageTaskReportProperties.taskId = reader.getString(); + } else if ("taskVersion".equals(fieldName)) { + deserializedStorageTaskReportProperties.taskVersion = reader.getString(); + } else if ("runResult".equals(fieldName)) { + deserializedStorageTaskReportProperties.runResult = RunResult.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTaskReportProperties; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskReportSummary.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskReportSummary.java new file mode 100644 index 0000000000000..b4e2308e8a25e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageTaskReportSummary.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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.storage.generated.fluent.models.StorageTaskReportInstanceInner; +import java.io.IOException; +import java.util.List; + +/** + * Fetch Storage Tasks Run Summary. + */ +@Immutable +public final class StorageTaskReportSummary implements JsonSerializable { + /* + * Gets storage tasks run result summary. + */ + private List value; + + /* + * Request URL that can be used to query next page of storage task run results summary. Returned when the number of + * run instances and summary reports exceed maximum page size. + */ + private String nextLink; + + /** + * Creates an instance of StorageTaskReportSummary class. + */ + public StorageTaskReportSummary() { + } + + /** + * Get the value property: Gets storage tasks run result summary. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Request URL that can be used to query next page of storage task run results summary. + * Returned when the number of run instances and summary reports exceed maximum page size. + * + * @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) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageTaskReportSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTaskReportSummary 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 StorageTaskReportSummary. + */ + public static StorageTaskReportSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTaskReportSummary deserializedStorageTaskReportSummary = new StorageTaskReportSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> StorageTaskReportInstanceInner.fromJson(reader1)); + deserializedStorageTaskReportSummary.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedStorageTaskReportSummary.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTaskReportSummary; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Table.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Table.java new file mode 100644 index 0000000000000..9e94b518a396b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Table.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.TableInner; +import java.util.List; + +/** + * An immutable client-side representation of Table. + */ +public interface Table { + /** + * 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 tableName property: Table name under the specified account. + * + * @return the tableName value. + */ + String tableName(); + + /** + * Gets the signedIdentifiers property: List of stored access policies specified on the table. + * + * @return the signedIdentifiers value. + */ + List signedIdentifiers(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.TableInner object. + * + * @return the inner object. + */ + TableInner innerModel(); + + /** + * The entirety of the Table definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The Table definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Table definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the Table definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the Table 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.WithSignedIdentifiers { + /** + * Executes the create request. + * + * @return the created resource. + */ + Table create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Table create(Context context); + } + + /** + * The stage of the Table definition allowing to specify signedIdentifiers. + */ + interface WithSignedIdentifiers { + /** + * Specifies the signedIdentifiers property: List of stored access policies specified on the table.. + * + * @param signedIdentifiers List of stored access policies specified on the table. + * @return the next definition stage. + */ + WithCreate withSignedIdentifiers(List signedIdentifiers); + } + } + + /** + * Begins update for the Table resource. + * + * @return the stage of resource update. + */ + Table.Update update(); + + /** + * The template for Table update. + */ + interface Update extends UpdateStages.WithSignedIdentifiers { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Table apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Table apply(Context context); + } + + /** + * The Table update stages. + */ + interface UpdateStages { + /** + * The stage of the Table update allowing to specify signedIdentifiers. + */ + interface WithSignedIdentifiers { + /** + * Specifies the signedIdentifiers property: List of stored access policies specified on the table.. + * + * @param signedIdentifiers List of stored access policies specified on the table. + * @return the next definition stage. + */ + Update withSignedIdentifiers(List signedIdentifiers); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Table refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Table refresh(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableAccessPolicy.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableAccessPolicy.java new file mode 100644 index 0000000000000..65519f9293e27 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableAccessPolicy.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +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.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Table Access Policy Properties Object. + */ +@Fluent +public final class TableAccessPolicy implements JsonSerializable { + /* + * Start time of the access policy + */ + private OffsetDateTime startTime; + + /* + * Expiry time of the access policy + */ + private OffsetDateTime expiryTime; + + /* + * Required. List of abbreviated permissions. Supported permission values include 'r','a','u','d' + */ + private String permission; + + /** + * Creates an instance of TableAccessPolicy class. + */ + public TableAccessPolicy() { + } + + /** + * Get the startTime property: Start time of the access policy. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Start time of the access policy. + * + * @param startTime the startTime value to set. + * @return the TableAccessPolicy object itself. + */ + public TableAccessPolicy withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the expiryTime property: Expiry time of the access policy. + * + * @return the expiryTime value. + */ + public OffsetDateTime expiryTime() { + return this.expiryTime; + } + + /** + * Set the expiryTime property: Expiry time of the access policy. + * + * @param expiryTime the expiryTime value to set. + * @return the TableAccessPolicy object itself. + */ + public TableAccessPolicy withExpiryTime(OffsetDateTime expiryTime) { + this.expiryTime = expiryTime; + return this; + } + + /** + * Get the permission property: Required. List of abbreviated permissions. Supported permission values include + * 'r','a','u','d'. + * + * @return the permission value. + */ + public String permission() { + return this.permission; + } + + /** + * Set the permission property: Required. List of abbreviated permissions. Supported permission values include + * 'r','a','u','d'. + * + * @param permission the permission value to set. + * @return the TableAccessPolicy object itself. + */ + public TableAccessPolicy withPermission(String permission) { + this.permission = permission; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (permission() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property permission in model TableAccessPolicy")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TableAccessPolicy.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("permission", this.permission); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + jsonWriter.writeStringField("expiryTime", + this.expiryTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiryTime)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TableAccessPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TableAccessPolicy 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 TableAccessPolicy. + */ + public static TableAccessPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TableAccessPolicy deserializedTableAccessPolicy = new TableAccessPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("permission".equals(fieldName)) { + deserializedTableAccessPolicy.permission = reader.getString(); + } else if ("startTime".equals(fieldName)) { + deserializedTableAccessPolicy.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("expiryTime".equals(fieldName)) { + deserializedTableAccessPolicy.expiryTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedTableAccessPolicy; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableServiceProperties.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableServiceProperties.java new file mode 100644 index 0000000000000..c4fa2650bd811 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableServiceProperties.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storage.generated.fluent.models.TableServicePropertiesInner; + +/** + * An immutable client-side representation of TableServiceProperties. + */ +public interface TableServiceProperties { + /** + * 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 cors property: Specifies CORS rules for the Table service. You can include up to five CorsRule elements + * in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and + * CORS will be disabled for the Table service. + * + * @return the cors value. + */ + CorsRules cors(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.TableServicePropertiesInner object. + * + * @return the inner object. + */ + TableServicePropertiesInner innerModel(); + + /** + * The entirety of the TableServiceProperties definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The TableServiceProperties definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the TableServiceProperties definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the TableServiceProperties definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account + * names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the next definition stage. + */ + WithCreate withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the TableServiceProperties 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.WithCors { + /** + * Executes the create request. + * + * @return the created resource. + */ + TableServiceProperties create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + TableServiceProperties create(Context context); + } + + /** + * The stage of the TableServiceProperties definition allowing to specify cors. + */ + interface WithCors { + /** + * Specifies the cors property: Specifies CORS rules for the Table service. You can include up to five + * CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS + * rules will be deleted, and CORS will be disabled for the Table service.. + * + * @param cors Specifies CORS rules for the Table service. You can include up to five CorsRule elements in + * the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, + * and CORS will be disabled for the Table service. + * @return the next definition stage. + */ + WithCreate withCors(CorsRules cors); + } + } + + /** + * Begins update for the TableServiceProperties resource. + * + * @return the stage of resource update. + */ + TableServiceProperties.Update update(); + + /** + * The template for TableServiceProperties update. + */ + interface Update extends UpdateStages.WithCors { + /** + * Executes the update request. + * + * @return the updated resource. + */ + TableServiceProperties apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + TableServiceProperties apply(Context context); + } + + /** + * The TableServiceProperties update stages. + */ + interface UpdateStages { + /** + * The stage of the TableServiceProperties update allowing to specify cors. + */ + interface WithCors { + /** + * Specifies the cors property: Specifies CORS rules for the Table service. You can include up to five + * CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS + * rules will be deleted, and CORS will be disabled for the Table service.. + * + * @param cors Specifies CORS rules for the Table service. You can include up to five CorsRule elements in + * the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, + * and CORS will be disabled for the Table service. + * @return the next definition stage. + */ + Update withCors(CorsRules cors); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + TableServiceProperties refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + TableServiceProperties refresh(Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableServices.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableServices.java new file mode 100644 index 0000000000000..0314c97944427 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableServices.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of TableServices. + */ +public interface TableServices { + /** + * List all table services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 body along with {@link Response}. + */ + Response listWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * List all table services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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. + */ + ListTableServices list(String resourceGroupName, String accountName); + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + Response getServicePropertiesWithResponse(String resourceGroupName, String accountName, + Context context); + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + */ + TableServiceProperties getServiceProperties(String resourceGroupName, String accountName); + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + TableServiceProperties getServicePropertiesById(String id); + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a storage account’s Table service, including properties for Storage Analytics and CORS + * (Cross-Origin Resource Sharing) rules along with {@link Response}. + */ + Response getServicePropertiesByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new TableServiceProperties resource. + * + * @return the first stage of the new TableServiceProperties definition. + */ + TableServiceProperties.DefinitionStages.Blank define(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableSignedIdentifier.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableSignedIdentifier.java new file mode 100644 index 0000000000000..486161b814e3c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableSignedIdentifier.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Object to set Table Access Policy. + */ +@Fluent +public final class TableSignedIdentifier implements JsonSerializable { + /* + * unique-64-character-value of the stored access policy. + */ + private String id; + + /* + * Access policy + */ + private TableAccessPolicy accessPolicy; + + /** + * Creates an instance of TableSignedIdentifier class. + */ + public TableSignedIdentifier() { + } + + /** + * Get the id property: unique-64-character-value of the stored access policy. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: unique-64-character-value of the stored access policy. + * + * @param id the id value to set. + * @return the TableSignedIdentifier object itself. + */ + public TableSignedIdentifier withId(String id) { + this.id = id; + return this; + } + + /** + * Get the accessPolicy property: Access policy. + * + * @return the accessPolicy value. + */ + public TableAccessPolicy accessPolicy() { + return this.accessPolicy; + } + + /** + * Set the accessPolicy property: Access policy. + * + * @param accessPolicy the accessPolicy value to set. + * @return the TableSignedIdentifier object itself. + */ + public TableSignedIdentifier withAccessPolicy(TableAccessPolicy accessPolicy) { + this.accessPolicy = accessPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property id in model TableSignedIdentifier")); + } + if (accessPolicy() != null) { + accessPolicy().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TableSignedIdentifier.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("accessPolicy", this.accessPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TableSignedIdentifier from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TableSignedIdentifier 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 TableSignedIdentifier. + */ + public static TableSignedIdentifier fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TableSignedIdentifier deserializedTableSignedIdentifier = new TableSignedIdentifier(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedTableSignedIdentifier.id = reader.getString(); + } else if ("accessPolicy".equals(fieldName)) { + deserializedTableSignedIdentifier.accessPolicy = TableAccessPolicy.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTableSignedIdentifier; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Tables.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Tables.java new file mode 100644 index 0000000000000..60fedfe1bae79 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Tables.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 Tables. + */ +public interface Tables { + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @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 table with the specified table name, under the specified account if it exists along with + * {@link Response}. + */ + Response
getWithResponse(String resourceGroupName, String accountName, String tableName, Context context); + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 table with the specified table name, under the specified account if it exists. + */ + Table get(String resourceGroupName, String accountName, String tableName); + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @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 Response}. + */ + Response deleteWithResponse(String resourceGroupName, String accountName, String tableName, Context context); + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The + * name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String tableName); + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 all the tables under the specified storage account as paginated response with + * {@link PagedIterable}. + */ + PagedIterable
list(String resourceGroupName, String accountName); + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names + * must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 all the tables under the specified storage account as paginated response with + * {@link PagedIterable}. + */ + PagedIterable
list(String resourceGroupName, String accountName, Context context); + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the table with the specified table name, under the specified account if it exists along with + * {@link Response}. + */ + Table getById(String id); + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the table with the specified table name, under the specified account if it exists along with + * {@link Response}. + */ + Response
getByIdWithResponse(String id, Context context); + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @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); + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Table resource. + * + * @param name resource name. + * @return the first stage of the new Table definition. + */ + Table.DefinitionStages.Blank define(String name); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TagFilter.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TagFilter.java new file mode 100644 index 0000000000000..c9472d7dceb7e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TagFilter.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Blob index tag based filtering for blob objects. + */ +@Fluent +public final class TagFilter implements JsonSerializable { + /* + * This is the filter tag name, it can have 1 - 128 characters + */ + private String name; + + /* + * This is the comparison operator which is used for object comparison and filtering. Only == (equality operator) is + * currently supported + */ + private String op; + + /* + * This is the filter tag value field used for tag based filtering, it can have 0 - 256 characters + */ + private String value; + + /** + * Creates an instance of TagFilter class. + */ + public TagFilter() { + } + + /** + * Get the name property: This is the filter tag name, it can have 1 - 128 characters. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: This is the filter tag name, it can have 1 - 128 characters. + * + * @param name the name value to set. + * @return the TagFilter object itself. + */ + public TagFilter withName(String name) { + this.name = name; + return this; + } + + /** + * Get the op property: This is the comparison operator which is used for object comparison and filtering. Only == + * (equality operator) is currently supported. + * + * @return the op value. + */ + public String op() { + return this.op; + } + + /** + * Set the op property: This is the comparison operator which is used for object comparison and filtering. Only == + * (equality operator) is currently supported. + * + * @param op the op value to set. + * @return the TagFilter object itself. + */ + public TagFilter withOp(String op) { + this.op = op; + return this; + } + + /** + * Get the value property: This is the filter tag value field used for tag based filtering, it can have 0 - 256 + * characters. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: This is the filter tag value field used for tag based filtering, it can have 0 - 256 + * characters. + * + * @param value the value value to set. + * @return the TagFilter object itself. + */ + public TagFilter withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model TagFilter")); + } + if (op() == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property op in model TagFilter")); + } + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model TagFilter")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TagFilter.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("op", this.op); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagFilter 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 TagFilter. + */ + public static TagFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagFilter deserializedTagFilter = new TagFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedTagFilter.name = reader.getString(); + } else if ("op".equals(fieldName)) { + deserializedTagFilter.op = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagFilter.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagFilter; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TagProperty.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TagProperty.java new file mode 100644 index 0000000000000..735f9eb4c3f16 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TagProperty.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +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.time.OffsetDateTime; + +/** + * A tag of the LegalHold of a blob container. + */ +@Immutable +public final class TagProperty implements JsonSerializable { + /* + * The tag value. + */ + private String tag; + + /* + * Returns the date and time the tag was added. + */ + private OffsetDateTime timestamp; + + /* + * Returns the Object ID of the user who added the tag. + */ + private String objectIdentifier; + + /* + * Returns the Tenant ID that issued the token for the user who added the tag. + */ + private String tenantId; + + /* + * Returns the User Principal Name of the user who added the tag. + */ + private String upn; + + /** + * Creates an instance of TagProperty class. + */ + public TagProperty() { + } + + /** + * Get the tag property: The tag value. + * + * @return the tag value. + */ + public String tag() { + return this.tag; + } + + /** + * Get the timestamp property: Returns the date and time the tag was added. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Get the objectIdentifier property: Returns the Object ID of the user who added the tag. + * + * @return the objectIdentifier value. + */ + public String objectIdentifier() { + return this.objectIdentifier; + } + + /** + * Get the tenantId property: Returns the Tenant ID that issued the token for the user who added the tag. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the upn property: Returns the User Principal Name of the user who added the tag. + * + * @return the upn value. + */ + public String upn() { + return this.upn; + } + + /** + * 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 TagProperty from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagProperty 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 TagProperty. + */ + public static TagProperty fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagProperty deserializedTagProperty = new TagProperty(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tag".equals(fieldName)) { + deserializedTagProperty.tag = reader.getString(); + } else if ("timestamp".equals(fieldName)) { + deserializedTagProperty.timestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("objectIdentifier".equals(fieldName)) { + deserializedTagProperty.objectIdentifier = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedTagProperty.tenantId = reader.getString(); + } else if ("upn".equals(fieldName)) { + deserializedTagProperty.upn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagProperty; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TriggerParameters.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TriggerParameters.java new file mode 100644 index 0000000000000..94649cf4c4d07 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TriggerParameters.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +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.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * The trigger parameters update for the storage task assignment execution. + */ +@Fluent +public final class TriggerParameters implements JsonSerializable { + /* + * When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; + * this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + */ + private OffsetDateTime startFrom; + + /* + * Run interval of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; + * this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + */ + private Integer interval; + + /* + * Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is + * 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + */ + private IntervalUnit intervalUnit; + + /* + * When to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this + * property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + */ + private OffsetDateTime endBy; + + /* + * When to start task execution. This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this + * property should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + */ + private OffsetDateTime startOn; + + /** + * Creates an instance of TriggerParameters class. + */ + public TriggerParameters() { + } + + /** + * Get the startFrom property: When to start task execution. This is a required field when + * ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when + * ExecutionTrigger.properties.type is 'RunOnce'. + * + * @return the startFrom value. + */ + public OffsetDateTime startFrom() { + return this.startFrom; + } + + /** + * Set the startFrom property: When to start task execution. This is a required field when + * ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when + * ExecutionTrigger.properties.type is 'RunOnce'. + * + * @param startFrom the startFrom value to set. + * @return the TriggerParameters object itself. + */ + public TriggerParameters withStartFrom(OffsetDateTime startFrom) { + this.startFrom = startFrom; + return this; + } + + /** + * Get the interval property: Run interval of task execution. This is a required field when + * ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when + * ExecutionTrigger.properties.type is 'RunOnce'. + * + * @return the interval value. + */ + public Integer interval() { + return this.interval; + } + + /** + * Set the interval property: Run interval of task execution. This is a required field when + * ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when + * ExecutionTrigger.properties.type is 'RunOnce'. + * + * @param interval the interval value to set. + * @return the TriggerParameters object itself. + */ + public TriggerParameters withInterval(Integer interval) { + this.interval = interval; + return this; + } + + /** + * Get the intervalUnit property: Run interval unit of task execution. This is a required field when + * ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when + * ExecutionTrigger.properties.type is 'RunOnce'. + * + * @return the intervalUnit value. + */ + public IntervalUnit intervalUnit() { + return this.intervalUnit; + } + + /** + * Set the intervalUnit property: Run interval unit of task execution. This is a required field when + * ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when + * ExecutionTrigger.properties.type is 'RunOnce'. + * + * @param intervalUnit the intervalUnit value to set. + * @return the TriggerParameters object itself. + */ + public TriggerParameters withIntervalUnit(IntervalUnit intervalUnit) { + this.intervalUnit = intervalUnit; + return this; + } + + /** + * Get the endBy property: When to end task execution. This is a required field when + * ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when + * ExecutionTrigger.properties.type is 'RunOnce'. + * + * @return the endBy value. + */ + public OffsetDateTime endBy() { + return this.endBy; + } + + /** + * Set the endBy property: When to end task execution. This is a required field when + * ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when + * ExecutionTrigger.properties.type is 'RunOnce'. + * + * @param endBy the endBy value to set. + * @return the TriggerParameters object itself. + */ + public TriggerParameters withEndBy(OffsetDateTime endBy) { + this.endBy = endBy; + return this; + } + + /** + * Get the startOn property: When to start task execution. This is an optional field when + * ExecutionTrigger.properties.type is 'RunOnce'; this property should not be present when + * ExecutionTrigger.properties.type is 'OnSchedule'. + * + * @return the startOn value. + */ + public OffsetDateTime startOn() { + return this.startOn; + } + + /** + * Set the startOn property: When to start task execution. This is an optional field when + * ExecutionTrigger.properties.type is 'RunOnce'; this property should not be present when + * ExecutionTrigger.properties.type is 'OnSchedule'. + * + * @param startOn the startOn value to set. + * @return the TriggerParameters object itself. + */ + public TriggerParameters withStartOn(OffsetDateTime startOn) { + this.startOn = startOn; + 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("startFrom", + this.startFrom == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startFrom)); + jsonWriter.writeNumberField("interval", this.interval); + jsonWriter.writeStringField("intervalUnit", this.intervalUnit == null ? null : this.intervalUnit.toString()); + jsonWriter.writeStringField("endBy", + this.endBy == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endBy)); + jsonWriter.writeStringField("startOn", + this.startOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startOn)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TriggerParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TriggerParameters 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 TriggerParameters. + */ + public static TriggerParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TriggerParameters deserializedTriggerParameters = new TriggerParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startFrom".equals(fieldName)) { + deserializedTriggerParameters.startFrom = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("interval".equals(fieldName)) { + deserializedTriggerParameters.interval = reader.getNullable(JsonReader::getInt); + } else if ("intervalUnit".equals(fieldName)) { + deserializedTriggerParameters.intervalUnit = IntervalUnit.fromString(reader.getString()); + } else if ("endBy".equals(fieldName)) { + deserializedTriggerParameters.endBy = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("startOn".equals(fieldName)) { + deserializedTriggerParameters.startOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedTriggerParameters; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TriggerParametersUpdate.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TriggerParametersUpdate.java new file mode 100644 index 0000000000000..f04d953c97cda --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TriggerParametersUpdate.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +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.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * The trigger parameters update for the storage task assignment execution. + */ +@Fluent +public final class TriggerParametersUpdate implements JsonSerializable { + /* + * When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this + * property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + */ + private OffsetDateTime startFrom; + + /* + * Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; + * this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + */ + private Integer interval; + + /* + * Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is + * 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + */ + private IntervalUnit intervalUnit; + + /* + * When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this + * property should not be present when ExecutionTrigger.properties.type is 'RunOnce' + */ + private OffsetDateTime endBy; + + /* + * When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this + * property should not be present when ExecutionTrigger.properties.type is 'OnSchedule' + */ + private OffsetDateTime startOn; + + /** + * Creates an instance of TriggerParametersUpdate class. + */ + public TriggerParametersUpdate() { + } + + /** + * Get the startFrom property: When to start task execution. This is a mutable field when + * ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when + * ExecutionTrigger.properties.type is 'RunOnce'. + * + * @return the startFrom value. + */ + public OffsetDateTime startFrom() { + return this.startFrom; + } + + /** + * Set the startFrom property: When to start task execution. This is a mutable field when + * ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when + * ExecutionTrigger.properties.type is 'RunOnce'. + * + * @param startFrom the startFrom value to set. + * @return the TriggerParametersUpdate object itself. + */ + public TriggerParametersUpdate withStartFrom(OffsetDateTime startFrom) { + this.startFrom = startFrom; + return this; + } + + /** + * Get the interval property: Run interval of task execution. This is a mutable field when + * ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when + * ExecutionTrigger.properties.type is 'RunOnce'. + * + * @return the interval value. + */ + public Integer interval() { + return this.interval; + } + + /** + * Set the interval property: Run interval of task execution. This is a mutable field when + * ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when + * ExecutionTrigger.properties.type is 'RunOnce'. + * + * @param interval the interval value to set. + * @return the TriggerParametersUpdate object itself. + */ + public TriggerParametersUpdate withInterval(Integer interval) { + this.interval = interval; + return this; + } + + /** + * Get the intervalUnit property: Run interval unit of task execution. This is a mutable field when + * ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when + * ExecutionTrigger.properties.type is 'RunOnce'. + * + * @return the intervalUnit value. + */ + public IntervalUnit intervalUnit() { + return this.intervalUnit; + } + + /** + * Set the intervalUnit property: Run interval unit of task execution. This is a mutable field when + * ExecutionTrigger.properties.type is 'OnSchedule'; this property should not be present when + * ExecutionTrigger.properties.type is 'RunOnce'. + * + * @param intervalUnit the intervalUnit value to set. + * @return the TriggerParametersUpdate object itself. + */ + public TriggerParametersUpdate withIntervalUnit(IntervalUnit intervalUnit) { + this.intervalUnit = intervalUnit; + return this; + } + + /** + * Get the endBy property: When to end task execution. This is a mutable field when ExecutionTrigger.properties.type + * is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'. + * + * @return the endBy value. + */ + public OffsetDateTime endBy() { + return this.endBy; + } + + /** + * Set the endBy property: When to end task execution. This is a mutable field when ExecutionTrigger.properties.type + * is 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'. + * + * @param endBy the endBy value to set. + * @return the TriggerParametersUpdate object itself. + */ + public TriggerParametersUpdate withEndBy(OffsetDateTime endBy) { + this.endBy = endBy; + return this; + } + + /** + * Get the startOn property: When to start task execution. This is a mutable field when + * ExecutionTrigger.properties.type is 'RunOnce'; this property should not be present when + * ExecutionTrigger.properties.type is 'OnSchedule'. + * + * @return the startOn value. + */ + public OffsetDateTime startOn() { + return this.startOn; + } + + /** + * Set the startOn property: When to start task execution. This is a mutable field when + * ExecutionTrigger.properties.type is 'RunOnce'; this property should not be present when + * ExecutionTrigger.properties.type is 'OnSchedule'. + * + * @param startOn the startOn value to set. + * @return the TriggerParametersUpdate object itself. + */ + public TriggerParametersUpdate withStartOn(OffsetDateTime startOn) { + this.startOn = startOn; + 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("startFrom", + this.startFrom == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startFrom)); + jsonWriter.writeNumberField("interval", this.interval); + jsonWriter.writeStringField("intervalUnit", this.intervalUnit == null ? null : this.intervalUnit.toString()); + jsonWriter.writeStringField("endBy", + this.endBy == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endBy)); + jsonWriter.writeStringField("startOn", + this.startOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startOn)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TriggerParametersUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TriggerParametersUpdate 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 TriggerParametersUpdate. + */ + public static TriggerParametersUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TriggerParametersUpdate deserializedTriggerParametersUpdate = new TriggerParametersUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startFrom".equals(fieldName)) { + deserializedTriggerParametersUpdate.startFrom = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("interval".equals(fieldName)) { + deserializedTriggerParametersUpdate.interval = reader.getNullable(JsonReader::getInt); + } else if ("intervalUnit".equals(fieldName)) { + deserializedTriggerParametersUpdate.intervalUnit = IntervalUnit.fromString(reader.getString()); + } else if ("endBy".equals(fieldName)) { + deserializedTriggerParametersUpdate.endBy = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("startOn".equals(fieldName)) { + deserializedTriggerParametersUpdate.startOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedTriggerParametersUpdate; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TriggerType.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TriggerType.java new file mode 100644 index 0000000000000..f0b1799bba402 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TriggerType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +/** + * The trigger type of the storage task assignment execution. + */ +public enum TriggerType { + /** + * Enum value RunOnce. + */ + RUN_ONCE("RunOnce"), + + /** + * Enum value OnSchedule. + */ + ON_SCHEDULE("OnSchedule"); + + /** + * The actual serialized value for a TriggerType instance. + */ + private final String value; + + TriggerType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a TriggerType instance. + * + * @param value the serialized value to parse. + * @return the parsed TriggerType object, or null if unable to parse. + */ + public static TriggerType fromString(String value) { + if (value == null) { + return null; + } + TriggerType[] items = TriggerType.values(); + for (TriggerType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UpdateHistoryProperty.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UpdateHistoryProperty.java new file mode 100644 index 0000000000000..bef1221ff8bda --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UpdateHistoryProperty.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +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.time.OffsetDateTime; + +/** + * An update history of the ImmutabilityPolicy of a blob container. + */ +@Fluent +public final class UpdateHistoryProperty implements JsonSerializable { + /* + * The ImmutabilityPolicy update type of a blob container, possible values include: put, lock and extend. + */ + private ImmutabilityPolicyUpdateType update; + + /* + * The immutability period for the blobs in the container since the policy creation, in days. + */ + private Integer immutabilityPeriodSinceCreationInDays; + + /* + * Returns the date and time the ImmutabilityPolicy was updated. + */ + private OffsetDateTime timestamp; + + /* + * Returns the Object ID of the user who updated the ImmutabilityPolicy. + */ + private String objectIdentifier; + + /* + * Returns the Tenant ID that issued the token for the user who updated the ImmutabilityPolicy. + */ + private String tenantId; + + /* + * Returns the User Principal Name of the user who updated the ImmutabilityPolicy. + */ + private String upn; + + /* + * This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be + * written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added + * and any existing blocks cannot be modified or deleted. This property cannot be changed with + * ExtendImmutabilityPolicy API. + */ + private Boolean allowProtectedAppendWrites; + + /* + * This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be + * written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks + * can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with + * ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are + * mutually exclusive. + */ + private Boolean allowProtectedAppendWritesAll; + + /** + * Creates an instance of UpdateHistoryProperty class. + */ + public UpdateHistoryProperty() { + } + + /** + * Get the update property: The ImmutabilityPolicy update type of a blob container, possible values include: put, + * lock and extend. + * + * @return the update value. + */ + public ImmutabilityPolicyUpdateType update() { + return this.update; + } + + /** + * Get the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container + * since the policy creation, in days. + * + * @return the immutabilityPeriodSinceCreationInDays value. + */ + public Integer immutabilityPeriodSinceCreationInDays() { + return this.immutabilityPeriodSinceCreationInDays; + } + + /** + * Get the timestamp property: Returns the date and time the ImmutabilityPolicy was updated. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Get the objectIdentifier property: Returns the Object ID of the user who updated the ImmutabilityPolicy. + * + * @return the objectIdentifier value. + */ + public String objectIdentifier() { + return this.objectIdentifier; + } + + /** + * Get the tenantId property: Returns the Tenant ID that issued the token for the user who updated the + * ImmutabilityPolicy. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the upn property: Returns the User Principal Name of the user who updated the ImmutabilityPolicy. + * + * @return the upn value. + */ + public String upn() { + return this.upn; + } + + /** + * Get the allowProtectedAppendWrites property: This property can only be changed for unlocked time-based retention + * policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and + * compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property + * cannot be changed with ExtendImmutabilityPolicy API. + * + * @return the allowProtectedAppendWrites value. + */ + public Boolean allowProtectedAppendWrites() { + return this.allowProtectedAppendWrites; + } + + /** + * Set the allowProtectedAppendWrites property: This property can only be changed for unlocked time-based retention + * policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and + * compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property + * cannot be changed with ExtendImmutabilityPolicy API. + * + * @param allowProtectedAppendWrites the allowProtectedAppendWrites value to set. + * @return the UpdateHistoryProperty object itself. + */ + public UpdateHistoryProperty withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites) { + this.allowProtectedAppendWrites = allowProtectedAppendWrites; + return this; + } + + /** + * Get the allowProtectedAppendWritesAll property: This property can only be changed for unlocked time-based + * retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining + * immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified + * or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' + * and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + * + * @return the allowProtectedAppendWritesAll value. + */ + public Boolean allowProtectedAppendWritesAll() { + return this.allowProtectedAppendWritesAll; + } + + /** + * Set the allowProtectedAppendWritesAll property: This property can only be changed for unlocked time-based + * retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining + * immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified + * or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' + * and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + * + * @param allowProtectedAppendWritesAll the allowProtectedAppendWritesAll value to set. + * @return the UpdateHistoryProperty object itself. + */ + public UpdateHistoryProperty withAllowProtectedAppendWritesAll(Boolean allowProtectedAppendWritesAll) { + this.allowProtectedAppendWritesAll = allowProtectedAppendWritesAll; + 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.writeBooleanField("allowProtectedAppendWrites", this.allowProtectedAppendWrites); + jsonWriter.writeBooleanField("allowProtectedAppendWritesAll", this.allowProtectedAppendWritesAll); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateHistoryProperty from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateHistoryProperty 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 UpdateHistoryProperty. + */ + public static UpdateHistoryProperty fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateHistoryProperty deserializedUpdateHistoryProperty = new UpdateHistoryProperty(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("update".equals(fieldName)) { + deserializedUpdateHistoryProperty.update + = ImmutabilityPolicyUpdateType.fromString(reader.getString()); + } else if ("immutabilityPeriodSinceCreationInDays".equals(fieldName)) { + deserializedUpdateHistoryProperty.immutabilityPeriodSinceCreationInDays + = reader.getNullable(JsonReader::getInt); + } else if ("timestamp".equals(fieldName)) { + deserializedUpdateHistoryProperty.timestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("objectIdentifier".equals(fieldName)) { + deserializedUpdateHistoryProperty.objectIdentifier = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedUpdateHistoryProperty.tenantId = reader.getString(); + } else if ("upn".equals(fieldName)) { + deserializedUpdateHistoryProperty.upn = reader.getString(); + } else if ("allowProtectedAppendWrites".equals(fieldName)) { + deserializedUpdateHistoryProperty.allowProtectedAppendWrites + = reader.getNullable(JsonReader::getBoolean); + } else if ("allowProtectedAppendWritesAll".equals(fieldName)) { + deserializedUpdateHistoryProperty.allowProtectedAppendWritesAll + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateHistoryProperty; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Usage.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Usage.java new file mode 100644 index 0000000000000..4e456749ca4a9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Usage.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.UsageInner; + +/** + * An immutable client-side representation of Usage. + */ +public interface Usage { + /** + * Gets the unit property: Gets the unit of measurement. + * + * @return the unit value. + */ + UsageUnit unit(); + + /** + * Gets the currentValue property: Gets the current count of the allocated resources in the subscription. + * + * @return the currentValue value. + */ + Integer currentValue(); + + /** + * Gets the limit property: Gets the maximum count of the resources that can be allocated in the subscription. + * + * @return the limit value. + */ + Integer limit(); + + /** + * Gets the name property: Gets the name of the type of usage. + * + * @return the name value. + */ + UsageName name(); + + /** + * Gets the inner com.azure.resourcemanager.storage.generated.fluent.models.UsageInner object. + * + * @return the inner object. + */ + UsageInner innerModel(); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UsageListResult.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UsageListResult.java new file mode 100644 index 0000000000000..d635e3dbcfa28 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UsageListResult.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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 com.azure.resourcemanager.storage.generated.fluent.models.UsageInner; +import java.io.IOException; +import java.util.List; + +/** + * The response from the List Usages operation. + */ +@Fluent +public final class UsageListResult implements JsonSerializable { + /* + * Gets or sets the list of Storage Resource Usages. + */ + private List value; + + /** + * Creates an instance of UsageListResult class. + */ + public UsageListResult() { + } + + /** + * Get the value property: Gets or sets the list of Storage Resource Usages. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets the list of Storage Resource Usages. + * + * @param value the value value to set. + * @return the UsageListResult object itself. + */ + public UsageListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UsageListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UsageListResult 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 UsageListResult. + */ + public static UsageListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UsageListResult deserializedUsageListResult = new UsageListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> UsageInner.fromJson(reader1)); + deserializedUsageListResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedUsageListResult; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UsageName.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UsageName.java new file mode 100644 index 0000000000000..e8be229dddacd --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UsageName.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * The usage names that can be used; currently limited to StorageAccount. + */ +@Immutable +public final class UsageName implements JsonSerializable { + /* + * Gets a string describing the resource name. + */ + private String value; + + /* + * Gets a localized string describing the resource name. + */ + private String localizedValue; + + /** + * Creates an instance of UsageName class. + */ + public UsageName() { + } + + /** + * Get the value property: Gets a string describing the resource name. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Get the localizedValue property: Gets a localized string describing the resource name. + * + * @return the localizedValue value. + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * 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 UsageName from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UsageName 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 UsageName. + */ + public static UsageName fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UsageName deserializedUsageName = new UsageName(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedUsageName.value = reader.getString(); + } else if ("localizedValue".equals(fieldName)) { + deserializedUsageName.localizedValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUsageName; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UsageUnit.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UsageUnit.java new file mode 100644 index 0000000000000..fd7a05ef9afdf --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UsageUnit.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +/** + * Gets the unit of measurement. + */ +public enum UsageUnit { + /** + * Enum value Count. + */ + COUNT("Count"), + + /** + * Enum value Bytes. + */ + BYTES("Bytes"), + + /** + * Enum value Seconds. + */ + SECONDS("Seconds"), + + /** + * Enum value Percent. + */ + PERCENT("Percent"), + + /** + * Enum value CountsPerSecond. + */ + COUNTS_PER_SECOND("CountsPerSecond"), + + /** + * Enum value BytesPerSecond. + */ + BYTES_PER_SECOND("BytesPerSecond"); + + /** + * The actual serialized value for a UsageUnit instance. + */ + private final String value; + + UsageUnit(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a UsageUnit instance. + * + * @param value the serialized value to parse. + * @return the parsed UsageUnit object, or null if unable to parse. + */ + public static UsageUnit fromString(String value) { + if (value == null) { + return null; + } + UsageUnit[] items = UsageUnit.values(); + for (UsageUnit item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Usages.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Usages.java new file mode 100644 index 0000000000000..c1983aad0ca1b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Usages.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of Usages. + */ +public interface Usages { + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage 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 current usage count and the limit for the resources of the location under the subscription as + * paginated response with {@link PagedIterable}. + */ + PagedIterable listByLocation(String location); + + /** + * Gets the current usage count and the limit for the resources of the location under the subscription. + * + * @param location The location of the Azure Storage 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 current usage count and the limit for the resources of the location under the subscription as + * paginated response with {@link PagedIterable}. + */ + PagedIterable listByLocation(String location, Context context); +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UserAssignedIdentity.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UserAssignedIdentity.java new file mode 100644 index 0000000000000..dc7229ef69a71 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UserAssignedIdentity.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * UserAssignedIdentity for the resource. + */ +@Immutable +public final class UserAssignedIdentity implements JsonSerializable { + /* + * The principal ID of the identity. + */ + private String principalId; + + /* + * The client ID of the identity. + */ + private String clientId; + + /** + * Creates an instance of UserAssignedIdentity class. + */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * 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 ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/VirtualNetworkRule.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/VirtualNetworkRule.java new file mode 100644 index 0000000000000..ba7c660ebbb20 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/VirtualNetworkRule.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.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; + +/** + * Virtual Network rule. + */ +@Fluent +public final class VirtualNetworkRule implements JsonSerializable { + /* + * Resource ID of a subnet, for example: + * /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName} + * /subnets/{subnetName}. + */ + private String virtualNetworkResourceId; + + /* + * The action of virtual network rule. + */ + private Action action; + + /* + * Gets the state of virtual network rule. + */ + private State state; + + /** + * Creates an instance of VirtualNetworkRule class. + */ + public VirtualNetworkRule() { + } + + /** + * Get the virtualNetworkResourceId property: Resource ID of a subnet, for example: + * /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + * + * @return the virtualNetworkResourceId value. + */ + public String virtualNetworkResourceId() { + return this.virtualNetworkResourceId; + } + + /** + * Set the virtualNetworkResourceId property: Resource ID of a subnet, for example: + * /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + * + * @param virtualNetworkResourceId the virtualNetworkResourceId value to set. + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withVirtualNetworkResourceId(String virtualNetworkResourceId) { + this.virtualNetworkResourceId = virtualNetworkResourceId; + return this; + } + + /** + * Get the action property: The action of virtual network rule. + * + * @return the action value. + */ + public Action action() { + return this.action; + } + + /** + * Set the action property: The action of virtual network rule. + * + * @param action the action value to set. + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withAction(Action action) { + this.action = action; + return this; + } + + /** + * Get the state property: Gets the state of virtual network rule. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Set the state property: Gets the state of virtual network rule. + * + * @param state the state value to set. + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withState(State state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualNetworkResourceId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property virtualNetworkResourceId in model VirtualNetworkRule")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualNetworkRule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.virtualNetworkResourceId); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkRule 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 VirtualNetworkRule. + */ + public static VirtualNetworkRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkRule deserializedVirtualNetworkRule = new VirtualNetworkRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVirtualNetworkRule.virtualNetworkResourceId = reader.getString(); + } else if ("action".equals(fieldName)) { + deserializedVirtualNetworkRule.action = Action.fromString(reader.getString()); + } else if ("state".equals(fieldName)) { + deserializedVirtualNetworkRule.state = State.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkRule; + }); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/package-info.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/package-info.java new file mode 100644 index 0000000000000..1c48829ae1f98 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the data models for StorageManagementClient. + * The Azure Storage Management API. + */ +package com.azure.resourcemanager.storage.generated.models; diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/package-info.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/package-info.java new file mode 100644 index 0000000000000..50ee063b06f01 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for StorageManagementClient. + * The Azure Storage Management API. + */ +package com.azure.resourcemanager.storage.generated; diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/module-info.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/module-info.java new file mode 100644 index 0000000000000..ba0ffb4a54c7b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/module-info.java @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.storage.generated { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.storage.generated; + exports com.azure.resourcemanager.storage.generated.fluent; + exports com.azure.resourcemanager.storage.generated.fluent.models; + exports com.azure.resourcemanager.storage.generated.models; + + opens com.azure.resourcemanager.storage.generated.fluent.models to com.azure.core; + opens com.azure.resourcemanager.storage.generated.models to com.azure.core; +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storage-generated/proxy-config.json b/sdk/storage/azure-resourcemanager-storage-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storage-generated/proxy-config.json new file mode 100644 index 0000000000000..976b6e56dd9b6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storage-generated/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.storage.generated.implementation.BlobContainersClientImpl$BlobContainersService"],["com.azure.resourcemanager.storage.generated.implementation.BlobInventoryPoliciesClientImpl$BlobInventoryPoliciesService"],["com.azure.resourcemanager.storage.generated.implementation.BlobServicesClientImpl$BlobServicesService"],["com.azure.resourcemanager.storage.generated.implementation.DeletedAccountsClientImpl$DeletedAccountsService"],["com.azure.resourcemanager.storage.generated.implementation.EncryptionScopesClientImpl$EncryptionScopesService"],["com.azure.resourcemanager.storage.generated.implementation.FileServicesClientImpl$FileServicesService"],["com.azure.resourcemanager.storage.generated.implementation.FileSharesClientImpl$FileSharesService"],["com.azure.resourcemanager.storage.generated.implementation.LocalUsersOperationsClientImpl$LocalUsersOperationsService"],["com.azure.resourcemanager.storage.generated.implementation.ManagementPoliciesClientImpl$ManagementPoliciesService"],["com.azure.resourcemanager.storage.generated.implementation.NetworkSecurityPerimeterConfigurationsClientImpl$NetworkSecurityPerimeterConfigurationsService"],["com.azure.resourcemanager.storage.generated.implementation.ObjectReplicationPoliciesOperationsClientImpl$ObjectReplicationPoliciesOperationsService"],["com.azure.resourcemanager.storage.generated.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.storage.generated.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.storage.generated.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.storage.generated.implementation.QueueServicesClientImpl$QueueServicesService"],["com.azure.resourcemanager.storage.generated.implementation.QueuesClientImpl$QueuesService"],["com.azure.resourcemanager.storage.generated.implementation.SkusClientImpl$SkusService"],["com.azure.resourcemanager.storage.generated.implementation.StorageAccountsClientImpl$StorageAccountsService"],["com.azure.resourcemanager.storage.generated.implementation.StorageTaskAssignmentInstancesReportsClientImpl$StorageTaskAssignmentInstancesReportsService"],["com.azure.resourcemanager.storage.generated.implementation.StorageTaskAssignmentsClientImpl$StorageTaskAssignmentsService"],["com.azure.resourcemanager.storage.generated.implementation.StorageTaskAssignmentsInstancesReportsClientImpl$StorageTaskAssignmentsInstancesReportsService"],["com.azure.resourcemanager.storage.generated.implementation.TableServicesClientImpl$TableServicesService"],["com.azure.resourcemanager.storage.generated.implementation.TablesClientImpl$TablesService"],["com.azure.resourcemanager.storage.generated.implementation.UsagesClientImpl$UsagesService"]] \ No newline at end of file diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storage-generated/reflect-config.json b/sdk/storage/azure-resourcemanager-storage-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storage-generated/reflect-config.json new file mode 100644 index 0000000000000..0637a088a01e8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storage-generated/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersClearLegalHoldSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersClearLegalHoldSamples.java new file mode 100644 index 0000000000000..e89b8fb01ca50 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersClearLegalHoldSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.fluent.models.LegalHoldInner; +import java.util.Arrays; + +/** + * Samples for BlobContainers ClearLegalHold. + */ +public final class BlobContainersClearLegalHoldSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/BlobContainersClearLegalHold. + * json + */ + /** + * Sample code: ClearLegalHoldContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void clearLegalHoldContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .clearLegalHoldWithResponse("res4303", "sto7280", "container8723", + new LegalHoldInner().withTags(Arrays.asList("tag1", "tag2", "tag3")), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersCreateOrUpdateImmutabilityPolicySamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersCreateOrUpdateImmutabilityPolicySamples.java new file mode 100644 index 0000000000000..bf473a51f0829 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersCreateOrUpdateImmutabilityPolicySamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for BlobContainers CreateOrUpdateImmutabilityPolicy. + */ +public final class BlobContainersCreateOrUpdateImmutabilityPolicySamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * BlobContainersPutImmutabilityPolicy.json + */ + /** + * Sample code: CreateOrUpdateImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void + createOrUpdateImmutabilityPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .defineImmutabilityPolicy() + .withExistingContainer("res1782", "sto7069", "container6397") + .withImmutabilityPeriodSinceCreationInDays(3) + .withAllowProtectedAppendWrites(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * BlobContainersPutImmutabilityPolicyAllowProtectedAppendWritesAll.json + */ + /** + * Sample code: CreateOrUpdateImmutabilityPolicyWithAllowProtectedAppendWritesAll. + * + * @param manager Entry point to StorageManager. + */ + public static void createOrUpdateImmutabilityPolicyWithAllowProtectedAppendWritesAll( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .defineImmutabilityPolicy() + .withExistingContainer("res1782", "sto7069", "container6397") + .withImmutabilityPeriodSinceCreationInDays(3) + .withAllowProtectedAppendWritesAll(true) + .create(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersCreateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersCreateSamples.java new file mode 100644 index 0000000000000..2dfa2e5984335 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersCreateSamples.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageWithVersioning; + +/** + * Samples for BlobContainers Create. + */ +public final class BlobContainersCreateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * BlobContainersPutDefaultEncryptionScope.json + */ + /** + * Sample code: PutContainerWithDefaultEncryptionScope. + * + * @param manager Entry point to StorageManager. + */ + public static void + putContainerWithDefaultEncryptionScope(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .define("container6185") + .withExistingStorageAccount("res3376", "sto328") + .withDefaultEncryptionScope("encryptionscope185") + .withDenyEncryptionScopeOverride(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * BlobContainersPutObjectLevelWorm.json + */ + /** + * Sample code: PutContainerWithObjectLevelWorm. + * + * @param manager Entry point to StorageManager. + */ + public static void + putContainerWithObjectLevelWorm(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .define("container6185") + .withExistingStorageAccount("res3376", "sto328") + .withImmutableStorageWithVersioning(new ImmutableStorageWithVersioning().withEnabled(true)) + .create(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/BlobContainersPut.json + */ + /** + * Sample code: PutContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void putContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers().define("container6185").withExistingStorageAccount("res3376", "sto328").create(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersDeleteImmutabilityPolicySamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersDeleteImmutabilityPolicySamples.java new file mode 100644 index 0000000000000..d206a30888dcf --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersDeleteImmutabilityPolicySamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for BlobContainers DeleteImmutabilityPolicy. + */ +public final class BlobContainersDeleteImmutabilityPolicySamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * BlobContainersDeleteImmutabilityPolicy.json + */ + /** + * Sample code: DeleteImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void deleteImmutabilityPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .deleteImmutabilityPolicyWithResponse("res1581", "sto9621", "container4910", "8d59f81a7fa7be0", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersDeleteSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersDeleteSamples.java new file mode 100644 index 0000000000000..df8607c4046f0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for BlobContainers Delete. + */ +public final class BlobContainersDeleteSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/BlobContainersDelete.json + */ + /** + * Sample code: DeleteContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void deleteContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .deleteWithResponse("res4079", "sto4506", "container9689", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersExtendImmutabilityPolicySamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersExtendImmutabilityPolicySamples.java new file mode 100644 index 0000000000000..0f32b363219f5 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersExtendImmutabilityPolicySamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.fluent.models.ImmutabilityPolicyInner; + +/** + * Samples for BlobContainers ExtendImmutabilityPolicy. + */ +public final class BlobContainersExtendImmutabilityPolicySamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * BlobContainersExtendImmutabilityPolicy.json + */ + /** + * Sample code: ExtendImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void extendImmutabilityPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .extendImmutabilityPolicyWithResponse("res6238", "sto232", "container5023", "8d59f830d0c3bf9", + new ImmutabilityPolicyInner().withImmutabilityPeriodSinceCreationInDays(100), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersGetImmutabilityPolicySamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersGetImmutabilityPolicySamples.java new file mode 100644 index 0000000000000..83e762ffea9d1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersGetImmutabilityPolicySamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for BlobContainers GetImmutabilityPolicy. + */ +public final class BlobContainersGetImmutabilityPolicySamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * BlobContainersGetImmutabilityPolicy.json + */ + /** + * Sample code: GetImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void getImmutabilityPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .getImmutabilityPolicyWithResponse("res5221", "sto9177", "container3489", null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersGetSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersGetSamples.java new file mode 100644 index 0000000000000..f9d4d3b7061de --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersGetSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for BlobContainers Get. + */ +public final class BlobContainersGetSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/BlobContainersGet.json + */ + /** + * Sample code: GetContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void getContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .getWithResponse("res9871", "sto6217", "container1634", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * BlobContainersGetWithAllowProtectedAppendWritesAll.json + */ + /** + * Sample code: GetBlobContainersGetWithAllowProtectedAppendWritesAll. + * + * @param manager Entry point to StorageManager. + */ + public static void getBlobContainersGetWithAllowProtectedAppendWritesAll( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .getWithResponse("res9871", "sto6217", "container1634", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersLeaseSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersLeaseSamples.java new file mode 100644 index 0000000000000..6eeec324b6a7a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersLeaseSamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.LeaseContainerRequest; +import com.azure.resourcemanager.storage.generated.models.LeaseContainerRequestAction; + +/** + * Samples for BlobContainers Lease. + */ +public final class BlobContainersLeaseSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/BlobContainersLease_Break. + * json + */ + /** + * Sample code: Break a lease on a container. + * + * @param manager Entry point to StorageManager. + */ + public static void breakALeaseOnAContainer(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .leaseWithResponse("res3376", "sto328", "container6185", + new LeaseContainerRequest().withAction(LeaseContainerRequestAction.BREAK) + .withLeaseId("8698f513-fa75-44a1-b8eb-30ba336af27d"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/BlobContainersLease_Acquire. + * json + */ + /** + * Sample code: Acquire a lease on a container. + * + * @param manager Entry point to StorageManager. + */ + public static void acquireALeaseOnAContainer(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .leaseWithResponse("res3376", "sto328", "container6185", + new LeaseContainerRequest().withAction(LeaseContainerRequestAction.ACQUIRE).withLeaseDuration(-1), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersListSamples.java new file mode 100644 index 0000000000000..01cd34880b59a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersListSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.ListContainersInclude; + +/** + * Samples for BlobContainers List. + */ +public final class BlobContainersListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/BlobContainersList.json + */ + /** + * Sample code: ListContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void listContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers().list("res9290", "sto1590", null, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/DeletedBlobContainersList. + * json + */ + /** + * Sample code: ListDeletedContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void listDeletedContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .list("res9290", "sto1590", null, null, ListContainersInclude.DELETED, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersLockImmutabilityPolicySamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersLockImmutabilityPolicySamples.java new file mode 100644 index 0000000000000..2a975d1dd8849 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersLockImmutabilityPolicySamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for BlobContainers LockImmutabilityPolicy. + */ +public final class BlobContainersLockImmutabilityPolicySamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * BlobContainersLockImmutabilityPolicy.json + */ + /** + * Sample code: LockImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void lockImmutabilityPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .lockImmutabilityPolicyWithResponse("res2702", "sto5009", "container1631", "8d59f825b721dd3", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersObjectLevelWormSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersObjectLevelWormSamples.java new file mode 100644 index 0000000000000..e90a0a9781678 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersObjectLevelWormSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for BlobContainers ObjectLevelWorm. + */ +public final class BlobContainersObjectLevelWormSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * ObjectLevelWormContainerMigration.json + */ + /** + * Sample code: VersionLevelWormContainerMigration. + * + * @param manager Entry point to StorageManager. + */ + public static void + versionLevelWormContainerMigration(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .objectLevelWorm("res1782", "sto7069", "container6397", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersSetLegalHoldSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersSetLegalHoldSamples.java new file mode 100644 index 0000000000000..a3ece3ab0e9de --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersSetLegalHoldSamples.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.fluent.models.LegalHoldInner; +import java.util.Arrays; + +/** + * Samples for BlobContainers SetLegalHold. + */ +public final class BlobContainersSetLegalHoldSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/BlobContainersSetLegalHold. + * json + */ + /** + * Sample code: SetLegalHoldContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void setLegalHoldContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .setLegalHoldWithResponse("res4303", "sto7280", "container8723", + new LegalHoldInner().withTags(Arrays.asList("tag1", "tag2", "tag3")), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * BlobContainersSetLegalHoldAllowProtectedAppendWritesAll.json + */ + /** + * Sample code: SetLegalHoldContainersWithAllowProtectedAppendWritesAll. + * + * @param manager Entry point to StorageManager. + */ + public static void setLegalHoldContainersWithAllowProtectedAppendWritesAll( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobContainers() + .setLegalHoldWithResponse("res4303", "sto7280", "container8723", + new LegalHoldInner().withTags(Arrays.asList("tag1", "tag2", "tag3")) + .withAllowProtectedAppendWritesAll(true), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersUpdateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersUpdateSamples.java new file mode 100644 index 0000000000000..4aa76fcde6c57 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobContainersUpdateSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.BlobContainer; +import com.azure.resourcemanager.storage.generated.models.PublicAccess; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for BlobContainers Update. + */ +public final class BlobContainersUpdateSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/BlobContainersPatch.json + */ + /** + * Sample code: UpdateContainers. + * + * @param manager Entry point to StorageManager. + */ + public static void updateContainers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + BlobContainer resource = manager.blobContainers() + .getWithResponse("res3376", "sto328", "container6185", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withPublicAccess(PublicAccess.CONTAINER).withMetadata(mapOf("metadata", "true")).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/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesCreateOrUpdateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..d4dd6017744df --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesCreateOrUpdateSamples.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.BlobInventoryCreationTime; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyDefinition; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyFilter; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyName; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyRule; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicySchema; +import com.azure.resourcemanager.storage.generated.models.Format; +import com.azure.resourcemanager.storage.generated.models.InventoryRuleType; +import com.azure.resourcemanager.storage.generated.models.ObjectType; +import com.azure.resourcemanager.storage.generated.models.Schedule; +import java.util.Arrays; + +/** + * Samples for BlobInventoryPolicies CreateOrUpdate. + */ +public final class BlobInventoryPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountSetBlobInventoryPolicyIncludeDeleteAndNewSchemaForNonHnsAccount.json + */ + /** + * Sample code: StorageAccountSetBlobInventoryPolicyIncludeDeleteAndNewSchemaForNonHnsAccount. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetBlobInventoryPolicyIncludeDeleteAndNewSchemaForNonHnsAccount( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobInventoryPolicies() + .define(BlobInventoryPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy(new BlobInventoryPolicySchema().withEnabled(true) + .withType(InventoryRuleType.INVENTORY) + .withRules(Arrays.asList( + new BlobInventoryPolicyRule().withEnabled(true) + .withName("inventoryPolicyRule1") + .withDestination("container1") + .withDefinition(new BlobInventoryPolicyDefinition() + .withFilters(new BlobInventoryPolicyFilter() + .withPrefixMatch(Arrays.asList("inventoryprefix1", "inventoryprefix2")) + .withExcludePrefix(Arrays.asList("excludeprefix1", "excludeprefix2")) + .withBlobTypes(Arrays.asList("blockBlob", "appendBlob", "pageBlob")) + .withIncludeBlobVersions(true) + .withIncludeSnapshots(true) + .withIncludeDeleted(true)) + .withFormat(Format.CSV) + .withSchedule(Schedule.DAILY) + .withObjectType(ObjectType.BLOB) + .withSchemaFields( + Arrays.asList("Name", "Creation-Time", "Last-Modified", "Content-Length", "Content-MD5", + "BlobType", "AccessTier", "AccessTierChangeTime", "Snapshot", "VersionId", + "IsCurrentVersion", "Tags", "ContentType", "ContentEncoding", "ContentLanguage", + "ContentCRC64", "CacheControl", "Metadata", "Deleted", "RemainingRetentionDays"))), + new BlobInventoryPolicyRule().withEnabled(true) + .withName("inventoryPolicyRule2") + .withDestination("container2") + .withDefinition(new BlobInventoryPolicyDefinition().withFormat(Format.PARQUET) + .withSchedule(Schedule.WEEKLY) + .withObjectType(ObjectType.CONTAINER) + .withSchemaFields(Arrays.asList("Name", "Last-Modified", "Metadata", "LeaseStatus", + "LeaseState", "LeaseDuration", "PublicAccess", "HasImmutabilityPolicy", "HasLegalHold", + "Etag", "DefaultEncryptionScope", "DenyEncryptionScopeOverride", + "ImmutableStorageWithVersioningEnabled", "Deleted", "Version", "DeletedTime", + "RemainingRetentionDays")))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountSetBlobInventoryPolicy.json + */ + /** + * Sample code: StorageAccountSetBlobInventoryPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountSetBlobInventoryPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobInventoryPolicies() + .define(BlobInventoryPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new BlobInventoryPolicySchema().withEnabled(true) + .withType(InventoryRuleType.INVENTORY) + .withRules(Arrays.asList( + new BlobInventoryPolicyRule().withEnabled(true) + .withName("inventoryPolicyRule1") + .withDestination("container1") + .withDefinition(new BlobInventoryPolicyDefinition() + .withFilters(new BlobInventoryPolicyFilter() + .withPrefixMatch(Arrays.asList("inventoryprefix1", "inventoryprefix2")) + .withBlobTypes(Arrays.asList("blockBlob", "appendBlob", "pageBlob")) + .withIncludeBlobVersions(true) + .withIncludeSnapshots(true) + .withCreationTime(new BlobInventoryCreationTime().withLastNDays(1000))) + .withFormat(Format.CSV) + .withSchedule(Schedule.DAILY) + .withObjectType(ObjectType.BLOB) + .withSchemaFields(Arrays.asList("Name", "Creation-Time", "Last-Modified", + "Content-Length", "Content-MD5", "BlobType", "AccessTier", "AccessTierChangeTime", + "Snapshot", "VersionId", "IsCurrentVersion", "Metadata"))), + new BlobInventoryPolicyRule().withEnabled(true) + .withName("inventoryPolicyRule2") + .withDestination("container2") + .withDefinition( + new BlobInventoryPolicyDefinition().withFormat(Format.PARQUET) + .withSchedule(Schedule.WEEKLY) + .withObjectType(ObjectType.CONTAINER) + .withSchemaFields(Arrays.asList("Name", "Last-Modified", "Metadata", "LeaseStatus", + "LeaseState", "LeaseDuration", "PublicAccess", "HasImmutabilityPolicy", + "HasLegalHold")))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountSetBlobInventoryPolicyIncludeDeleteAndNewSchemaForHnsAccount.json + */ + /** + * Sample code: StorageAccountSetBlobInventoryPolicyIncludeDeleteAndNewSchemaForHnsAccount. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetBlobInventoryPolicyIncludeDeleteAndNewSchemaForHnsAccount( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobInventoryPolicies() + .define(BlobInventoryPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy(new BlobInventoryPolicySchema().withEnabled(true) + .withType(InventoryRuleType.INVENTORY) + .withRules(Arrays.asList( + new BlobInventoryPolicyRule().withEnabled(true) + .withName("inventoryPolicyRule1") + .withDestination("container1") + .withDefinition(new BlobInventoryPolicyDefinition() + .withFilters(new BlobInventoryPolicyFilter() + .withPrefixMatch(Arrays.asList("inventoryprefix1", "inventoryprefix2")) + .withExcludePrefix(Arrays.asList("excludeprefix1", "excludeprefix2")) + .withBlobTypes(Arrays.asList("blockBlob", "appendBlob", "pageBlob")) + .withIncludeBlobVersions(true) + .withIncludeSnapshots(true) + .withIncludeDeleted(true)) + .withFormat(Format.CSV) + .withSchedule(Schedule.DAILY) + .withObjectType(ObjectType.BLOB) + .withSchemaFields(Arrays.asList("Name", "Creation-Time", "Last-Modified", "Content-Length", + "Content-MD5", "BlobType", "AccessTier", "AccessTierChangeTime", "Snapshot", + "VersionId", "IsCurrentVersion", "ContentType", "ContentEncoding", "ContentLanguage", + "ContentCRC64", "CacheControl", "Metadata", "DeletionId", "Deleted", "DeletedTime", + "RemainingRetentionDays"))), + new BlobInventoryPolicyRule().withEnabled(true) + .withName("inventoryPolicyRule2") + .withDestination("container2") + .withDefinition(new BlobInventoryPolicyDefinition().withFormat(Format.PARQUET) + .withSchedule(Schedule.WEEKLY) + .withObjectType(ObjectType.CONTAINER) + .withSchemaFields(Arrays.asList("Name", "Last-Modified", "Metadata", "LeaseStatus", + "LeaseState", "LeaseDuration", "PublicAccess", "HasImmutabilityPolicy", "HasLegalHold", + "Etag", "DefaultEncryptionScope", "DenyEncryptionScopeOverride", + "ImmutableStorageWithVersioningEnabled", "Deleted", "Version", "DeletedTime", + "RemainingRetentionDays")))))) + .create(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesDeleteSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesDeleteSamples.java new file mode 100644 index 0000000000000..c9c7c5f1d6caa --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyName; + +/** + * Samples for BlobInventoryPolicies Delete. + */ +public final class BlobInventoryPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountDeleteBlobInventoryPolicy.json + */ + /** + * Sample code: StorageAccountDeleteBlobInventoryPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountDeleteBlobInventoryPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobInventoryPolicies() + .deleteWithResponse("res6977", "sto2527", BlobInventoryPolicyName.DEFAULT, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesGetSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesGetSamples.java new file mode 100644 index 0000000000000..b11b0979c3df3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicyName; + +/** + * Samples for BlobInventoryPolicies Get. + */ +public final class BlobInventoryPoliciesGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountGetBlobInventoryPolicy.json + */ + /** + * Sample code: StorageAccountGetBlobInventoryPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountGetBlobInventoryPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobInventoryPolicies() + .getWithResponse("res7687", "sto9699", BlobInventoryPolicyName.DEFAULT, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesListSamples.java new file mode 100644 index 0000000000000..b9a37ce985d00 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobInventoryPoliciesListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for BlobInventoryPolicies List. + */ +public final class BlobInventoryPoliciesListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountListBlobInventoryPolicy.json + */ + /** + * Sample code: StorageAccountGetBlobInventoryPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountGetBlobInventoryPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobInventoryPolicies().list("res7687", "sto9699", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobServicesGetServicePropertiesSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobServicesGetServicePropertiesSamples.java new file mode 100644 index 0000000000000..6f6d48ccb9c2b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobServicesGetServicePropertiesSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for BlobServices GetServiceProperties. + */ +public final class BlobServicesGetServicePropertiesSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/BlobServicesGet.json + */ + /** + * Sample code: GetBlobServices. + * + * @param manager Entry point to StorageManager. + */ + public static void getBlobServices(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobServices().getServicePropertiesWithResponse("res4410", "sto8607", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobServicesListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobServicesListSamples.java new file mode 100644 index 0000000000000..988f16c349dde --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobServicesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for BlobServices List. + */ +public final class BlobServicesListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/BlobServicesList.json + */ + /** + * Sample code: ListBlobServices. + * + * @param manager Entry point to StorageManager. + */ + public static void listBlobServices(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobServices().list("res4410", "sto8607", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobServicesSetServicePropertiesSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobServicesSetServicePropertiesSamples.java new file mode 100644 index 0000000000000..f6f82d2f41eb0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/BlobServicesSetServicePropertiesSamples.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.AllowedMethods; +import com.azure.resourcemanager.storage.generated.models.ChangeFeed; +import com.azure.resourcemanager.storage.generated.models.CorsRule; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.azure.resourcemanager.storage.generated.models.DeleteRetentionPolicy; +import com.azure.resourcemanager.storage.generated.models.LastAccessTimeTrackingPolicy; +import com.azure.resourcemanager.storage.generated.models.Name; +import java.util.Arrays; + +/** + * Samples for BlobServices SetServiceProperties. + */ +public final class BlobServicesSetServicePropertiesSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/BlobServicesPut.json + */ + /** + * Sample code: PutBlobServices. + * + * @param manager Entry point to StorageManager. + */ + public static void putBlobServices(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withCors(new CorsRules().withCorsRules(Arrays.asList( + new CorsRule().withAllowedOrigins(Arrays.asList("http://www.contoso.com", "http://www.fabrikam.com")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET, AllowedMethods.HEAD, AllowedMethods.POST, + AllowedMethods.OPTIONS, AllowedMethods.MERGE, AllowedMethods.PUT)) + .withMaxAgeInSeconds(100) + .withExposedHeaders(Arrays.asList("x-ms-meta-*")) + .withAllowedHeaders(Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")), + new CorsRule().withAllowedOrigins(Arrays.asList("*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET)) + .withMaxAgeInSeconds(2) + .withExposedHeaders(Arrays.asList("*")) + .withAllowedHeaders(Arrays.asList("*")), + new CorsRule().withAllowedOrigins(Arrays.asList("http://www.abc23.com", "https://www.fabrikam.com/*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET, AllowedMethods.PUT)) + .withMaxAgeInSeconds(2000) + .withExposedHeaders(Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x -ms-meta-target*")) + .withAllowedHeaders(Arrays.asList("x-ms-meta-12345675754564*"))))) + .withDefaultServiceVersion("2017-07-29") + .withDeleteRetentionPolicy(new DeleteRetentionPolicy().withEnabled(true).withDays(300)) + .withIsVersioningEnabled(true) + .withChangeFeed(new ChangeFeed().withEnabled(true).withRetentionInDays(7)) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * BlobServicesPutAllowPermanentDelete.json + */ + /** + * Sample code: BlobServicesPutAllowPermanentDelete. + * + * @param manager Entry point to StorageManager. + */ + public static void + blobServicesPutAllowPermanentDelete(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withDeleteRetentionPolicy( + new DeleteRetentionPolicy().withEnabled(true).withDays(300).withAllowPermanentDelete(true)) + .withIsVersioningEnabled(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * BlobServicesPutLastAccessTimeBasedTracking.json + */ + /** + * Sample code: BlobServicesPutLastAccessTimeBasedTracking. + * + * @param manager Entry point to StorageManager. + */ + public static void + blobServicesPutLastAccessTimeBasedTracking(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.blobServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withLastAccessTimeTrackingPolicy(new LastAccessTimeTrackingPolicy().withEnable(true) + .withName(Name.ACCESS_TIME_TRACKING) + .withTrackingGranularityInDays(1) + .withBlobType(Arrays.asList("blockBlob"))) + .create(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/DeletedAccountsGetSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/DeletedAccountsGetSamples.java new file mode 100644 index 0000000000000..b5241632aa855 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/DeletedAccountsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for DeletedAccounts Get. + */ +public final class DeletedAccountsGetSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/DeletedAccountGet.json + */ + /** + * Sample code: DeletedAccountGet. + * + * @param manager Entry point to StorageManager. + */ + public static void deletedAccountGet(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.deletedAccounts().getWithResponse("sto1125", "eastus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/DeletedAccountsListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/DeletedAccountsListSamples.java new file mode 100644 index 0000000000000..834fbc3b13130 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/DeletedAccountsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for DeletedAccounts List. + */ +public final class DeletedAccountsListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/DeletedAccountList.json + */ + /** + * Sample code: DeletedAccountList. + * + * @param manager Entry point to StorageManager. + */ + public static void deletedAccountList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.deletedAccounts().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesGetSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesGetSamples.java new file mode 100644 index 0000000000000..72dcf26b09ec6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for EncryptionScopes Get. + */ +public final class EncryptionScopesGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountGetEncryptionScope.json + */ + /** + * Sample code: StorageAccountGetEncryptionScope. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountGetEncryptionScope(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.encryptionScopes() + .getWithResponse("resource-group-name", "accountname", "{encryption-scope-name}", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesListSamples.java new file mode 100644 index 0000000000000..83c3600537575 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for EncryptionScopes List. + */ +public final class EncryptionScopesListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountEncryptionScopeList.json + */ + /** + * Sample code: StorageAccountEncryptionScopeList. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountEncryptionScopeList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.encryptionScopes() + .list("resource-group-name", "accountname", null, null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesPatchSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesPatchSamples.java new file mode 100644 index 0000000000000..2abb6e1a59dcf --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesPatchSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.EncryptionScope; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeKeyVaultProperties; +import com.azure.resourcemanager.storage.generated.models.EncryptionScopeSource; + +/** + * Samples for EncryptionScopes Patch. + */ +public final class EncryptionScopesPatchSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountPatchEncryptionScope.json + */ + /** + * Sample code: StorageAccountPatchEncryptionScope. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountPatchEncryptionScope(com.azure.resourcemanager.storage.generated.StorageManager manager) { + EncryptionScope resource = manager.encryptionScopes() + .getWithResponse("resource-group-name", "accountname", "{encryption-scope-name}", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withSource(EncryptionScopeSource.MICROSOFT_KEY_VAULT) + .withKeyVaultProperties(new EncryptionScopeKeyVaultProperties().withKeyUri("fakeTokenPlaceholder")) + .apply(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesPutSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesPutSamples.java new file mode 100644 index 0000000000000..2b9a23cc3bfab --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/EncryptionScopesPutSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for EncryptionScopes Put. + */ +public final class EncryptionScopesPutSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountPutEncryptionScopeWithInfrastructureEncryption.json + */ + /** + * Sample code: StorageAccountPutEncryptionScopeWithInfrastructureEncryption. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountPutEncryptionScopeWithInfrastructureEncryption( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.encryptionScopes() + .define("{encryption-scope-name}") + .withExistingStorageAccount("resource-group-name", "accountname") + .withRequireInfrastructureEncryption(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountPutEncryptionScope.json + */ + /** + * Sample code: StorageAccountPutEncryptionScope. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountPutEncryptionScope(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.encryptionScopes() + .define("{encryption-scope-name}") + .withExistingStorageAccount("resource-group-name", "accountname") + .create(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesGetServicePropertiesSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesGetServicePropertiesSamples.java new file mode 100644 index 0000000000000..35113adf0120d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesGetServicePropertiesSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for FileServices GetServiceProperties. + */ +public final class FileServicesGetServicePropertiesSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileServicesGet.json + */ + /** + * Sample code: GetFileServices. + * + * @param manager Entry point to StorageManager. + */ + public static void getFileServices(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileServices().getServicePropertiesWithResponse("res4410", "sto8607", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesGetServiceUsageSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesGetServiceUsageSamples.java new file mode 100644 index 0000000000000..b7d785271818c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesGetServiceUsageSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for FileServices GetServiceUsage. + */ +public final class FileServicesGetServiceUsageSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileServicesGetUsage.json + */ + /** + * Sample code: GetFileServiceUsage. + * + * @param manager Entry point to StorageManager. + */ + public static void getFileServiceUsage(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileServices().getServiceUsageWithResponse("res4410", "sto8607", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesListSamples.java new file mode 100644 index 0000000000000..c30d23367009d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for FileServices List. + */ +public final class FileServicesListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileServicesList.json + */ + /** + * Sample code: ListFileServices. + * + * @param manager Entry point to StorageManager. + */ + public static void listFileServices(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileServices().listWithResponse("res9290", "sto1590", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesListServiceUsagesSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesListServiceUsagesSamples.java new file mode 100644 index 0000000000000..ec0293b479d81 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesListServiceUsagesSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for FileServices ListServiceUsages. + */ +public final class FileServicesListServiceUsagesSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileServicesListUsages.json + */ + /** + * Sample code: ListFileServiceUsages. + * + * @param manager Entry point to StorageManager. + */ + public static void listFileServiceUsages(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileServices().listServiceUsages("res4410", "sto8607", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesSetServicePropertiesSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesSetServicePropertiesSamples.java new file mode 100644 index 0000000000000..aa8f6af28dbf2 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileServicesSetServicePropertiesSamples.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.AllowedMethods; +import com.azure.resourcemanager.storage.generated.models.CorsRule; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.azure.resourcemanager.storage.generated.models.Multichannel; +import com.azure.resourcemanager.storage.generated.models.ProtocolSettings; +import com.azure.resourcemanager.storage.generated.models.SmbSetting; +import java.util.Arrays; + +/** + * Samples for FileServices SetServiceProperties. + */ +public final class FileServicesSetServicePropertiesSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileServicesPut.json + */ + /** + * Sample code: PutFileServices. + * + * @param manager Entry point to StorageManager. + */ + public static void putFileServices(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withCors(new CorsRules().withCorsRules(Arrays.asList( + new CorsRule().withAllowedOrigins(Arrays.asList("http://www.contoso.com", "http://www.fabrikam.com")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET, AllowedMethods.HEAD, AllowedMethods.POST, + AllowedMethods.OPTIONS, AllowedMethods.MERGE, AllowedMethods.PUT)) + .withMaxAgeInSeconds(100) + .withExposedHeaders(Arrays.asList("x-ms-meta-*")) + .withAllowedHeaders(Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")), + new CorsRule().withAllowedOrigins(Arrays.asList("*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET)) + .withMaxAgeInSeconds(2) + .withExposedHeaders(Arrays.asList("*")) + .withAllowedHeaders(Arrays.asList("*")), + new CorsRule().withAllowedOrigins(Arrays.asList("http://www.abc23.com", "https://www.fabrikam.com/*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET, AllowedMethods.PUT)) + .withMaxAgeInSeconds(2000) + .withExposedHeaders(Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")) + .withAllowedHeaders(Arrays.asList("x-ms-meta-12345675754564*"))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * FileServicesPut_EnableSecureSmbFeatures.json + */ + /** + * Sample code: PutFileServices_EnableSecureSmbFeatures. + * + * @param manager Entry point to StorageManager. + */ + public static void + putFileServicesEnableSecureSmbFeatures(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withProtocolSettings(new ProtocolSettings().withSmb(new SmbSetting().withVersions("SMB2.1;SMB3.0;SMB3.1.1") + .withAuthenticationMethods("NTLMv2;Kerberos") + .withKerberosTicketEncryption("RC4-HMAC;AES-256") + .withChannelEncryption("AES-128-CCM;AES-128-GCM;AES-256-GCM"))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * FileServicesPut_EnableSMBMultichannel.json + */ + /** + * Sample code: PutFileServices_EnableSMBMultichannel. + * + * @param manager Entry point to StorageManager. + */ + public static void + putFileServicesEnableSMBMultichannel(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withProtocolSettings( + new ProtocolSettings().withSmb(new SmbSetting().withMultichannel(new Multichannel().withEnabled(true)))) + .create(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesCreateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesCreateSamples.java new file mode 100644 index 0000000000000..42e2bdd1da0fe --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesCreateSamples.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.EnabledProtocols; +import com.azure.resourcemanager.storage.generated.models.FileSharePropertiesFileSharePaidBursting; +import com.azure.resourcemanager.storage.generated.models.ShareAccessTier; + +/** + * Samples for FileShares Create. + */ +public final class FileSharesCreateSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesPut_ProvisionedV2. + * json + */ + /** + * Sample code: PutSharesProvisionedV2. + * + * @param manager Entry point to StorageManager. + */ + public static void putSharesProvisionedV2(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares() + .define("share1235") + .withExistingStorageAccount("res346", "sto666") + .withShareQuota(100) + .withProvisionedIops(5000) + .withProvisionedBandwidthMibps(200) + .create(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesPut_AccessTier.json + */ + /** + * Sample code: PutShares with Access Tier. + * + * @param manager Entry point to StorageManager. + */ + public static void putSharesWithAccessTier(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares() + .define("share1235") + .withExistingStorageAccount("res346", "sto666") + .withAccessTier(ShareAccessTier.HOT) + .create(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesPut_NFS.json + */ + /** + * Sample code: Create NFS Shares. + * + * @param manager Entry point to StorageManager. + */ + public static void createNFSShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares() + .define("share1235") + .withExistingStorageAccount("res346", "sto666") + .withEnabledProtocols(EnabledProtocols.NFS) + .create(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesPut_PaidBursting. + * json + */ + /** + * Sample code: PutShares with Paid Bursting. + * + * @param manager Entry point to StorageManager. + */ + public static void putSharesWithPaidBursting(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares() + .define("share1235") + .withExistingStorageAccount("res346", "sto666") + .withFileSharePaidBursting(new FileSharePropertiesFileSharePaidBursting().withPaidBurstingEnabled(true) + .withPaidBurstingMaxIops(102400) + .withPaidBurstingMaxBandwidthMibps(10340)) + .create(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesPut.json + */ + /** + * Sample code: PutShares. + * + * @param manager Entry point to StorageManager. + */ + public static void putShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares().define("share6185").withExistingStorageAccount("res3376", "sto328").create(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesDeleteSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesDeleteSamples.java new file mode 100644 index 0000000000000..dcf2da96afd6f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for FileShares Delete. + */ +public final class FileSharesDeleteSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesDelete.json + */ + /** + * Sample code: DeleteShares. + * + * @param manager Entry point to StorageManager. + */ + public static void deleteShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares() + .deleteWithResponse("res4079", "sto4506", "share9689", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesGetSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesGetSamples.java new file mode 100644 index 0000000000000..ecde06cd0d58a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesGetSamples.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for FileShares Get. + */ +public final class FileSharesGetSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesGet_Stats.json + */ + /** + * Sample code: GetShareStats. + * + * @param manager Entry point to StorageManager. + */ + public static void getShareStats(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares() + .getWithResponse("res9871", "sto6217", "share1634", "stats", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesGet_PaidBursting. + * json + */ + /** + * Sample code: GetSharePaidBursting. + * + * @param manager Entry point to StorageManager. + */ + public static void getSharePaidBursting(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares() + .getWithResponse("res9871", "sto6217", "share1634", null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesGet_ProvisionedV2. + * json + */ + /** + * Sample code: GetShareProvisionedV2. + * + * @param manager Entry point to StorageManager. + */ + public static void getShareProvisionedV2(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares() + .getWithResponse("res9871", "sto6217", "share1634", null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesGet.json + */ + /** + * Sample code: GetShares. + * + * @param manager Entry point to StorageManager. + */ + public static void getShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares() + .getWithResponse("res9871", "sto6217", "share1634", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesLeaseSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesLeaseSamples.java new file mode 100644 index 0000000000000..315b9e508705a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesLeaseSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.LeaseShareAction; +import com.azure.resourcemanager.storage.generated.models.LeaseShareRequest; + +/** + * Samples for FileShares Lease. + */ +public final class FileSharesLeaseSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesLease_Break.json + */ + /** + * Sample code: Break a lease on a share. + * + * @param manager Entry point to StorageManager. + */ + public static void breakALeaseOnAShare(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares() + .leaseWithResponse("res3376", "sto328", "share12", null, + new LeaseShareRequest().withAction(LeaseShareAction.BREAK) + .withLeaseId("8698f513-fa75-44a1-b8eb-30ba336af27d"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesLease_Acquire.json + */ + /** + * Sample code: Acquire a lease on a share. + * + * @param manager Entry point to StorageManager. + */ + public static void acquireALeaseOnAShare(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares() + .leaseWithResponse("res3376", "sto328", "share124", null, + new LeaseShareRequest().withAction(LeaseShareAction.ACQUIRE).withLeaseDuration(-1), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesListSamples.java new file mode 100644 index 0000000000000..6fb93501feafd --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesListSamples.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for FileShares List. + */ +public final class FileSharesListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesList.json + */ + /** + * Sample code: ListShares. + * + * @param manager Entry point to StorageManager. + */ + public static void listShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares().list("res9290", "sto1590", null, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/DeletedFileSharesList.json + */ + /** + * Sample code: ListDeletedShares. + * + * @param manager Entry point to StorageManager. + */ + public static void listDeletedShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares().list("res9290", "sto1590", null, null, "deleted", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesList_ProvisionedV2. + * json + */ + /** + * Sample code: ListSharesProvisionedV2. + * + * @param manager Entry point to StorageManager. + */ + public static void listSharesProvisionedV2(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares().list("res9290", "sto1590", null, null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileShareSnapshotsList.json + */ + /** + * Sample code: ListShareSnapshots. + * + * @param manager Entry point to StorageManager. + */ + public static void listShareSnapshots(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares().list("res9290", "sto1590", null, null, "snapshots", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesList_PaidBursting. + * json + */ + /** + * Sample code: ListSharesPaidBursting. + * + * @param manager Entry point to StorageManager. + */ + public static void listSharesPaidBursting(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares().list("res9290", "sto1590", null, null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesRestoreSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesRestoreSamples.java new file mode 100644 index 0000000000000..c31eca908af20 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesRestoreSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.DeletedShare; + +/** + * Samples for FileShares Restore. + */ +public final class FileSharesRestoreSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesRestore.json + */ + /** + * Sample code: RestoreShares. + * + * @param manager Entry point to StorageManager. + */ + public static void restoreShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.fileShares() + .restoreWithResponse("res3376", "sto328", "share1249", + new DeletedShare().withDeletedShareName("share1249").withDeletedShareVersion("1234567890"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesUpdateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesUpdateSamples.java new file mode 100644 index 0000000000000..cf18513212287 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/FileSharesUpdateSamples.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.AccessPolicy; +import com.azure.resourcemanager.storage.generated.models.FileShare; +import com.azure.resourcemanager.storage.generated.models.FileSharePropertiesFileSharePaidBursting; +import com.azure.resourcemanager.storage.generated.models.SignedIdentifier; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FileShares Update. + */ +public final class FileSharesUpdateSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesPatch.json + */ + /** + * Sample code: UpdateShares. + * + * @param manager Entry point to StorageManager. + */ + public static void updateShares(com.azure.resourcemanager.storage.generated.StorageManager manager) { + FileShare resource = manager.fileShares() + .getWithResponse("res3376", "sto328", "share6185", null, null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withMetadata(mapOf("type", "image")).apply(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileShareAclsPatch.json + */ + /** + * Sample code: UpdateShareAcls. + * + * @param manager Entry point to StorageManager. + */ + public static void updateShareAcls(com.azure.resourcemanager.storage.generated.StorageManager manager) { + FileShare resource = manager.fileShares() + .getWithResponse("res3376", "sto328", "share6185", null, null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withSignedIdentifiers(Arrays.asList(new SignedIdentifier() + .withId("MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI") + .withAccessPolicy(new AccessPolicy().withStartTime(OffsetDateTime.parse("2021-04-01T08:49:37.0000000Z")) + .withExpiryTime(OffsetDateTime.parse("2021-05-01T08:49:37.0000000Z")) + .withPermission("rwd")))) + .apply(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesPatch_PaidBursting. + * json + */ + /** + * Sample code: UpdateSharePaidBursting. + * + * @param manager Entry point to StorageManager. + */ + public static void updateSharePaidBursting(com.azure.resourcemanager.storage.generated.StorageManager manager) { + FileShare resource = manager.fileShares() + .getWithResponse("res3376", "sto328", "share6185", null, null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withFileSharePaidBursting(new FileSharePropertiesFileSharePaidBursting().withPaidBurstingEnabled(true) + .withPaidBurstingMaxIops(102400) + .withPaidBurstingMaxBandwidthMibps(10340)) + .apply(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/FileSharesPatch_ProvisionedV2 + * .json + */ + /** + * Sample code: UpdateShareProvisionedV2. + * + * @param manager Entry point to StorageManager. + */ + public static void updateShareProvisionedV2(com.azure.resourcemanager.storage.generated.StorageManager manager) { + FileShare resource = manager.fileShares() + .getWithResponse("res3376", "sto328", "share6185", null, null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withShareQuota(100).withProvisionedIops(5000).withProvisionedBandwidthMibps(200).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/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationCreateOrUpdateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..3255824d7f237 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationCreateOrUpdateSamples.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.LocalUser; +import com.azure.resourcemanager.storage.generated.models.PermissionScope; +import com.azure.resourcemanager.storage.generated.models.SshPublicKey; +import java.util.Arrays; + +/** + * Samples for LocalUsersOperation CreateOrUpdate. + */ +public final class LocalUsersOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/LocalUserCreate.json + */ + /** + * Sample code: CreateLocalUser. + * + * @param manager Entry point to StorageManager. + */ + public static void createLocalUser(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.localUsersOperations() + .define("user1") + .withExistingStorageAccount("res6977", "sto2527") + .withPermissionScopes(Arrays.asList( + new PermissionScope().withPermissions("rwd").withService("file").withResourceName("share1"), + new PermissionScope().withPermissions("rw").withService("file").withResourceName("share2"))) + .withHomeDirectory("homedirectory") + .withSshAuthorizedKeys( + Arrays.asList(new SshPublicKey().withDescription("key name").withKey("fakeTokenPlaceholder"))) + .withHasSshPassword(true) + .withGroupId(2000) + .withAllowAclAuthorization(true) + .create(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/LocalUserCreateNFSv3Enabled. + * json + */ + /** + * Sample code: CreateNFSv3EnabledLocalUser. + * + * @param manager Entry point to StorageManager. + */ + public static void createNFSv3EnabledLocalUser(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.localUsersOperations() + .define("user1") + .withExistingStorageAccount("res6977", "sto2527") + .withExtendedGroups(Arrays.asList(1001, 1005, 2005)) + .withIsNFSv3Enabled(true) + .create(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/LocalUserUpdate.json + */ + /** + * Sample code: UpdateLocalUser. + * + * @param manager Entry point to StorageManager. + */ + public static void updateLocalUser(com.azure.resourcemanager.storage.generated.StorageManager manager) { + LocalUser resource = manager.localUsersOperations() + .getWithResponse("res6977", "sto2527", "user1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withHomeDirectory("homedirectory2") + .withHasSharedKey(false) + .withHasSshKey(false) + .withHasSshPassword(false) + .withGroupId(3000) + .withAllowAclAuthorization(false) + .withExtendedGroups(Arrays.asList(1001, 1005, 2005)) + .withIsNFSv3Enabled(true) + .apply(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationDeleteSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationDeleteSamples.java new file mode 100644 index 0000000000000..f5b9b0c73cc05 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for LocalUsersOperation Delete. + */ +public final class LocalUsersOperationDeleteSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/LocalUserDelete.json + */ + /** + * Sample code: DeleteLocalUser. + * + * @param manager Entry point to StorageManager. + */ + public static void deleteLocalUser(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.localUsersOperations() + .deleteWithResponse("res6977", "sto2527", "user1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationGetSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationGetSamples.java new file mode 100644 index 0000000000000..6c790777f91fb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for LocalUsersOperation Get. + */ +public final class LocalUsersOperationGetSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/LocalUserGet.json + */ + /** + * Sample code: GetLocalUser. + * + * @param manager Entry point to StorageManager. + */ + public static void getLocalUser(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.localUsersOperations().getWithResponse("res6977", "sto2527", "user1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationListKeysSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationListKeysSamples.java new file mode 100644 index 0000000000000..fab18e35a512c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationListKeysSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for LocalUsersOperation ListKeys. + */ +public final class LocalUsersOperationListKeysSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/LocalUserListKeys.json + */ + /** + * Sample code: ListLocalUserKeys. + * + * @param manager Entry point to StorageManager. + */ + public static void listLocalUserKeys(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.localUsersOperations() + .listKeysWithResponse("res6977", "sto2527", "user1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationListSamples.java new file mode 100644 index 0000000000000..9a2e336d96e34 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationListSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.ListLocalUserIncludeParam; + +/** + * Samples for LocalUsersOperation List. + */ +public final class LocalUsersOperationListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/LocalUsersListNFSv3Enabled. + * json + */ + /** + * Sample code: ListNFSv3EnabledLocalUsers. + * + * @param manager Entry point to StorageManager. + */ + public static void listNFSv3EnabledLocalUsers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.localUsersOperations() + .list("res6977", "sto2527", null, null, ListLocalUserIncludeParam.NFSV3, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/LocalUsersList.json + */ + /** + * Sample code: ListLocalUsers. + * + * @param manager Entry point to StorageManager. + */ + public static void listLocalUsers(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.localUsersOperations().list("res6977", "sto2527", null, null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationRegeneratePasswordSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationRegeneratePasswordSamples.java new file mode 100644 index 0000000000000..21a427cfa1b22 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/LocalUsersOperationRegeneratePasswordSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for LocalUsersOperation RegeneratePassword. + */ +public final class LocalUsersOperationRegeneratePasswordSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/LocalUserRegeneratePassword. + * json + */ + /** + * Sample code: RegenerateLocalUserPassword. + * + * @param manager Entry point to StorageManager. + */ + public static void regenerateLocalUserPassword(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.localUsersOperations() + .regeneratePasswordWithResponse("res6977", "sto2527", "user1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ManagementPoliciesCreateOrUpdateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ManagementPoliciesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..67ea3b71beb4b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ManagementPoliciesCreateOrUpdateSamples.java @@ -0,0 +1,378 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.DateAfterCreation; +import com.azure.resourcemanager.storage.generated.models.DateAfterModification; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyAction; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyBaseBlob; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyDefinition; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyFilter; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyName; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyRule; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicySchema; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicySnapShot; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyVersion; +import com.azure.resourcemanager.storage.generated.models.RuleType; +import com.azure.resourcemanager.storage.generated.models.TagFilter; +import java.util.Arrays; + +/** + * Samples for ManagementPolicies CreateOrUpdate. + */ +public final class ManagementPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountSetManagementPolicyColdTierActions.json + */ + /** + * Sample code: StorageAccountSetManagementPolicyColdTierActions. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetManagementPolicyColdTierActions( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList( + new ManagementPolicyRule().withEnabled(true) + .withName("olcmtest1") + .withType(RuleType.LIFECYCLE) + .withDefinition(new ManagementPolicyDefinition() + .withActions(new ManagementPolicyAction() + .withBaseBlob(new ManagementPolicyBaseBlob() + .withTierToCool(new DateAfterModification() + .withDaysAfterModificationGreaterThan(30.0F)) + .withTierToArchive(new DateAfterModification() + .withDaysAfterModificationGreaterThan(90.0F)) + .withTierToCold(new DateAfterModification() + .withDaysAfterModificationGreaterThan(30.0F)) + .withDelete(new DateAfterModification() + .withDaysAfterModificationGreaterThan(1000.0F))) + .withSnapshot(new ManagementPolicySnapShot() + .withTierToCold( + new DateAfterCreation().withDaysAfterCreationGreaterThan(30f)) + .withDelete( + new DateAfterCreation().withDaysAfterCreationGreaterThan(30f))) + .withVersion(new ManagementPolicyVersion() + .withTierToCold( + new DateAfterCreation().withDaysAfterCreationGreaterThan(30f)) + .withDelete( + new DateAfterCreation().withDaysAfterCreationGreaterThan(30f)))) + .withFilters(new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer1")) + .withBlobTypes(Arrays.asList("blockBlob"))))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountSetManagementPolicyWithSnapshotAndVersion.json + */ + /** + * Sample code: StorageAccountSetManagementPolicyWithSnapshotAndVersion. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetManagementPolicyWithSnapshotAndVersion( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList( + new ManagementPolicyRule().withEnabled(true) + .withName("olcmtest1") + .withType(RuleType.LIFECYCLE) + .withDefinition(new ManagementPolicyDefinition() + .withActions(new ManagementPolicyAction() + .withBaseBlob(new ManagementPolicyBaseBlob() + .withTierToCool(new DateAfterModification() + .withDaysAfterModificationGreaterThan(30.0F)) + .withTierToArchive(new DateAfterModification() + .withDaysAfterModificationGreaterThan(90.0F)) + .withDelete(new DateAfterModification() + .withDaysAfterModificationGreaterThan(1000.0F))) + .withSnapshot(new ManagementPolicySnapShot() + .withTierToCool( + new DateAfterCreation().withDaysAfterCreationGreaterThan(30f)) + .withTierToArchive( + new DateAfterCreation().withDaysAfterCreationGreaterThan(90f)) + .withDelete( + new DateAfterCreation().withDaysAfterCreationGreaterThan(1000f))) + .withVersion(new ManagementPolicyVersion() + .withTierToCool( + new DateAfterCreation().withDaysAfterCreationGreaterThan(30f)) + .withTierToArchive( + new DateAfterCreation().withDaysAfterCreationGreaterThan(90f)) + .withDelete( + new DateAfterCreation().withDaysAfterCreationGreaterThan(1000f)))) + .withFilters(new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer1")) + .withBlobTypes(Arrays.asList("blockBlob"))))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountSetManagementPolicyForBlockAndAppendBlobs.json + */ + /** + * Sample code: StorageAccountSetManagementPolicyForBlockAndAppendBlobs. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetManagementPolicyForBlockAndAppendBlobs( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList( + new ManagementPolicyRule().withEnabled(true) + .withName("olcmtest1") + .withType(RuleType.LIFECYCLE) + .withDefinition(new ManagementPolicyDefinition() + .withActions(new ManagementPolicyAction() + .withBaseBlob( + new ManagementPolicyBaseBlob().withDelete(new DateAfterModification() + .withDaysAfterModificationGreaterThan(90.0F))) + .withSnapshot(new ManagementPolicySnapShot().withDelete( + new DateAfterCreation().withDaysAfterCreationGreaterThan(90f))) + .withVersion(new ManagementPolicyVersion().withDelete( + new DateAfterCreation().withDaysAfterCreationGreaterThan(90f)))) + .withFilters(new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer1")) + .withBlobTypes(Arrays.asList("blockBlob", "appendBlob"))))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountSetManagementPolicyHotTierActions.json + */ + /** + * Sample code: StorageAccountSetManagementPolicyHotTierActions. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetManagementPolicyHotTierActions( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList( + new ManagementPolicyRule().withEnabled(true) + .withName("olcmtest1") + .withType(RuleType.LIFECYCLE) + .withDefinition(new ManagementPolicyDefinition() + .withActions(new ManagementPolicyAction() + .withBaseBlob( + new ManagementPolicyBaseBlob().withTierToHot(new DateAfterModification() + .withDaysAfterModificationGreaterThan(30.0F))) + .withSnapshot(new ManagementPolicySnapShot().withTierToHot( + new DateAfterCreation().withDaysAfterCreationGreaterThan(30f))) + .withVersion(new ManagementPolicyVersion().withTierToHot( + new DateAfterCreation().withDaysAfterCreationGreaterThan(30f)))) + .withFilters(new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer1")) + .withBlobTypes(Arrays.asList("blockBlob"))))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountSetManagementPolicy_LastAccessTimeBasedBlobActions.json + */ + /** + * Sample code: StorageAccountSetManagementPolicy_LastAccessTimeBasedBlobActions. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetManagementPolicyLastAccessTimeBasedBlobActions( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList(new ManagementPolicyRule().withEnabled(true) + .withName("olcmtest") + .withType(RuleType.LIFECYCLE) + .withDefinition(new ManagementPolicyDefinition() + .withActions(new ManagementPolicyAction() + .withBaseBlob(new ManagementPolicyBaseBlob() + .withTierToCool(new DateAfterModification() + .withDaysAfterLastAccessTimeGreaterThan(30.0F)) + .withTierToArchive(new DateAfterModification() + .withDaysAfterLastAccessTimeGreaterThan(90.0F)) + .withDelete(new DateAfterModification() + .withDaysAfterLastAccessTimeGreaterThan(1000.0F)) + .withEnableAutoTierToHotFromCool(true)) + .withSnapshot(new ManagementPolicySnapShot() + .withDelete(new DateAfterCreation().withDaysAfterCreationGreaterThan(30f)))) + .withFilters( + new ManagementPolicyFilter().withPrefixMatch(Arrays.asList("olcmtestcontainer")) + .withBlobTypes(Arrays.asList("blockBlob"))))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountSetManagementPolicy.json + */ + /** + * Sample code: StorageAccountSetManagementPolicies. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountSetManagementPolicies(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList( + new ManagementPolicyRule().withEnabled(true) + .withName("olcmtest1") + .withType(RuleType.LIFECYCLE) + .withDefinition(new ManagementPolicyDefinition() + .withActions(new ManagementPolicyAction() + .withBaseBlob(new ManagementPolicyBaseBlob() + .withTierToCool(new DateAfterModification() + .withDaysAfterModificationGreaterThan(30.0F)) + .withTierToArchive(new DateAfterModification() + .withDaysAfterModificationGreaterThan(90.0F)) + .withDelete(new DateAfterModification() + .withDaysAfterModificationGreaterThan(1000.0F))) + .withSnapshot(new ManagementPolicySnapShot().withDelete( + new DateAfterCreation().withDaysAfterCreationGreaterThan(30f)))) + .withFilters( + new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer1")) + .withBlobTypes(Arrays.asList("blockBlob")))), + new ManagementPolicyRule().withEnabled(true) + .withName("olcmtest2") + .withType(RuleType.LIFECYCLE) + .withDefinition(new ManagementPolicyDefinition() + .withActions(new ManagementPolicyAction() + .withBaseBlob(new ManagementPolicyBaseBlob() + .withTierToCool(new DateAfterModification() + .withDaysAfterModificationGreaterThan(30.0F)) + .withTierToArchive(new DateAfterModification() + .withDaysAfterModificationGreaterThan(90.0F)) + .withDelete(new DateAfterModification() + .withDaysAfterModificationGreaterThan(1000.0F)))) + .withFilters(new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer2")) + .withBlobTypes(Arrays.asList("blockBlob")) + .withBlobIndexMatch(Arrays.asList( + new TagFilter().withName("tag1").withOp("==").withValue("val1"), + new TagFilter().withName("tag2").withOp("==").withValue("val2")))))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountSetManagementPolicy_BaseBlobDaysAfterCreationActions.json + */ + /** + * Sample code: StorageAccountSetManagementPolicy_BaseBlobDaysAfterCreationActions. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetManagementPolicyBaseBlobDaysAfterCreationActions( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList( + new ManagementPolicyRule().withEnabled(true) + .withName("olcmtest1") + .withType(RuleType.LIFECYCLE) + .withDefinition( + new ManagementPolicyDefinition() + .withActions( + new ManagementPolicyAction().withBaseBlob(new ManagementPolicyBaseBlob() + .withTierToCool(new DateAfterModification() + .withDaysAfterCreationGreaterThan(30.0F)) + .withTierToArchive(new DateAfterModification() + .withDaysAfterCreationGreaterThan(90.0F)) + .withDelete(new DateAfterModification() + .withDaysAfterCreationGreaterThan(1000.0F)))) + .withFilters(new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer1")) + .withBlobTypes(Arrays.asList("blockBlob"))))))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountSetManagementPolicy_LastTierChangeTimeActions.json + */ + /** + * Sample code: StorageAccountSetManagementPolicy_LastTierChangeTimeActions. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountSetManagementPolicyLastTierChangeTimeActions( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.managementPolicies() + .define(ManagementPolicyName.DEFAULT) + .withExistingStorageAccount("res7687", "sto9699") + .withPolicy( + new ManagementPolicySchema() + .withRules( + Arrays + .asList( + new ManagementPolicyRule().withEnabled(true) + .withName("olcmtest") + .withType(RuleType.LIFECYCLE) + .withDefinition(new ManagementPolicyDefinition() + .withActions(new ManagementPolicyAction() + .withBaseBlob(new ManagementPolicyBaseBlob() + .withTierToCool(new DateAfterModification() + .withDaysAfterModificationGreaterThan(30.0F)) + .withTierToArchive(new DateAfterModification() + .withDaysAfterModificationGreaterThan(90.0F) + .withDaysAfterLastTierChangeGreaterThan(120.0F)) + .withDelete(new DateAfterModification() + .withDaysAfterModificationGreaterThan(1000.0F))) + .withSnapshot(new ManagementPolicySnapShot().withTierToArchive( + new DateAfterCreation().withDaysAfterCreationGreaterThan(30f) + .withDaysAfterLastTierChangeGreaterThan(90.0F))) + .withVersion(new ManagementPolicyVersion().withTierToArchive( + new DateAfterCreation().withDaysAfterCreationGreaterThan(30f) + .withDaysAfterLastTierChangeGreaterThan(90.0F)))) + .withFilters(new ManagementPolicyFilter() + .withPrefixMatch(Arrays.asList("olcmtestcontainer")) + .withBlobTypes(Arrays.asList("blockBlob"))))))) + .create(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ManagementPoliciesDeleteSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ManagementPoliciesDeleteSamples.java new file mode 100644 index 0000000000000..3ee9b8ff23279 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ManagementPoliciesDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyName; + +/** + * Samples for ManagementPolicies Delete. + */ +public final class ManagementPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountDeleteManagementPolicy.json + */ + /** + * Sample code: StorageAccountDeleteManagementPolicies. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountDeleteManagementPolicies(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.managementPolicies() + .deleteWithResponse("res6977", "sto2527", ManagementPolicyName.DEFAULT, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ManagementPoliciesGetSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ManagementPoliciesGetSamples.java new file mode 100644 index 0000000000000..1fc122ca7f807 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ManagementPoliciesGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.ManagementPolicyName; + +/** + * Samples for ManagementPolicies Get. + */ +public final class ManagementPoliciesGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountGetManagementPolicy.json + */ + /** + * Sample code: StorageAccountGetManagementPolicies. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountGetManagementPolicies(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.managementPolicies() + .getWithResponse("res6977", "sto2527", ManagementPolicyName.DEFAULT, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/NetworkSecurityPerimeterConfigurationsGetSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/NetworkSecurityPerimeterConfigurationsGetSamples.java new file mode 100644 index 0000000000000..74c534fa66400 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/NetworkSecurityPerimeterConfigurationsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for NetworkSecurityPerimeterConfigurations Get. + */ +public final class NetworkSecurityPerimeterConfigurationsGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * NetworkSecurityPerimeterConfigurationGet.json + */ + /** + * Sample code: NetworkSecurityPerimeterConfigurationGet. + * + * @param manager Entry point to StorageManager. + */ + public static void + networkSecurityPerimeterConfigurationGet(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.networkSecurityPerimeterConfigurations() + .getWithResponse("res4410", "sto8607", "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/NetworkSecurityPerimeterConfigurationsListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/NetworkSecurityPerimeterConfigurationsListSamples.java new file mode 100644 index 0000000000000..a18bfcb524b7d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/NetworkSecurityPerimeterConfigurationsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for NetworkSecurityPerimeterConfigurations List. + */ +public final class NetworkSecurityPerimeterConfigurationsListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * NetworkSecurityPerimeterConfigurationList.json + */ + /** + * Sample code: NetworkSecurityPerimeterConfigurationList. + * + * @param manager Entry point to StorageManager. + */ + public static void + networkSecurityPerimeterConfigurationList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.networkSecurityPerimeterConfigurations().list("res4410", "sto8607", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/NetworkSecurityPerimeterConfigurationsReconcileSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/NetworkSecurityPerimeterConfigurationsReconcileSamples.java new file mode 100644 index 0000000000000..d37e06f696365 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/NetworkSecurityPerimeterConfigurationsReconcileSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for NetworkSecurityPerimeterConfigurations Reconcile. + */ +public final class NetworkSecurityPerimeterConfigurationsReconcileSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * NetworkSecurityPerimeterConfigurationReconcile.json + */ + /** + * Sample code: NetworkSecurityPerimeterConfigurationReconcile. + * + * @param manager Entry point to StorageManager. + */ + public static void networkSecurityPerimeterConfigurationReconcile( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.networkSecurityPerimeterConfigurations() + .reconcile("res4410", "sto8607", "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationCreateOrUpdateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..41329c9415d53 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationCreateOrUpdateSamples.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicy; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicyFilter; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicyPropertiesMetrics; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicyRule; +import java.util.Arrays; + +/** + * Samples for ObjectReplicationPoliciesOperation CreateOrUpdate. + */ +public final class ObjectReplicationPoliciesOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountCreateObjectReplicationPolicyOnSource.json + */ + /** + * Sample code: StorageAccountCreateObjectReplicationPolicyOnSource. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateObjectReplicationPolicyOnSource( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.objectReplicationPoliciesOperations() + .define("2a20bb73-5717-4635-985a-5d4cf777438f") + .withExistingStorageAccount("res7687", "src1122") + .withSourceAccount("src1122") + .withDestinationAccount("dst112") + .withRules( + Arrays.asList(new ObjectReplicationPolicyRule().withRuleId("d5d18a48-8801-4554-aeaa-74faf65f5ef9") + .withSourceContainer("scont139") + .withDestinationContainer("dcont139") + .withFilters(new ObjectReplicationPolicyFilter().withPrefixMatch(Arrays.asList("blobA", "blobB")) + .withMinCreationTime("2020-02-19T16:05:00Z")))) + .withMetrics(new ObjectReplicationPolicyPropertiesMetrics().withEnabled(true)) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountCreateObjectReplicationPolicyOnDestination.json + */ + /** + * Sample code: StorageAccountCreateObjectReplicationPolicyOnDestination. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateObjectReplicationPolicyOnDestination( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.objectReplicationPoliciesOperations() + .define("default") + .withExistingStorageAccount("res7687", "dst112") + .withSourceAccount("src1122") + .withDestinationAccount("dst112") + .withRules(Arrays.asList(new ObjectReplicationPolicyRule().withSourceContainer("scont139") + .withDestinationContainer("dcont139") + .withFilters(new ObjectReplicationPolicyFilter().withPrefixMatch(Arrays.asList("blobA", "blobB"))))) + .withMetrics(new ObjectReplicationPolicyPropertiesMetrics().withEnabled(true)) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountUpdateObjectReplicationPolicyOnDestination.json + */ + /** + * Sample code: StorageAccountUpdateObjectReplicationPolicyOnDestination. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdateObjectReplicationPolicyOnDestination( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + ObjectReplicationPolicy resource = manager.objectReplicationPoliciesOperations() + .getWithResponse("res7687", "dst112", "2a20bb73-5717-4635-985a-5d4cf777438f", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withSourceAccount("src1122") + .withDestinationAccount("dst112") + .withRules(Arrays.asList( + new ObjectReplicationPolicyRule().withRuleId("d5d18a48-8801-4554-aeaa-74faf65f5ef9") + .withSourceContainer("scont139") + .withDestinationContainer("dcont139") + .withFilters(new ObjectReplicationPolicyFilter().withPrefixMatch(Arrays.asList("blobA", "blobB"))), + new ObjectReplicationPolicyRule().withSourceContainer("scont179").withDestinationContainer("dcont179"))) + .withMetrics(new ObjectReplicationPolicyPropertiesMetrics().withEnabled(true)) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountUpdateObjectReplicationPolicyOnSource.json + */ + /** + * Sample code: StorageAccountUpdateObjectReplicationPolicyOnSource. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdateObjectReplicationPolicyOnSource( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + ObjectReplicationPolicy resource = manager.objectReplicationPoliciesOperations() + .getWithResponse("res7687", "src1122", "2a20bb73-5717-4635-985a-5d4cf777438f", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withSourceAccount("src1122") + .withDestinationAccount("dst112") + .withRules(Arrays.asList( + new ObjectReplicationPolicyRule().withRuleId("d5d18a48-8801-4554-aeaa-74faf65f5ef9") + .withSourceContainer("scont139") + .withDestinationContainer("dcont139") + .withFilters(new ObjectReplicationPolicyFilter().withPrefixMatch(Arrays.asList("blobA", "blobB"))), + new ObjectReplicationPolicyRule().withRuleId("cfbb4bc2-8b60-429f-b05a-d1e0942b33b2") + .withSourceContainer("scont179") + .withDestinationContainer("dcont179"))) + .withMetrics(new ObjectReplicationPolicyPropertiesMetrics().withEnabled(true)) + .apply(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationDeleteSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationDeleteSamples.java new file mode 100644 index 0000000000000..6c74bd4b0a5cf --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for ObjectReplicationPoliciesOperation Delete. + */ +public final class ObjectReplicationPoliciesOperationDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountDeleteObjectReplicationPolicy.json + */ + /** + * Sample code: StorageAccountDeleteObjectReplicationPolicies. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountDeleteObjectReplicationPolicies( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.objectReplicationPoliciesOperations() + .deleteWithResponse("res6977", "sto2527", "{objectReplicationPolicy-Id}", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationGetSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationGetSamples.java new file mode 100644 index 0000000000000..8e74ee2c26950 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for ObjectReplicationPoliciesOperation Get. + */ +public final class ObjectReplicationPoliciesOperationGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountGetObjectReplicationPolicy.json + */ + /** + * Sample code: StorageAccountGetObjectReplicationPolicies. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountGetObjectReplicationPolicies(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.objectReplicationPoliciesOperations() + .getWithResponse("res6977", "sto2527", "{objectReplicationPolicy-Id}", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationListSamples.java new file mode 100644 index 0000000000000..4e9c9db842340 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/ObjectReplicationPoliciesOperationListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for ObjectReplicationPoliciesOperation List. + */ +public final class ObjectReplicationPoliciesOperationListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountListObjectReplicationPolicies.json + */ + /** + * Sample code: StorageAccountListObjectReplicationPolicies. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountListObjectReplicationPolicies( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.objectReplicationPoliciesOperations().list("res6977", "sto2527", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/OperationsListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..918293fd21c38 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/OperationsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/OperationsList.json + */ + /** + * Sample code: OperationsList. + * + * @param manager Entry point to StorageManager. + */ + public static void operationsList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..e7bb42919766a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for PrivateEndpointConnections Delete. + */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountDeletePrivateEndpointConnection.json + */ + /** + * Sample code: StorageAccountDeletePrivateEndpointConnection. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountDeletePrivateEndpointConnection( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.privateEndpointConnections() + .deleteWithResponse("res6977", "sto2527", "{privateEndpointConnectionName}", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 0000000000000..f1a9ec2381111 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for PrivateEndpointConnections Get. + */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountGetPrivateEndpointConnection.json + */ + /** + * Sample code: StorageAccountGetPrivateEndpointConnection. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountGetPrivateEndpointConnection(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.privateEndpointConnections() + .getWithResponse("res6977", "sto2527", "{privateEndpointConnectionName}", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsListSamples.java new file mode 100644 index 0000000000000..db299ebab9b2f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for PrivateEndpointConnections List. + */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountListPrivateEndpointConnections.json + */ + /** + * Sample code: StorageAccountListPrivateEndpointConnections. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountListPrivateEndpointConnections( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.privateEndpointConnections().list("res6977", "sto2527", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsPutSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsPutSamples.java new file mode 100644 index 0000000000000..474ea101d52fc --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateEndpointConnectionsPutSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.storage.generated.models.PrivateLinkServiceConnectionState; + +/** + * Samples for PrivateEndpointConnections Put. + */ +public final class PrivateEndpointConnectionsPutSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountPutPrivateEndpointConnection.json + */ + /** + * Sample code: StorageAccountPutPrivateEndpointConnection. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountPutPrivateEndpointConnection(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.privateEndpointConnections() + .define("{privateEndpointConnectionName}") + .withExistingStorageAccount("res7687", "sto9699") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Auto-Approved")) + .create(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateLinkResourcesListByStorageAccountSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateLinkResourcesListByStorageAccountSamples.java new file mode 100644 index 0000000000000..8b95d1c40e3b0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/PrivateLinkResourcesListByStorageAccountSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for PrivateLinkResources ListByStorageAccount. + */ +public final class PrivateLinkResourcesListByStorageAccountSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountListPrivateLinkResources.json + */ + /** + * Sample code: StorageAccountListPrivateLinkResources. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountListPrivateLinkResources(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.privateLinkResources() + .listByStorageAccountWithResponse("res6977", "sto2527", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueCreateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueCreateSamples.java new file mode 100644 index 0000000000000..f9ea3d642253e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueCreateSamples.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Queue Create. + */ +public final class QueueCreateSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/QueueOperationPut.json + */ + /** + * Sample code: QueueOperationPut. + * + * @param manager Entry point to StorageManager. + */ + public static void queueOperationPut(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queues().define("queue6185").withExistingStorageAccount("res3376", "sto328").create(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/QueueOperationPutWithMetadata + * .json + */ + /** + * Sample code: QueueOperationPutWithMetadata. + * + * @param manager Entry point to StorageManager. + */ + public static void + queueOperationPutWithMetadata(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queues() + .define("queue6185") + .withExistingStorageAccount("res3376", "sto328") + .withMetadata(mapOf("sample1", "meta1", "sample2", "meta2")) + .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/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueDeleteSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueDeleteSamples.java new file mode 100644 index 0000000000000..5338b56212656 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for Queue Delete. + */ +public final class QueueDeleteSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/QueueOperationDelete.json + */ + /** + * Sample code: QueueOperationDelete. + * + * @param manager Entry point to StorageManager. + */ + public static void queueOperationDelete(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queues().deleteWithResponse("res3376", "sto328", "queue6185", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueGetSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueGetSamples.java new file mode 100644 index 0000000000000..5c2b6f11e204c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for Queue Get. + */ +public final class QueueGetSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/QueueOperationGet.json + */ + /** + * Sample code: QueueOperationGet. + * + * @param manager Entry point to StorageManager. + */ + public static void queueOperationGet(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queues().getWithResponse("res3376", "sto328", "queue6185", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueListSamples.java new file mode 100644 index 0000000000000..0d3623285968d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for Queue List. + */ +public final class QueueListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/QueueOperationList.json + */ + /** + * Sample code: QueueOperationList. + * + * @param manager Entry point to StorageManager. + */ + public static void queueOperationList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queues().list("res9290", "sto328", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueServicesGetServicePropertiesSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueServicesGetServicePropertiesSamples.java new file mode 100644 index 0000000000000..b4e4acc0b0849 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueServicesGetServicePropertiesSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for QueueServices GetServiceProperties. + */ +public final class QueueServicesGetServicePropertiesSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/QueueServicesGet.json + */ + /** + * Sample code: QueueServicesGet. + * + * @param manager Entry point to StorageManager. + */ + public static void queueServicesGet(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queueServices() + .getServicePropertiesWithResponse("res4410", "sto8607", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueServicesListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueServicesListSamples.java new file mode 100644 index 0000000000000..db2b78aab30cb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueServicesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for QueueServices List. + */ +public final class QueueServicesListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/QueueServicesList.json + */ + /** + * Sample code: QueueServicesList. + * + * @param manager Entry point to StorageManager. + */ + public static void queueServicesList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queueServices().listWithResponse("res9290", "sto1590", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueServicesSetServicePropertiesSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueServicesSetServicePropertiesSamples.java new file mode 100644 index 0000000000000..0f70d1bc1687c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueServicesSetServicePropertiesSamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.AllowedMethods; +import com.azure.resourcemanager.storage.generated.models.CorsRule; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import java.util.Arrays; + +/** + * Samples for QueueServices SetServiceProperties. + */ +public final class QueueServicesSetServicePropertiesSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/QueueServicesPut.json + */ + /** + * Sample code: QueueServicesPut. + * + * @param manager Entry point to StorageManager. + */ + public static void queueServicesPut(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.queueServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withCors(new CorsRules().withCorsRules(Arrays.asList( + new CorsRule().withAllowedOrigins(Arrays.asList("http://www.contoso.com", "http://www.fabrikam.com")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET, AllowedMethods.HEAD, AllowedMethods.POST, + AllowedMethods.OPTIONS, AllowedMethods.MERGE, AllowedMethods.PUT)) + .withMaxAgeInSeconds(100) + .withExposedHeaders(Arrays.asList("x-ms-meta-*")) + .withAllowedHeaders(Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")), + new CorsRule().withAllowedOrigins(Arrays.asList("*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET)) + .withMaxAgeInSeconds(2) + .withExposedHeaders(Arrays.asList("*")) + .withAllowedHeaders(Arrays.asList("*")), + new CorsRule().withAllowedOrigins(Arrays.asList("http://www.abc23.com", "https://www.fabrikam.com/*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET, AllowedMethods.PUT)) + .withMaxAgeInSeconds(2000) + .withExposedHeaders(Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")) + .withAllowedHeaders(Arrays.asList("x-ms-meta-12345675754564*"))))) + .create(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueUpdateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueUpdateSamples.java new file mode 100644 index 0000000000000..e4e6cc535fb9a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/QueueUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.StorageQueue; + +/** + * Samples for Queue Update. + */ +public final class QueueUpdateSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/QueueOperationPatch.json + */ + /** + * Sample code: QueueOperationPatch. + * + * @param manager Entry point to StorageManager. + */ + public static void queueOperationPatch(com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageQueue resource = manager.queues() + .getWithResponse("res3376", "sto328", "queue6185", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/SkusListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/SkusListSamples.java new file mode 100644 index 0000000000000..61947e001fc15 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/SkusListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for Skus List. + */ +public final class SkusListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/SKUList.json + */ + /** + * Sample code: SkuList. + * + * @param manager Entry point to StorageManager. + */ + public static void skuList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.skus().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsAbortHierarchicalNamespaceMigrationSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsAbortHierarchicalNamespaceMigrationSamples.java new file mode 100644 index 0000000000000..8a65af70f3fce --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsAbortHierarchicalNamespaceMigrationSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for StorageAccounts AbortHierarchicalNamespaceMigration. + */ +public final class StorageAccountsAbortHierarchicalNamespaceMigrationSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountAbortHierarchicalNamespaceMigration.json + */ + /** + * Sample code: StorageAccountAbortHierarchicalNamespaceMigration. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountAbortHierarchicalNamespaceMigration( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .abortHierarchicalNamespaceMigration("res4228", "sto2434", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsCheckNameAvailabilitySamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsCheckNameAvailabilitySamples.java new file mode 100644 index 0000000000000..04ddab03287ed --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsCheckNameAvailabilitySamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.StorageAccountCheckNameAvailabilityParameters; + +/** + * Samples for StorageAccounts CheckNameAvailability. + */ +public final class StorageAccountsCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountCheckNameAvailability.json + */ + /** + * Sample code: StorageAccountCheckNameAvailability. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountCheckNameAvailability(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .checkNameAvailabilityWithResponse(new StorageAccountCheckNameAvailabilityParameters().withName("sto3363"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsCreateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsCreateSamples.java new file mode 100644 index 0000000000000..5000a865d9ad6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsCreateSamples.java @@ -0,0 +1,490 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.AccountImmutabilityPolicyProperties; +import com.azure.resourcemanager.storage.generated.models.AccountImmutabilityPolicyState; +import com.azure.resourcemanager.storage.generated.models.AllowedCopyScope; +import com.azure.resourcemanager.storage.generated.models.Bypass; +import com.azure.resourcemanager.storage.generated.models.DefaultAction; +import com.azure.resourcemanager.storage.generated.models.DnsEndpointType; +import com.azure.resourcemanager.storage.generated.models.Encryption; +import com.azure.resourcemanager.storage.generated.models.EncryptionIdentity; +import com.azure.resourcemanager.storage.generated.models.EncryptionService; +import com.azure.resourcemanager.storage.generated.models.EncryptionServices; +import com.azure.resourcemanager.storage.generated.models.ExpirationAction; +import com.azure.resourcemanager.storage.generated.models.ExtendedLocation; +import com.azure.resourcemanager.storage.generated.models.ExtendedLocationTypes; +import com.azure.resourcemanager.storage.generated.models.Identity; +import com.azure.resourcemanager.storage.generated.models.IdentityType; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageAccount; +import com.azure.resourcemanager.storage.generated.models.KeyPolicy; +import com.azure.resourcemanager.storage.generated.models.KeySource; +import com.azure.resourcemanager.storage.generated.models.KeyType; +import com.azure.resourcemanager.storage.generated.models.KeyVaultProperties; +import com.azure.resourcemanager.storage.generated.models.Kind; +import com.azure.resourcemanager.storage.generated.models.MinimumTlsVersion; +import com.azure.resourcemanager.storage.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.storage.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.storage.generated.models.RoutingChoice; +import com.azure.resourcemanager.storage.generated.models.RoutingPreference; +import com.azure.resourcemanager.storage.generated.models.SasPolicy; +import com.azure.resourcemanager.storage.generated.models.Sku; +import com.azure.resourcemanager.storage.generated.models.SkuName; +import com.azure.resourcemanager.storage.generated.models.UserAssignedIdentity; +import com.azure.resourcemanager.storage.generated.models.VirtualNetworkRule; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for StorageAccounts Create. + */ +public final class StorageAccountsCreateSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/NfsV3AccountCreate.json + */ + /** + * Sample code: NfsV3AccountCreate. + * + * @param manager Entry point to StorageManager. + */ + public static void nfsV3AccountCreate(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.PREMIUM_LRS)) + .withKind(Kind.BLOCK_BLOB_STORAGE) + .withNetworkRuleSet(new NetworkRuleSet().withBypass(Bypass.AZURE_SERVICES) + .withVirtualNetworkRules(Arrays.asList(new VirtualNetworkRule().withVirtualNetworkResourceId( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.Network/virtualNetworks/net123/subnets/subnet12"))) + .withIpRules(Arrays.asList()) + .withDefaultAction(DefaultAction.ALLOW)) + .withEnableHttpsTrafficOnly(false) + .withEnableExtendedGroups(true) + .withIsHnsEnabled(true) + .withEnableNfsV3(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountCreatePremiumBlockBlobStorage.json + */ + /** + * Sample code: StorageAccountCreatePremiumBlockBlobStorage. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreatePremiumBlockBlobStorage( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.PREMIUM_LRS)) + .withKind(Kind.BLOCK_BLOB_STORAGE) + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountCreateWithImmutabilityPolicy.json + */ + /** + * Sample code: StorageAccountCreateWithImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountCreateWithImmutabilityPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withExtendedLocation( + new ExtendedLocation().withName("losangeles001").withType(ExtendedLocationTypes.EDGE_ZONE)) + .withImmutableStorageWithVersioning(new ImmutableStorageAccount().withEnabled(true) + .withImmutabilityPolicy( + new AccountImmutabilityPolicyProperties().withImmutabilityPeriodSinceCreationInDays(15) + .withState(AccountImmutabilityPolicyState.UNLOCKED) + .withAllowProtectedAppendWrites(true))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountCreateAllowedCopyScopeToPrivateLink.json + */ + /** + * Sample code: StorageAccountCreateAllowedCopyScopeToPrivateLink. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateAllowedCopyScopeToPrivateLink( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withAllowedCopyScope(AllowedCopyScope.PRIVATE_LINK) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsHnsEnabled(true) + .withRoutingPreference(new RoutingPreference().withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .create(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountCreate.json + */ + /** + * Sample code: StorageAccountCreate. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreate(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withExtendedLocation( + new ExtendedLocation().withName("losangeles001").withType(ExtendedLocationTypes.EDGE_ZONE)) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsSftpEnabled(true) + .withIsHnsEnabled(true) + .withRoutingPreference(new RoutingPreference().withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .withDefaultToOAuthAuthentication(false) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountCreateEnablePublicNetworkAccess.json + */ + /** + * Sample code: StorageAccountCreateEnablePublicNetworkAccess. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateEnablePublicNetworkAccess( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withExtendedLocation( + new ExtendedLocation().withName("losangeles001").withType(ExtendedLocationTypes.EDGE_ZONE)) + .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsHnsEnabled(true) + .withRoutingPreference(new RoutingPreference().withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountCreateAllowedCopyScopeToAAD.json + */ + /** + * Sample code: StorageAccountCreateAllowedCopyScopeToAAD. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountCreateAllowedCopyScopeToAAD(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withAllowedCopyScope(AllowedCopyScope.AAD) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsHnsEnabled(true) + .withRoutingPreference(new RoutingPreference().withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountCreateUserAssignedIdentityWithFederatedIdentityClientId.json + */ + /** + * Sample code: StorageAccountCreateUserAssignedIdentityWithFederatedIdentityClientId. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateUserAssignedIdentityWithFederatedIdentityClientId( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .define("sto131918") + .withRegion("eastus") + .withExistingResourceGroup("res131918") + .withSku(new Sku().withName(SkuName.STANDARD_LRS)) + .withKind(Kind.STORAGE) + .withIdentity(new Identity().withType(IdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}", + new UserAssignedIdentity()))) + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_KEYVAULT) + .withKeyVaultProperties(new KeyVaultProperties().withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder") + .withKeyVaultUri("fakeTokenPlaceholder")) + .withEncryptionIdentity(new EncryptionIdentity().withEncryptionUserAssignedIdentity( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}") + .withEncryptionFederatedIdentityClientId("f83c6b1b-4d34-47e4-bb34-9d83df58b540"))) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountCreateDisallowPublicNetworkAccess.json + */ + /** + * Sample code: StorageAccountCreateDisallowPublicNetworkAccess. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateDisallowPublicNetworkAccess( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withExtendedLocation( + new ExtendedLocation().withName("losangeles001").withType(ExtendedLocationTypes.EDGE_ZONE)) + .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsHnsEnabled(true) + .withRoutingPreference(new RoutingPreference().withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountCreateDnsEndpointTypeToStandard.json + */ + /** + * Sample code: StorageAccountCreateDnsEndpointTypeToStandard. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateDnsEndpointTypeToStandard( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withExtendedLocation( + new ExtendedLocation().withName("losangeles001").withType(ExtendedLocationTypes.EDGE_ZONE)) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsSftpEnabled(true) + .withIsHnsEnabled(true) + .withRoutingPreference(new RoutingPreference().withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .withDefaultToOAuthAuthentication(false) + .withDnsEndpointType(DnsEndpointType.STANDARD) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountCreateDnsEndpointTypeToAzureDnsZone.json + */ + /** + * Sample code: StorageAccountCreateDnsEndpointTypeToAzureDnsZone. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateDnsEndpointTypeToAzureDnsZone( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_GRS)) + .withKind(Kind.STORAGE) + .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .withExtendedLocation( + new ExtendedLocation().withName("losangeles001").withType(ExtendedLocationTypes.EDGE_ZONE)) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE) + .withRequireInfrastructureEncryption(false)) + .withIsSftpEnabled(true) + .withIsHnsEnabled(true) + .withRoutingPreference(new RoutingPreference().withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .withDefaultToOAuthAuthentication(false) + .withDnsEndpointType(DnsEndpointType.AZURE_DNS_ZONE) + .create(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountCreateUserAssignedEncryptionIdentityWithCMK.json + */ + /** + * Sample code: StorageAccountCreateUserAssignedEncryptionIdentityWithCMK. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountCreateUserAssignedEncryptionIdentityWithCMK( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .define("sto4445") + .withRegion("eastus") + .withExistingResourceGroup("res9101") + .withSku(new Sku().withName(SkuName.STANDARD_LRS)) + .withKind(Kind.STORAGE) + .withIdentity(new Identity().withType(IdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}", + new UserAssignedIdentity()))) + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_KEYVAULT) + .withKeyVaultProperties(new KeyVaultProperties().withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder") + .withKeyVaultUri("fakeTokenPlaceholder")) + .withEncryptionIdentity(new EncryptionIdentity().withEncryptionUserAssignedIdentity( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}"))) + .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/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsCustomerInitiatedMigrationSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsCustomerInitiatedMigrationSamples.java new file mode 100644 index 0000000000000..87b5232ff9a26 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsCustomerInitiatedMigrationSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountMigrationInner; +import com.azure.resourcemanager.storage.generated.models.SkuName; + +/** + * Samples for StorageAccounts CustomerInitiatedMigration. + */ +public final class StorageAccountsCustomerInitiatedMigrationSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountPostMigration. + * json + */ + /** + * Sample code: StorageAccountPostMigration. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountPostMigration(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .customerInitiatedMigration("resource-group-name", "accountname", + new StorageAccountMigrationInner().withTargetSkuName(SkuName.STANDARD_ZRS), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsDeleteSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsDeleteSamples.java new file mode 100644 index 0000000000000..c2fff764c72c8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for StorageAccounts Delete. + */ +public final class StorageAccountsDeleteSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountDelete.json + */ + /** + * Sample code: StorageAccountDelete. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountDelete(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .deleteByResourceGroupWithResponse("res4228", "sto2434", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsFailoverSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsFailoverSamples.java new file mode 100644 index 0000000000000..4cc21b084cbb4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsFailoverSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.FailoverType; + +/** + * Samples for StorageAccounts Failover. + */ +public final class StorageAccountsFailoverSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountFailover.json + */ + /** + * Sample code: StorageAccountFailover. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountFailover(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().failover("res4228", "sto2434", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountFailoverPlanned + * .json + */ + /** + * Sample code: StorageAccountFailoverPlanned. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountFailoverPlanned(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .failover("res4228", "sto2434", FailoverType.PLANNED, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsGetByResourceGroupSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..f4a3663372abb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsGetByResourceGroupSamples.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.StorageAccountExpand; + +/** + * Samples for StorageAccounts GetByResourceGroup. + */ +public final class StorageAccountsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountGetPropertiesGeoReplicationStatscanFailoverTrue.json + */ + /** + * Sample code: StorageAccountGetPropertiesGeoReplicationStatscanFailoverTrue. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetPropertiesGeoReplicationStatscanFailoverTrue( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", StorageAccountExpand.GEO_REPLICATION_STATS, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountGetProperties. + * json + */ + /** + * Sample code: StorageAccountGetProperties. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetProperties(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountGetPropertiesCMKVersionExpirationTime.json + */ + /** + * Sample code: StorageAccountGetPropertiesCMKVersionExpirationTime. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetPropertiesCMKVersionExpirationTime( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountGetPropertiesGeoReplicationStatscanFailoverFalse.json + */ + /** + * Sample code: StorageAccountGetPropertiesGeoReplicationStatscanFailoverFalse. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountGetPropertiesGeoReplicationStatscanFailoverFalse( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", StorageAccountExpand.GEO_REPLICATION_STATS, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountGetAsyncSkuConversionStatus.json + */ + /** + * Sample code: StorageAccountGetAsyncSkuConversionStatus. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountGetAsyncSkuConversionStatus(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountGetPropertiesCMKEnabled.json + */ + /** + * Sample code: StorageAccountGetPropertiesCMKEnabled. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountGetPropertiesCMKEnabled(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsGetCustomerInitiatedMigrationSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsGetCustomerInitiatedMigrationSamples.java new file mode 100644 index 0000000000000..282151a442d10 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsGetCustomerInitiatedMigrationSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.MigrationName; + +/** + * Samples for StorageAccounts GetCustomerInitiatedMigration. + */ +public final class StorageAccountsGetCustomerInitiatedMigrationSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountGetMigrationInProgress.json + */ + /** + * Sample code: StorageAccountGetMigrationInProgress. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountGetMigrationInProgress(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .getCustomerInitiatedMigrationWithResponse("resource-group-name", "accountname", MigrationName.DEFAULT, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountGetMigrationFailed.json + */ + /** + * Sample code: StorageAccountGetMigrationFailed. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountGetMigrationFailed(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .getCustomerInitiatedMigrationWithResponse("resource-group-name", "accountname", MigrationName.DEFAULT, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsHierarchicalNamespaceMigrationSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsHierarchicalNamespaceMigrationSamples.java new file mode 100644 index 0000000000000..f68bd732894ee --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsHierarchicalNamespaceMigrationSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for StorageAccounts HierarchicalNamespaceMigration. + */ +public final class StorageAccountsHierarchicalNamespaceMigrationSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountHierarchicalNamespaceMigration.json + */ + /** + * Sample code: StorageAccountHierarchicalNamespaceMigration. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountHierarchicalNamespaceMigration( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .hierarchicalNamespaceMigration("res4228", "sto2434", "HnsOnValidationRequest", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListAccountSasSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListAccountSasSamples.java new file mode 100644 index 0000000000000..51a11404d8e16 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListAccountSasSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.AccountSasParameters; +import com.azure.resourcemanager.storage.generated.models.HttpProtocol; +import com.azure.resourcemanager.storage.generated.models.Permissions; +import com.azure.resourcemanager.storage.generated.models.Services; +import com.azure.resourcemanager.storage.generated.models.SignedResourceTypes; +import java.time.OffsetDateTime; + +/** + * Samples for StorageAccounts ListAccountSas. + */ +public final class StorageAccountsListAccountSasSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountListAccountSAS. + * json + */ + /** + * Sample code: StorageAccountListAccountSAS. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountListAccountSAS(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .listAccountSasWithResponse("res7985", "sto8588", + new AccountSasParameters().withServices(Services.B) + .withResourceTypes(SignedResourceTypes.S) + .withPermissions(Permissions.R) + .withProtocols(HttpProtocol.HTTPS_HTTP) + .withSharedAccessStartTime(OffsetDateTime.parse("2017-05-24T10:42:03.1567373Z")) + .withSharedAccessExpiryTime(OffsetDateTime.parse("2017-05-24T11:42:03.1567373Z")) + .withKeyToSign("fakeTokenPlaceholder"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListByResourceGroupSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..c8efee553355c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for StorageAccounts ListByResourceGroup. + */ +public final class StorageAccountsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountListByResourceGroup.json + */ + /** + * Sample code: StorageAccountListByResourceGroup. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountListByResourceGroup(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().listByResourceGroup("res6117", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListKeysSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListKeysSamples.java new file mode 100644 index 0000000000000..049e59ca0982e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListKeysSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for StorageAccounts ListKeys. + */ +public final class StorageAccountsListKeysSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountListKeys.json + */ + /** + * Sample code: StorageAccountListKeys. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountListKeys(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().listKeysWithResponse("res418", "sto2220", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListSamples.java new file mode 100644 index 0000000000000..296b5d76ff72d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for StorageAccounts List. + */ +public final class StorageAccountsListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountList.json + */ + /** + * Sample code: StorageAccountList. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListServiceSasSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListServiceSasSamples.java new file mode 100644 index 0000000000000..94a4520f09b69 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsListServiceSasSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.Permissions; +import com.azure.resourcemanager.storage.generated.models.ServiceSasParameters; +import com.azure.resourcemanager.storage.generated.models.SignedResource; +import java.time.OffsetDateTime; + +/** + * Samples for StorageAccounts ListServiceSas. + */ +public final class StorageAccountsListServiceSasSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountListServiceSAS. + * json + */ + /** + * Sample code: StorageAccountListServiceSAS. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountListServiceSAS(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .listServiceSasWithResponse("res7439", "sto1299", + new ServiceSasParameters().withCanonicalizedResource("/blob/sto1299/music") + .withResource(SignedResource.C) + .withPermissions(Permissions.L) + .withSharedAccessExpiryTime(OffsetDateTime.parse("2017-05-24T11:32:48.8457197Z")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsRegenerateKeySamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsRegenerateKeySamples.java new file mode 100644 index 0000000000000..d877bf1f3fb39 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsRegenerateKeySamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.StorageAccountRegenerateKeyParameters; + +/** + * Samples for StorageAccounts RegenerateKey. + */ +public final class StorageAccountsRegenerateKeySamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountRegenerateKey. + * json + */ + /** + * Sample code: StorageAccountRegenerateKey. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountRegenerateKey(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .regenerateKeyWithResponse("res4167", "sto3539", + new StorageAccountRegenerateKeyParameters().withKeyName("fakeTokenPlaceholder"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountRegenerateKerbKey.json + */ + /** + * Sample code: StorageAccountRegenerateKerbKey. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountRegenerateKerbKey(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .regenerateKeyWithResponse("res4167", "sto3539", + new StorageAccountRegenerateKeyParameters().withKeyName("fakeTokenPlaceholder"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsRestoreBlobRangesSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsRestoreBlobRangesSamples.java new file mode 100644 index 0000000000000..4010b77dcbdbb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsRestoreBlobRangesSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.BlobRestoreParameters; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreRange; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for StorageAccounts RestoreBlobRanges. + */ +public final class StorageAccountsRestoreBlobRangesSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/BlobRangesRestore.json + */ + /** + * Sample code: BlobRangesRestore. + * + * @param manager Entry point to StorageManager. + */ + public static void blobRangesRestore(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .restoreBlobRanges("res9101", "sto4445", + new BlobRestoreParameters().withTimeToRestore(OffsetDateTime.parse("2019-04-20T15:30:00.0000000Z")) + .withBlobRanges(Arrays.asList( + new BlobRestoreRange().withStartRange("container/blobpath1") + .withEndRange("container/blobpath2"), + new BlobRestoreRange().withStartRange("container2/blobpath3").withEndRange(""))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsRevokeUserDelegationKeysSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsRevokeUserDelegationKeysSamples.java new file mode 100644 index 0000000000000..aaf8741b91731 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsRevokeUserDelegationKeysSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for StorageAccounts RevokeUserDelegationKeys. + */ +public final class StorageAccountsRevokeUserDelegationKeysSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountRevokeUserDelegationKeys.json + */ + /** + * Sample code: StorageAccountRevokeUserDelegationKeys. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountRevokeUserDelegationKeys(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageAccounts() + .revokeUserDelegationKeysWithResponse("res4167", "sto3539", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsUpdateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsUpdateSamples.java new file mode 100644 index 0000000000000..46f8c0b809450 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageAccountsUpdateSamples.java @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.AccountImmutabilityPolicyProperties; +import com.azure.resourcemanager.storage.generated.models.AccountImmutabilityPolicyState; +import com.azure.resourcemanager.storage.generated.models.AccountType; +import com.azure.resourcemanager.storage.generated.models.ActiveDirectoryProperties; +import com.azure.resourcemanager.storage.generated.models.AllowedCopyScope; +import com.azure.resourcemanager.storage.generated.models.AzureFilesIdentityBasedAuthentication; +import com.azure.resourcemanager.storage.generated.models.DefaultAction; +import com.azure.resourcemanager.storage.generated.models.DirectoryServiceOptions; +import com.azure.resourcemanager.storage.generated.models.Encryption; +import com.azure.resourcemanager.storage.generated.models.EncryptionIdentity; +import com.azure.resourcemanager.storage.generated.models.EncryptionService; +import com.azure.resourcemanager.storage.generated.models.EncryptionServices; +import com.azure.resourcemanager.storage.generated.models.ExpirationAction; +import com.azure.resourcemanager.storage.generated.models.Identity; +import com.azure.resourcemanager.storage.generated.models.IdentityType; +import com.azure.resourcemanager.storage.generated.models.ImmutableStorageAccount; +import com.azure.resourcemanager.storage.generated.models.KeyPolicy; +import com.azure.resourcemanager.storage.generated.models.KeySource; +import com.azure.resourcemanager.storage.generated.models.KeyType; +import com.azure.resourcemanager.storage.generated.models.KeyVaultProperties; +import com.azure.resourcemanager.storage.generated.models.Kind; +import com.azure.resourcemanager.storage.generated.models.MinimumTlsVersion; +import com.azure.resourcemanager.storage.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.storage.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.storage.generated.models.ResourceAccessRule; +import com.azure.resourcemanager.storage.generated.models.RoutingChoice; +import com.azure.resourcemanager.storage.generated.models.RoutingPreference; +import com.azure.resourcemanager.storage.generated.models.SasPolicy; +import com.azure.resourcemanager.storage.generated.models.Sku; +import com.azure.resourcemanager.storage.generated.models.SkuName; +import com.azure.resourcemanager.storage.generated.models.StorageAccount; +import com.azure.resourcemanager.storage.generated.models.UserAssignedIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for StorageAccounts Update. + */ +public final class StorageAccountsUpdateSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountUpdateWithImmutabilityPolicy.json + */ + /** + * Sample code: StorageAccountUpdateWithImmutabilityPolicy. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountUpdateWithImmutabilityPolicy(com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = manager.storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withImmutableStorageWithVersioning(new ImmutableStorageAccount().withEnabled(true) + .withImmutabilityPolicy( + new AccountImmutabilityPolicyProperties().withImmutabilityPeriodSinceCreationInDays(15) + .withState(AccountImmutabilityPolicyState.LOCKED) + .withAllowProtectedAppendWrites(true))) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountUpdateUserAssignedIdentityWithFederatedIdentityClientId.json + */ + /** + * Sample code: StorageAccountUpdateUserAssignedIdentityWithFederatedIdentityClientId. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdateUserAssignedIdentityWithFederatedIdentityClientId( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = manager.storageAccounts() + .getByResourceGroupWithResponse("res131918", "sto131918", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withSku(new Sku().withName(SkuName.STANDARD_LRS)) + .withIdentity(new Identity().withType(IdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}", + new UserAssignedIdentity()))) + .withKind(Kind.STORAGE) + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_KEYVAULT) + .withKeyVaultProperties(new KeyVaultProperties().withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder") + .withKeyVaultUri("fakeTokenPlaceholder")) + .withEncryptionIdentity(new EncryptionIdentity().withEncryptionUserAssignedIdentity( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}") + .withEncryptionFederatedIdentityClientId("3109d1c4-a5de-4d84-8832-feabb916a4b6"))) + .apply(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountEnableAD.json + */ + /** + * Sample code: StorageAccountEnableAD. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountEnableAD(com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = manager.storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withAzureFilesIdentityBasedAuthentication( + new AzureFilesIdentityBasedAuthentication().withDirectoryServiceOptions(DirectoryServiceOptions.AD) + .withActiveDirectoryProperties(new ActiveDirectoryProperties().withDomainName("adtest.com") + .withNetBiosDomainName("adtest.com") + .withForestName("adtest.com") + .withDomainGuid("aebfc118-9fa9-4732-a21f-d98e41a77ae1") + .withDomainSid("S-1-5-21-2400535526-2334094090-2402026252") + .withAzureStorageSid("S-1-5-21-2400535526-2334094090-2402026252-0012") + .withSamAccountName("sam12498") + .withAccountType(AccountType.USER))) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountUpdateAllowedCopyScopeToAAD.json + */ + /** + * Sample code: StorageAccountUpdateAllowedCopyScopeToAAD. + * + * @param manager Entry point to StorageManager. + */ + public static void + storageAccountUpdateAllowedCopyScopeToAAD(com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = manager.storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE)) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withNetworkRuleSet(new NetworkRuleSet().withResourceAccessRules(Arrays.asList(new ResourceAccessRule() + .withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47") + .withResourceId( + "/subscriptions/a7e99807-abbf-4642-bdec-2c809a96a8bc/resourceGroups/res9407/providers/Microsoft.Synapse/workspaces/testworkspace"))) + .withDefaultAction(DefaultAction.ALLOW)) + .withRoutingPreference(new RoutingPreference().withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .withAllowedCopyScope(AllowedCopyScope.AAD) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountUpdateDisablePublicNetworkAccess.json + */ + /** + * Sample code: StorageAccountUpdateDisablePublicNetworkAccess. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdateDisablePublicNetworkAccess( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = manager.storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE)) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withNetworkRuleSet(new NetworkRuleSet().withResourceAccessRules(Arrays.asList(new ResourceAccessRule() + .withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47") + .withResourceId( + "/subscriptions/a7e99807-abbf-4642-bdec-2c809a96a8bc/resourceGroups/res9407/providers/Microsoft.Synapse/workspaces/testworkspace"))) + .withDefaultAction(DefaultAction.ALLOW)) + .withRoutingPreference(new RoutingPreference().withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) + .apply(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountEnableCMK.json + */ + /** + * Sample code: StorageAccountEnableCMK. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountEnableCMK(com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = manager.storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_KEYVAULT) + .withKeyVaultProperties(new KeyVaultProperties().withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder") + .withKeyVaultUri("fakeTokenPlaceholder"))) + .apply(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/StorageAccountUpdate.json + */ + /** + * Sample code: StorageAccountUpdate. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdate(com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = manager.storageAccounts() + .getByResourceGroupWithResponse("res9407", "sto8596", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_STORAGE)) + .withSasPolicy( + new SasPolicy().withSasExpirationPeriod("1.15:59:59").withExpirationAction(ExpirationAction.LOG)) + .withKeyPolicy(new KeyPolicy().withKeyExpirationPeriodInDays(20)) + .withIsSftpEnabled(true) + .withIsLocalUserEnabled(true) + .withEnableExtendedGroups(true) + .withNetworkRuleSet(new NetworkRuleSet().withResourceAccessRules(Arrays.asList(new ResourceAccessRule() + .withTenantId("72f988bf-86f1-41af-91ab-2d7cd011db47") + .withResourceId( + "/subscriptions/a7e99807-abbf-4642-bdec-2c809a96a8bc/resourceGroups/res9407/providers/Microsoft.Synapse/workspaces/testworkspace"))) + .withDefaultAction(DefaultAction.ALLOW)) + .withRoutingPreference(new RoutingPreference().withRoutingChoice(RoutingChoice.MICROSOFT_ROUTING) + .withPublishMicrosoftEndpoints(true) + .withPublishInternetEndpoints(true)) + .withAllowBlobPublicAccess(false) + .withMinimumTlsVersion(MinimumTlsVersion.TLS1_2) + .withAllowSharedKeyAccess(true) + .withDefaultToOAuthAuthentication(false) + .apply(); + } + + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountUpdateUserAssignedEncryptionIdentityWithCMK.json + */ + /** + * Sample code: StorageAccountUpdateUserAssignedEncryptionIdentityWithCMK. + * + * @param manager Entry point to StorageManager. + */ + public static void storageAccountUpdateUserAssignedEncryptionIdentityWithCMK( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageAccount resource = manager.storageAccounts() + .getByResourceGroupWithResponse("res9101", "sto4445", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withSku(new Sku().withName(SkuName.STANDARD_LRS)) + .withIdentity(new Identity().withType(IdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}", + new UserAssignedIdentity()))) + .withKind(Kind.STORAGE) + .withEncryption(new Encryption() + .withServices(new EncryptionServices() + .withBlob(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT)) + .withFile(new EncryptionService().withEnabled(true).withKeyType(KeyType.ACCOUNT))) + .withKeySource(KeySource.MICROSOFT_KEYVAULT) + .withKeyVaultProperties(new KeyVaultProperties().withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder") + .withKeyVaultUri("fakeTokenPlaceholder")) + .withEncryptionIdentity(new EncryptionIdentity().withEncryptionUserAssignedIdentity( + "/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{managed-identity-name}"))) + .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/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageTaskAssignmentInstancesReportListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageTaskAssignmentInstancesReportListSamples.java new file mode 100644 index 0000000000000..f2bfd1026145d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageTaskAssignmentInstancesReportListSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for StorageTaskAssignmentInstancesReport List. + */ +public final class StorageTaskAssignmentInstancesReportListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/storageTaskAssignmentsList/ + * ListStorageTaskAssignmentInstancesReportSummary.json + */ + /** + * Sample code: ListStorageTaskAssignmentInstancesReportSummary. + * + * @param manager Entry point to StorageManager. + */ + public static void listStorageTaskAssignmentInstancesReportSummary( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageTaskAssignmentInstancesReports() + .list("res4228", "sto4445", "myassignment1", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageTaskAssignmentsCreateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageTaskAssignmentsCreateSamples.java new file mode 100644 index 0000000000000..ebf415af6af1d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageTaskAssignmentsCreateSamples.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.ExecutionTarget; +import com.azure.resourcemanager.storage.generated.models.ExecutionTrigger; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignmentExecutionContext; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignmentProperties; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignmentReport; +import com.azure.resourcemanager.storage.generated.models.TriggerParameters; +import com.azure.resourcemanager.storage.generated.models.TriggerType; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for StorageTaskAssignments Create. + */ +public final class StorageTaskAssignmentsCreateSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/storageTaskAssignmentsCrud/ + * PutStorageTaskAssignment.json + */ + /** + * Sample code: PutStorageTaskAssignment. + * + * @param manager Entry point to StorageManager. + */ + public static void putStorageTaskAssignment(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageTaskAssignments() + .define("myassignment1") + .withExistingStorageAccount("res4228", "sto4445") + .withProperties(new StorageTaskAssignmentProperties().withTaskId( + "/subscriptions/1f31ba14-ce16-4281-b9b4-3e78da6e1616/resourceGroups/res4228/providers/Microsoft.StorageActions/storageTasks/mytask1") + .withEnabled(true) + .withDescription("My Storage task assignment") + .withExecutionContext( + new StorageTaskAssignmentExecutionContext() + .withTarget(new ExecutionTarget().withPrefix(Arrays.asList("prefix1", "prefix2")) + .withExcludePrefix(Arrays.asList())) + .withTrigger(new ExecutionTrigger().withType(TriggerType.RUN_ONCE) + .withParameters(new TriggerParameters() + .withStartOn(OffsetDateTime.parse("2022-11-15T21:52:47.8145095Z"))))) + .withReport(new StorageTaskAssignmentReport().withPrefix("container1"))) + .create(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/storageTaskAssignmentsCrud/ + * PutStorageTaskAssignmentRequiredProperties.json + */ + /** + * Sample code: PutStorageTaskAssignmentRequiredProperties. + * + * @param manager Entry point to StorageManager. + */ + public static void + putStorageTaskAssignmentRequiredProperties(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageTaskAssignments() + .define("myassignment1") + .withExistingStorageAccount("res4228", "sto4445") + .withProperties(new StorageTaskAssignmentProperties().withTaskId( + "/subscriptions/1f31ba14-ce16-4281-b9b4-3e78da6e1616/resourceGroups/res4228/providers/Microsoft.StorageActions/storageTasks/mytask1") + .withEnabled(true) + .withDescription("My Storage task assignment") + .withExecutionContext( + new StorageTaskAssignmentExecutionContext() + .withTrigger(new ExecutionTrigger().withType(TriggerType.RUN_ONCE) + .withParameters(new TriggerParameters() + .withStartOn(OffsetDateTime.parse("2022-11-15T21:52:47.8145095Z"))))) + .withReport(new StorageTaskAssignmentReport().withPrefix("container1"))) + .create(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageTaskAssignmentsDeleteSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageTaskAssignmentsDeleteSamples.java new file mode 100644 index 0000000000000..7f166bd94df32 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageTaskAssignmentsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for StorageTaskAssignments Delete. + */ +public final class StorageTaskAssignmentsDeleteSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/storageTaskAssignmentsCrud/ + * DeleteStorageTaskAssignment.json + */ + /** + * Sample code: DeleteStorageTaskAssignment. + * + * @param manager Entry point to StorageManager. + */ + public static void deleteStorageTaskAssignment(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageTaskAssignments() + .delete("res4228", "sto4445", "myassignment1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageTaskAssignmentsGetSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageTaskAssignmentsGetSamples.java new file mode 100644 index 0000000000000..aedb277cde037 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageTaskAssignmentsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for StorageTaskAssignments Get. + */ +public final class StorageTaskAssignmentsGetSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/storageTaskAssignmentsCrud/ + * GetStorageTaskAssignment.json + */ + /** + * Sample code: GetStorageTaskAssignment. + * + * @param manager Entry point to StorageManager. + */ + public static void getStorageTaskAssignment(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageTaskAssignments() + .getWithResponse("res4228", "sto4445", "myassignment1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageTaskAssignmentsInstancesReportListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageTaskAssignmentsInstancesReportListSamples.java new file mode 100644 index 0000000000000..5f11f86d8175a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageTaskAssignmentsInstancesReportListSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for StorageTaskAssignmentsInstancesReport List. + */ +public final class StorageTaskAssignmentsInstancesReportListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/storageTaskAssignmentsList/ + * ListStorageTaskAssignmentsInstancesReportSummary.json + */ + /** + * Sample code: ListStorageTaskAssignmentsInstancesReportSummary. + * + * @param manager Entry point to StorageManager. + */ + public static void listStorageTaskAssignmentsInstancesReportSummary( + com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageTaskAssignmentsInstancesReports() + .list("res4228", "sto4445", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageTaskAssignmentsListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageTaskAssignmentsListSamples.java new file mode 100644 index 0000000000000..14d5550acbe89 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageTaskAssignmentsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for StorageTaskAssignments List. + */ +public final class StorageTaskAssignmentsListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/storageTaskAssignmentsList/ + * ListStorageTaskAssignmentsForAccount.json + */ + /** + * Sample code: ListStorageTaskAssignmentsForAccount. + * + * @param manager Entry point to StorageManager. + */ + public static void + listStorageTaskAssignmentsForAccount(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.storageTaskAssignments().list("res4228", "sto4445", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageTaskAssignmentsUpdateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageTaskAssignmentsUpdateSamples.java new file mode 100644 index 0000000000000..1c1fb668a9e65 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/StorageTaskAssignmentsUpdateSamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.ExecutionTarget; +import com.azure.resourcemanager.storage.generated.models.ExecutionTriggerUpdate; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignment; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignmentUpdateExecutionContext; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignmentUpdateProperties; +import com.azure.resourcemanager.storage.generated.models.StorageTaskAssignmentUpdateReport; +import com.azure.resourcemanager.storage.generated.models.TriggerParametersUpdate; +import com.azure.resourcemanager.storage.generated.models.TriggerType; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for StorageTaskAssignments Update. + */ +public final class StorageTaskAssignmentsUpdateSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/storageTaskAssignmentsCrud/ + * PatchStorageTaskAssignment.json + */ + /** + * Sample code: PatchStorageTaskAssignment. + * + * @param manager Entry point to StorageManager. + */ + public static void patchStorageTaskAssignment(com.azure.resourcemanager.storage.generated.StorageManager manager) { + StorageTaskAssignment resource = manager.storageTaskAssignments() + .getWithResponse("res4228", "sto4445", "myassignment1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new StorageTaskAssignmentUpdateProperties().withEnabled(true) + .withDescription("My Storage task assignment") + .withExecutionContext(new StorageTaskAssignmentUpdateExecutionContext() + .withTarget(new ExecutionTarget().withPrefix(Arrays.asList("prefix1", "prefix2")) + .withExcludePrefix(Arrays.asList())) + .withTrigger(new ExecutionTriggerUpdate().withType(TriggerType.RUN_ONCE) + .withParameters(new TriggerParametersUpdate() + .withStartOn(OffsetDateTime.parse("2022-11-15T21:52:47.8145095Z"))))) + .withReport(new StorageTaskAssignmentUpdateReport().withPrefix("container1"))) + .apply(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableCreateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableCreateSamples.java new file mode 100644 index 0000000000000..ea13c0be6a0e2 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableCreateSamples.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.TableAccessPolicy; +import com.azure.resourcemanager.storage.generated.models.TableSignedIdentifier; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for Table Create. + */ +public final class TableCreateSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/TableOperationPut.json + */ + /** + * Sample code: TableOperationPut. + * + * @param manager Entry point to StorageManager. + */ + public static void tableOperationPut(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tables().define("table6185").withExistingStorageAccount("res3376", "sto328").create(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/TableOperationPutOrPatchAcls. + * json + */ + /** + * Sample code: TableOperationPutOrPatchAcls. + * + * @param manager Entry point to StorageManager. + */ + public static void + tableOperationPutOrPatchAcls(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tables() + .define("table6185") + .withExistingStorageAccount("res3376", "sto328") + .withSignedIdentifiers(Arrays.asList( + new TableSignedIdentifier().withId("MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI") + .withAccessPolicy( + new TableAccessPolicy().withStartTime(OffsetDateTime.parse("2022-03-17T08:49:37.0000000Z")) + .withExpiryTime(OffsetDateTime.parse("2022-03-20T08:49:37.0000000Z")) + .withPermission("raud")), + new TableSignedIdentifier().withId("PTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODklMTI") + .withAccessPolicy( + new TableAccessPolicy().withStartTime(OffsetDateTime.parse("2022-03-17T08:49:37.0000000Z")) + .withExpiryTime(OffsetDateTime.parse("2022-03-20T08:49:37.0000000Z")) + .withPermission("rad")))) + .create(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableDeleteSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableDeleteSamples.java new file mode 100644 index 0000000000000..7b195f4b30646 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for Table Delete. + */ +public final class TableDeleteSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/TableOperationDelete.json + */ + /** + * Sample code: TableOperationDelete. + * + * @param manager Entry point to StorageManager. + */ + public static void tableOperationDelete(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tables().deleteWithResponse("res3376", "sto328", "table6185", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableGetSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableGetSamples.java new file mode 100644 index 0000000000000..e7ddd9a268ecb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for Table Get. + */ +public final class TableGetSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/TableOperationGet.json + */ + /** + * Sample code: TableOperationGet. + * + * @param manager Entry point to StorageManager. + */ + public static void tableOperationGet(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tables().getWithResponse("res3376", "sto328", "table6185", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableListSamples.java new file mode 100644 index 0000000000000..95150d9f37be6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for Table List. + */ +public final class TableListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/TableOperationList.json + */ + /** + * Sample code: TableOperationList. + * + * @param manager Entry point to StorageManager. + */ + public static void tableOperationList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tables().list("res9290", "sto328", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableServicesGetServicePropertiesSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableServicesGetServicePropertiesSamples.java new file mode 100644 index 0000000000000..da880e0c7e1dd --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableServicesGetServicePropertiesSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for TableServices GetServiceProperties. + */ +public final class TableServicesGetServicePropertiesSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/TableServicesGet.json + */ + /** + * Sample code: TableServicesGet. + * + * @param manager Entry point to StorageManager. + */ + public static void tableServicesGet(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tableServices() + .getServicePropertiesWithResponse("res4410", "sto8607", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableServicesListSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableServicesListSamples.java new file mode 100644 index 0000000000000..0c746aa99caf0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableServicesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for TableServices List. + */ +public final class TableServicesListSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/TableServicesList.json + */ + /** + * Sample code: TableServicesList. + * + * @param manager Entry point to StorageManager. + */ + public static void tableServicesList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tableServices().listWithResponse("res9290", "sto1590", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableServicesSetServicePropertiesSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableServicesSetServicePropertiesSamples.java new file mode 100644 index 0000000000000..f85e4f6311a4a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableServicesSetServicePropertiesSamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.AllowedMethods; +import com.azure.resourcemanager.storage.generated.models.CorsRule; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import java.util.Arrays; + +/** + * Samples for TableServices SetServiceProperties. + */ +public final class TableServicesSetServicePropertiesSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/TableServicesPut.json + */ + /** + * Sample code: TableServicesPut. + * + * @param manager Entry point to StorageManager. + */ + public static void tableServicesPut(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.tableServices() + .define() + .withExistingStorageAccount("res4410", "sto8607") + .withCors(new CorsRules().withCorsRules(Arrays.asList( + new CorsRule().withAllowedOrigins(Arrays.asList("http://www.contoso.com", "http://www.fabrikam.com")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET, AllowedMethods.HEAD, AllowedMethods.POST, + AllowedMethods.OPTIONS, AllowedMethods.MERGE, AllowedMethods.PUT)) + .withMaxAgeInSeconds(100) + .withExposedHeaders(Arrays.asList("x-ms-meta-*")) + .withAllowedHeaders(Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")), + new CorsRule().withAllowedOrigins(Arrays.asList("*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET)) + .withMaxAgeInSeconds(2) + .withExposedHeaders(Arrays.asList("*")) + .withAllowedHeaders(Arrays.asList("*")), + new CorsRule().withAllowedOrigins(Arrays.asList("http://www.abc23.com", "https://www.fabrikam.com/*")) + .withAllowedMethods(Arrays.asList(AllowedMethods.GET, AllowedMethods.PUT)) + .withMaxAgeInSeconds(2000) + .withExposedHeaders(Arrays.asList("x-ms-meta-abc", "x-ms-meta-data*", "x-ms-meta-target*")) + .withAllowedHeaders(Arrays.asList("x-ms-meta-12345675754564*"))))) + .create(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableUpdateSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableUpdateSamples.java new file mode 100644 index 0000000000000..9d9fe061eee71 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/TableUpdateSamples.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +import com.azure.resourcemanager.storage.generated.models.Table; +import com.azure.resourcemanager.storage.generated.models.TableAccessPolicy; +import com.azure.resourcemanager.storage.generated.models.TableSignedIdentifier; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for Table Update. + */ +public final class TableUpdateSamples { + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/TableOperationPutOrPatchAcls. + * json + */ + /** + * Sample code: TableOperationPutOrPatchAcls. + * + * @param manager Entry point to StorageManager. + */ + public static void + tableOperationPutOrPatchAcls(com.azure.resourcemanager.storage.generated.StorageManager manager) { + Table resource = manager.tables() + .getWithResponse("res3376", "sto328", "table6185", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withSignedIdentifiers(Arrays.asList( + new TableSignedIdentifier().withId("MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI") + .withAccessPolicy( + new TableAccessPolicy().withStartTime(OffsetDateTime.parse("2022-03-17T08:49:37.0000000Z")) + .withExpiryTime(OffsetDateTime.parse("2022-03-20T08:49:37.0000000Z")) + .withPermission("raud")), + new TableSignedIdentifier().withId("PTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODklMTI") + .withAccessPolicy( + new TableAccessPolicy().withStartTime(OffsetDateTime.parse("2022-03-17T08:49:37.0000000Z")) + .withExpiryTime(OffsetDateTime.parse("2022-03-20T08:49:37.0000000Z")) + .withPermission("rad")))) + .apply(); + } + + /* + * x-ms-original-file: + * specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/TableOperationPatch.json + */ + /** + * Sample code: TableOperationPatch. + * + * @param manager Entry point to StorageManager. + */ + public static void tableOperationPatch(com.azure.resourcemanager.storage.generated.StorageManager manager) { + Table resource = manager.tables() + .getWithResponse("res3376", "sto328", "table6185", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/UsagesListByLocationSamples.java b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/UsagesListByLocationSamples.java new file mode 100644 index 0000000000000..d75c2d2beadbf --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/samples/java/com/azure/resourcemanager/storage/generated/generated/UsagesListByLocationSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.generated; + +/** + * Samples for Usages ListByLocation. + */ +public final class UsagesListByLocationSamples { + /* + * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2024-01-01/examples/ + * StorageAccountListLocationUsage.json + */ + /** + * Sample code: UsageList. + * + * @param manager Entry point to StorageManager. + */ + public static void usageList(com.azure.resourcemanager.storage.generated.StorageManager manager) { + manager.usages().listByLocation("eastus2(stage)", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 59885d09159c7..8f2170a57094a 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -70,46 +70,50 @@ pr: - sdk/storage/azure-storage-queue/pom.xml parameters: -- name: release_azurestoragecommon - displayName: 'azure-storage-common' - type: boolean - default: true -- name: release_azurestorageblob - displayName: 'azure-storage-blob' - type: boolean - default: true -- name: release_azurestorageblobbatch - displayName: 'azure-storage-blob-batch' - type: boolean - default: true -- name: release_azurestorageblobchangefeed - displayName: 'azure-storage-blob-changefeed' - type: boolean - default: true -- name: release_azurestorageblobcryptography - displayName: 'azure-storage-blob-cryptography' - type: boolean - default: true -- name: release_azurestorageblobnio - displayName: 'azure-storage-blob-nio' - type: boolean - default: true -- name: release_azurestoragefileshare - displayName: 'azure-storage-file-share' - type: boolean - default: true -- name: release_azurestoragefiledatalake - displayName: 'azure-storage-file-datalake' - type: boolean - default: true -- name: release_azurestorageinternalavro - displayName: 'azure-storage-internal-avro' - type: boolean - default: true -- name: release_azurestoragequeue - displayName: 'azure-storage-queue' - type: boolean - default: true + - name: release_azurestoragecommon + displayName: azure-storage-common + type: boolean + default: true + - name: release_azurestorageblob + displayName: azure-storage-blob + type: boolean + default: true + - name: release_azurestorageblobbatch + displayName: azure-storage-blob-batch + type: boolean + default: true + - name: release_azurestorageblobchangefeed + displayName: azure-storage-blob-changefeed + type: boolean + default: true + - name: release_azurestorageblobcryptography + displayName: azure-storage-blob-cryptography + type: boolean + default: true + - name: release_azurestorageblobnio + displayName: azure-storage-blob-nio + type: boolean + default: true + - name: release_azurestoragefileshare + displayName: azure-storage-file-share + type: boolean + default: true + - name: release_azurestoragefiledatalake + displayName: azure-storage-file-datalake + type: boolean + default: true + - name: release_azurestorageinternalavro + displayName: azure-storage-internal-avro + type: boolean + default: true + - name: release_azurestoragequeue + displayName: azure-storage-queue + type: boolean + default: true + - name: release_azureresourcemanagerstoragegenerated + displayName: azure-resourcemanager-storage-generated + type: boolean + default: false extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -158,10 +162,13 @@ extends: groupId: com.azure safeName: azurestoragequeue releaseInBatch: ${{ parameters.release_azurestoragequeue }} + - name: azure-resourcemanager-storage-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerstoragegenerated + releaseInBatch: ${{ parameters.release_azureresourcemanagerstoragegenerated }} AdditionalModules: - name: azure-storage-perf groupId: com.azure - # required by the above perf library - name: perf-test-core groupId: com.azure - name: azure-aot-graalvm-perf diff --git a/sdk/storage/pom.xml b/sdk/storage/pom.xml index 60a3b0e7d3a37..63f79e73ec08c 100644 --- a/sdk/storage/pom.xml +++ b/sdk/storage/pom.xml @@ -9,20 +9,21 @@ pom 1.0.0 - azure-storage-common - azure-storage-blob - azure-storage-blob-batch - azure-storage-blob-changefeed - azure-storage-blob-cryptography - azure-storage-blob-nio - azure-storage-file-share - azure-storage-file-datalake - azure-storage-internal-avro - azure-storage-queue - azure-storage-perf + azure-resourcemanager-storage-generated + azure-storage-blob + azure-storage-blob-batch + azure-storage-blob-changefeed + azure-storage-blob-cryptography + azure-storage-blob-nio azure-storage-blob-stress - azure-storage-stress + azure-storage-common + azure-storage-file-datalake azure-storage-file-datalake-stress + azure-storage-file-share azure-storage-file-share-stress + azure-storage-internal-avro + azure-storage-perf + azure-storage-queue + azure-storage-stress