diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 342f84b97c160..6daa399bdec6a 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -300,6 +300,7 @@ com.azure.resourcemanager:azure-resourcemanager-maps;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-botservice;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-recoveryservicesbackup;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-deviceprovisioningservices;1.0.0;1.1.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-storage-generated;1.0.0-beta.1;1.0.0-beta.1 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current # version. Unreleased dependencies are only valid for dependency versions. 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..5cb9c220136ef --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-07-02) + +- 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-2021-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). 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..534de02386d6a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/README.md @@ -0,0 +1,101 @@ +# 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-2021-04. 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] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by 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 + + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md 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..4fd71a523a4c5 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/pom.xml @@ -0,0 +1,86 @@ + + 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-2021-04. + 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 + + + + + com.azure + azure-core + 1.18.0 + + + com.azure + azure-core-management + 1.3.1 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + + 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..e2105826bd957 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/StorageManager.java @@ -0,0 +1,446 @@ +// Copyright (c) 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.policy.AddDatePolicy; +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.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +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.ManagementPoliciesImpl; +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.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.ManagementPolicies; +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.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; + +/** Entry point to StorageManager. The Azure Storage Management API. */ +public final class StorageManager { + 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 EncryptionScopes encryptionScopes; + + private BlobServices blobServices; + + private BlobContainers blobContainers; + + private FileServices fileServices; + + private FileShares fileShares; + + private QueueServices queueServices; + + private Queues queues; + + private TableServices tableServices; + + private Tables tables; + + 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); + } + + /** + * 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 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 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 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, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' 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) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies); + 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); + } + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of Skus. */ + public Skus skus() { + if (this.skus == null) { + this.skus = new SkusImpl(clientObject.getSkus(), this); + } + return skus; + } + + /** @return Resource collection API of StorageAccounts. */ + public StorageAccounts storageAccounts() { + if (this.storageAccounts == null) { + this.storageAccounts = new StorageAccountsImpl(clientObject.getStorageAccounts(), this); + } + return storageAccounts; + } + + /** @return Resource collection API of DeletedAccounts. */ + public DeletedAccounts deletedAccounts() { + if (this.deletedAccounts == null) { + this.deletedAccounts = new DeletedAccountsImpl(clientObject.getDeletedAccounts(), this); + } + return deletedAccounts; + } + + /** @return Resource collection API of Usages. */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(clientObject.getUsages(), this); + } + return usages; + } + + /** @return Resource collection API of ManagementPolicies. */ + public ManagementPolicies managementPolicies() { + if (this.managementPolicies == null) { + this.managementPolicies = new ManagementPoliciesImpl(clientObject.getManagementPolicies(), this); + } + return managementPolicies; + } + + /** @return Resource collection API of BlobInventoryPolicies. */ + public BlobInventoryPolicies blobInventoryPolicies() { + if (this.blobInventoryPolicies == null) { + this.blobInventoryPolicies = new BlobInventoryPoliciesImpl(clientObject.getBlobInventoryPolicies(), this); + } + return blobInventoryPolicies; + } + + /** @return Resource collection API of PrivateEndpointConnections. */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** @return Resource collection API of PrivateLinkResources. */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; + } + + /** @return Resource collection API of ObjectReplicationPoliciesOperations. */ + public ObjectReplicationPoliciesOperations objectReplicationPoliciesOperations() { + if (this.objectReplicationPoliciesOperations == null) { + this.objectReplicationPoliciesOperations = + new ObjectReplicationPoliciesOperationsImpl( + clientObject.getObjectReplicationPoliciesOperations(), this); + } + return objectReplicationPoliciesOperations; + } + + /** @return Resource collection API of EncryptionScopes. */ + public EncryptionScopes encryptionScopes() { + if (this.encryptionScopes == null) { + this.encryptionScopes = new EncryptionScopesImpl(clientObject.getEncryptionScopes(), this); + } + return encryptionScopes; + } + + /** @return Resource collection API of BlobServices. */ + public BlobServices blobServices() { + if (this.blobServices == null) { + this.blobServices = new BlobServicesImpl(clientObject.getBlobServices(), this); + } + return blobServices; + } + + /** @return Resource collection API of BlobContainers. */ + public BlobContainers blobContainers() { + if (this.blobContainers == null) { + this.blobContainers = new BlobContainersImpl(clientObject.getBlobContainers(), this); + } + return blobContainers; + } + + /** @return Resource collection API of FileServices. */ + public FileServices fileServices() { + if (this.fileServices == null) { + this.fileServices = new FileServicesImpl(clientObject.getFileServices(), this); + } + return fileServices; + } + + /** @return Resource collection API of FileShares. */ + public FileShares fileShares() { + if (this.fileShares == null) { + this.fileShares = new FileSharesImpl(clientObject.getFileShares(), this); + } + return fileShares; + } + + /** @return Resource collection API of QueueServices. */ + public QueueServices queueServices() { + if (this.queueServices == null) { + this.queueServices = new QueueServicesImpl(clientObject.getQueueServices(), this); + } + return queueServices; + } + + /** @return Resource collection API of Queues. */ + public Queues queues() { + if (this.queues == null) { + this.queues = new QueuesImpl(clientObject.getQueues(), this); + } + return queues; + } + + /** @return Resource collection API of TableServices. */ + public TableServices tableServices() { + if (this.tableServices == null) { + this.tableServices = new TableServicesImpl(clientObject.getTableServices(), this); + } + return tableServices; + } + + /** @return Resource collection API of Tables. */ + public Tables tables() { + if (this.tables == null) { + this.tables = new TablesImpl(clientObject.getTables(), this); + } + return tables; + } + + /** + * @return Wrapped service client StorageManagementClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + */ + 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..aecd82c427c2d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/BlobContainersClient.java @@ -0,0 +1,692 @@ +// Copyright (c) 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. + */ + @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. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String accountName, + String containerName, + BlobContainerInner blobContainer, + 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + 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); + + /** + * 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String accountName, String containerName, 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response setLegalHoldWithResponse( + 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response clearLegalHoldWithResponse( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold, 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); + + /** + * 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @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); + + /** + * 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); + + /** + * 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @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); + + /** + * 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @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); + + /** + * 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @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); + + /** + * 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @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); + + /** + * 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response leaseWithResponse( + String resourceGroupName, + String accountName, + String containerName, + LeaseContainerRequest parameters, + 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. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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..5ede340ec5162 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/BlobInventoryPoliciesClient.java @@ -0,0 +1,165 @@ +// Copyright (c) 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'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName, 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, + BlobInventoryPolicyInner properties, + 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); + + /** + * 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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.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. + */ + @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..2788b28cfee16 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/BlobServicesClient.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.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 response. + */ + @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 response. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response setServicePropertiesWithResponse( + String resourceGroupName, String accountName, BlobServicePropertiesInner parameters, 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getServicePropertiesWithResponse( + String resourceGroupName, String accountName, Context context); +} 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..bb0e0c9a36d19 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/DeletedAccountsClient.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.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. + */ + @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. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String deletedAccountName, String location, Context context); +} 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..f2b67015b3707 --- /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; + +/** 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response putWithResponse( + 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response patchWithResponse( + String resourceGroupName, + String accountName, + String encryptionScopeName, + EncryptionScopeInner encryptionScope, + 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String encryptionScopeName, Context 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 com.azure.core.management.exception.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. + */ + @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 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. + */ + @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/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..54e1896c5ccbb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/FileServicesClient.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; + +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.FileServiceItemsInner; +import com.azure.resourcemanager.storage.generated.fluent.models.FileServicePropertiesInner; + +/** 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, String accountName, 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response setServicePropertiesWithResponse( + String resourceGroupName, String accountName, FileServicePropertiesInner parameters, 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getServicePropertiesWithResponse( + String resourceGroupName, String accountName, Context context); +} 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..2873968f6b1c8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/FileSharesClient.java @@ -0,0 +1,332 @@ +// Copyright (c) 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. + */ + @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. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String accountName, + String shareName, + FileShareInner fileShare, + String expand, + 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String accountName, String shareName, FileShareInner fileShare, 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String accountName, + String shareName, + String expand, + String xMsSnapshot, + 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); + + /** + * 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String accountName, + String shareName, + String xMsSnapshot, + String include, + 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 deleted share to be restored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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); + + /** + * 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 deleted share to be restored. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response restoreWithResponse( + String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare, 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); + + /** + * 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); +} 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..ef106c0bca02e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/ManagementPoliciesClient.java @@ -0,0 +1,126 @@ +// Copyright (c) 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'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + ManagementPolicyName managementPolicyName, + ManagementPolicyInner properties, + 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); + + /** + * 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, 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..2ee06cee654b3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/ObjectReplicationPoliciesOperationsClient.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.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. + */ + @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. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String objectReplicationPolicyId, 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + String objectReplicationPolicyId, + ObjectReplicationPolicyInner properties, + 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); + + /** + * 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String accountName, String objectReplicationPolicyId, Context context); +} 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..ce25557b35007 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/OperationsClient.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.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. + */ + @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. + */ + @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..060ab616aa35c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,164 @@ +// Copyright (c) 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. + */ + @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. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String privateEndpointConnectionName, 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response putWithResponse( + String resourceGroupName, + String accountName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties, + 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); + + /** + * 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context); +} 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..175abd773dead --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/PrivateLinkResourcesClient.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.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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByStorageAccountWithResponse( + String resourceGroupName, String accountName, Context context); +} 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..b58047499d9a3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/QueueServicesClient.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.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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, String accountName, 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response setServicePropertiesWithResponse( + String resourceGroupName, String accountName, QueueServicePropertiesInner parameters, 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getServicePropertiesWithResponse( + String resourceGroupName, String accountName, Context context); +} 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..e14a5230967fe --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/QueuesClient.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.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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + @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 update(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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String accountName, String queueName, StorageQueueInner queue, 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + 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); + + /** + * 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, String queueName, Context 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 com.azure.core.management.exception.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. + */ + @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. + */ + @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..ba5c9e83b2aca --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/SkusClient.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.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. + */ + @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. + */ + @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..308f719b42254 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/StorageAccountsClient.java @@ -0,0 +1,612 @@ +// Copyright (c) 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.models.AccountSasParameters; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreParameters; +import com.azure.resourcemanager.storage.generated.models.ListKeyExpand; +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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + StorageAccountCheckNameAvailabilityParameters accountName, 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) + 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 storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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); + + /** + * 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, StorageAccountExpand expand, 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters, Context context); + + /** + * 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listKeysWithResponse( + String resourceGroupName, String accountName, ListKeyExpand expand, 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateKeyWithResponse( + String resourceGroupName, + String accountName, + StorageAccountRegenerateKeyParameters regenerateKey, + 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAccountSasWithResponse( + String resourceGroupName, String accountName, AccountSasParameters 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listServiceSasWithResponse( + String resourceGroupName, String accountName, ServiceSasParameters parameters, Context context); + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginFailover(String resourceGroupName, String accountName); + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginFailover(String resourceGroupName, String accountName, Context context); + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within 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); + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the 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 failover(String resourceGroupName, String accountName, 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) + 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 blob restore status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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); + + /** + * 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response revokeUserDelegationKeysWithResponse(String resourceGroupName, String accountName, Context context); +} 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..929d7fbf4cd4a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/StorageManagementClient.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.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 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 EncryptionScopesClient object to access its operations. + * + * @return the EncryptionScopesClient object. + */ + EncryptionScopesClient getEncryptionScopes(); + + /** + * 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 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(); +} 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..4ff563143a9a8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/TableServicesClient.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.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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, String accountName, 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response setServicePropertiesWithResponse( + String resourceGroupName, String accountName, TableServicePropertiesInner parameters, 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getServicePropertiesWithResponse( + String resourceGroupName, String accountName, Context context); +} 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..4cf74d2225d65 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/TablesClient.java @@ -0,0 +1,188 @@ +// Copyright (c) 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, String accountName, String tableName, 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); + + /** + * 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + 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); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + 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); + + /** + * 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, String tableName, Context 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 com.azure.core.management.exception.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. + */ + @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. + */ + @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..376b1987868e1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/UsagesClient.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.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. + */ + @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. + */ + @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..15535ba7a2ef6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobContainerInner.java @@ -0,0 +1,380 @@ +// Copyright (c) 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.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +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 com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Properties of the blob container, including Id, resource name, resource type, Etag. */ +@JsonFlatten +@Fluent +public class BlobContainerInner extends AzureEntityResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobContainerInner.class); + + /* + * The version of the deleted blob container. + */ + @JsonProperty(value = "properties.version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * Indicates whether the blob container was deleted. + */ + @JsonProperty(value = "properties.deleted", access = JsonProperty.Access.WRITE_ONLY) + private Boolean deleted; + + /* + * Blob container deletion time. + */ + @JsonProperty(value = "properties.deletedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime deletedTime; + + /* + * Remaining retention days for soft deleted blob container. + */ + @JsonProperty(value = "properties.remainingRetentionDays", access = JsonProperty.Access.WRITE_ONLY) + private Integer remainingRetentionDays; + + /* + * Default the container to use specified encryption scope for all writes. + */ + @JsonProperty(value = "properties.defaultEncryptionScope") + private String defaultEncryptionScope; + + /* + * Block override of encryption scope from the container default. + */ + @JsonProperty(value = "properties.denyEncryptionScopeOverride") + private Boolean denyEncryptionScopeOverride; + + /* + * Specifies whether data in the container may be accessed publicly and the + * level of access. + */ + @JsonProperty(value = "properties.publicAccess") + private PublicAccess publicAccess; + + /* + * Returns the date and time the container was last modified. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTime; + + /* + * The lease status of the container. + */ + @JsonProperty(value = "properties.leaseStatus", access = JsonProperty.Access.WRITE_ONLY) + private LeaseStatus leaseStatus; + + /* + * Lease state of the container. + */ + @JsonProperty(value = "properties.leaseState", access = JsonProperty.Access.WRITE_ONLY) + private LeaseState leaseState; + + /* + * Specifies whether the lease on a container is of infinite or fixed + * duration, only when the container is leased. + */ + @JsonProperty(value = "properties.leaseDuration", access = JsonProperty.Access.WRITE_ONLY) + private LeaseDuration leaseDuration; + + /* + * A name-value pair to associate with the container as metadata. + */ + @JsonProperty(value = "properties.metadata") + private Map metadata; + + /* + * The ImmutabilityPolicy property of the container. + */ + @JsonProperty(value = "properties.immutabilityPolicy", access = JsonProperty.Access.WRITE_ONLY) + private ImmutabilityPolicyProperties immutabilityPolicy; + + /* + * The LegalHold property of the container. + */ + @JsonProperty(value = "properties.legalHold", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "properties.hasLegalHold", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "properties.hasImmutabilityPolicy", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "properties.immutableStorageWithVersioning") + private ImmutableStorageWithVersioning immutableStorageWithVersioning; + + /** + * 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 BlobContainerInner object itself. + */ + public BlobContainerInner 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 BlobContainerInner object itself. + */ + public BlobContainerInner 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 BlobContainerInner object itself. + */ + public BlobContainerInner 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 BlobContainerInner object itself. + */ + public BlobContainerInner 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 BlobContainerInner object itself. + */ + public BlobContainerInner withImmutableStorageWithVersioning( + ImmutableStorageWithVersioning immutableStorageWithVersioning) { + this.immutableStorageWithVersioning = immutableStorageWithVersioning; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (immutabilityPolicy() != null) { + immutabilityPolicy().validate(); + } + if (legalHold() != null) { + legalHold().validate(); + } + if (immutableStorageWithVersioning() != null) { + immutableStorageWithVersioning().validate(); + } + } +} 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..04e1a2cc9cc2d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobInventoryPolicyInner.java @@ -0,0 +1,90 @@ +// Copyright (c) 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.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.models.BlobInventoryPolicySchema; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The storage account blob inventory policy. */ +@JsonFlatten +@Fluent +public class BlobInventoryPolicyInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobInventoryPolicyInner.class); + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Returns the last modified date and time of the blob inventory policy. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTime; + + /* + * The storage account blob inventory policy object. It is composed of + * policy rules. + */ + @JsonProperty(value = "properties.policy") + private BlobInventoryPolicySchema policy; + + /** + * 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 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 BlobInventoryPolicyInner object itself. + */ + public BlobInventoryPolicyInner 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) { + policy().validate(); + } + } +} 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..7670543eeae7a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobRestoreStatusInner.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreParameters; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreProgressStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Blob restore status. */ +@Immutable +public final class BlobRestoreStatusInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobRestoreStatusInner.class); + + /* + * 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. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private BlobRestoreProgressStatus status; + + /* + * Failure reason when blob restore is failed. + */ + @JsonProperty(value = "failureReason", access = JsonProperty.Access.WRITE_ONLY) + private String failureReason; + + /* + * Id for tracking blob restore request. + */ + @JsonProperty(value = "restoreId", access = JsonProperty.Access.WRITE_ONLY) + private String restoreId; + + /* + * Blob restore request parameters. + */ + @JsonProperty(value = "parameters", access = JsonProperty.Access.WRITE_ONLY) + private BlobRestoreParameters parameters; + + /** + * 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(); + } + } +} 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..673705127ba16 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/BlobServicePropertiesInner.java @@ -0,0 +1,321 @@ +// Copyright (c) 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.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +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 com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of a storage account’s Blob service. */ +@JsonFlatten +@Fluent +public class BlobServicePropertiesInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobServicePropertiesInner.class); + + /* + * Sku name and tier. + */ + @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) + private Sku sku; + + /* + * 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. + */ + @JsonProperty(value = "properties.cors") + 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. + */ + @JsonProperty(value = "properties.defaultServiceVersion") + private String defaultServiceVersion; + + /* + * The blob service properties for blob soft delete. + */ + @JsonProperty(value = "properties.deleteRetentionPolicy") + private DeleteRetentionPolicy deleteRetentionPolicy; + + /* + * Versioning is enabled if set to true. + */ + @JsonProperty(value = "properties.isVersioningEnabled") + private Boolean isVersioningEnabled; + + /* + * Deprecated in favor of isVersioningEnabled property. + */ + @JsonProperty(value = "properties.automaticSnapshotPolicyEnabled") + private Boolean automaticSnapshotPolicyEnabled; + + /* + * The blob service properties for change feed events. + */ + @JsonProperty(value = "properties.changeFeed") + private ChangeFeed changeFeed; + + /* + * The blob service properties for blob restore policy. + */ + @JsonProperty(value = "properties.restorePolicy") + private RestorePolicyProperties restorePolicy; + + /* + * The blob service properties for container soft delete. + */ + @JsonProperty(value = "properties.containerDeleteRetentionPolicy") + private DeleteRetentionPolicy containerDeleteRetentionPolicy; + + /* + * The blob service property to configure last access time based tracking + * policy. + */ + @JsonProperty(value = "properties.lastAccessTimeTrackingPolicy") + private LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy; + + /** + * Get the sku property: Sku name and tier. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * 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 BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner 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 BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner 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 BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner 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 BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner 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 BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner 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 BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner 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 BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner 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 BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner 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 BlobServicePropertiesInner object itself. + */ + public BlobServicePropertiesInner withLastAccessTimeTrackingPolicy( + LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy) { + this.lastAccessTimeTrackingPolicy = lastAccessTimeTrackingPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().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(); + } + } +} 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..6afe106dbf3e5 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/CheckNameAvailabilityResultInner.java @@ -0,0 +1,75 @@ +// Copyright (c) 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.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.models.Reason; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CheckNameAvailability operation response. */ +@Immutable +public final class CheckNameAvailabilityResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityResultInner.class); + + /* + * 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. + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private Reason reason; + + /* + * Gets an error message explaining the Reason value in more detail. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * 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() { + } +} 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..451f858f4c9ef --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/DeletedAccountInner.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.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Deleted storage account. */ +@JsonFlatten +@Immutable +public class DeletedAccountInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeletedAccountInner.class); + + /* + * Full resource id of the original storage account. + */ + @JsonProperty(value = "properties.storageAccountResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String storageAccountResourceId; + + /* + * Location of the deleted account. + */ + @JsonProperty(value = "properties.location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * Can be used to attempt recovering this deleted account via + * PutStorageAccount API. + */ + @JsonProperty(value = "properties.restoreReference", access = JsonProperty.Access.WRITE_ONLY) + private String restoreReference; + + /* + * Creation time of the deleted account. + */ + @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) + private String creationTime; + + /* + * Deletion time of the deleted account. + */ + @JsonProperty(value = "properties.deletionTime", access = JsonProperty.Access.WRITE_ONLY) + private String deletionTime; + + /** + * 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() { + } +} 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..73364610b236d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/EncryptionScopeInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +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 com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The Encryption Scope resource. */ +@JsonFlatten +@Fluent +public class EncryptionScopeInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionScopeInner.class); + + /* + * The provider for the encryption scope. Possible values + * (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. + */ + @JsonProperty(value = "properties.source") + private EncryptionScopeSource source; + + /* + * The state of the encryption scope. Possible values (case-insensitive): + * Enabled, Disabled. + */ + @JsonProperty(value = "properties.state") + private EncryptionScopeState state; + + /* + * Gets the creation date and time of the encryption scope in UTC. + */ + @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationTime; + + /* + * Gets the last modification date and time of the encryption scope in UTC. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + 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'. + */ + @JsonProperty(value = "properties.keyVaultProperties") + 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. + */ + @JsonProperty(value = "properties.requireInfrastructureEncryption") + private Boolean requireInfrastructureEncryption; + + /** + * 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 EncryptionScopeInner object itself. + */ + public EncryptionScopeInner 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 EncryptionScopeInner object itself. + */ + public EncryptionScopeInner 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 EncryptionScopeInner object itself. + */ + public EncryptionScopeInner 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 EncryptionScopeInner object itself. + */ + public EncryptionScopeInner 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(); + } + } +} 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..d9c4f2994bab7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileServiceItemsInner.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The FileServiceItems model. */ +@Immutable +public final class FileServiceItemsInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FileServiceItemsInner.class); + + /* + * List of file services returned. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * 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()); + } + } +} 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..0971977d7a414 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileServicePropertiesInner.java @@ -0,0 +1,143 @@ +// Copyright (c) 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.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +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 com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of File services in storage account. */ +@JsonFlatten +@Fluent +public class FileServicePropertiesInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FileServicePropertiesInner.class); + + /* + * Sku name and tier. + */ + @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) + private Sku sku; + + /* + * 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. + */ + @JsonProperty(value = "properties.cors") + private CorsRules cors; + + /* + * The file service properties for share soft delete. + */ + @JsonProperty(value = "properties.shareDeleteRetentionPolicy") + private DeleteRetentionPolicy shareDeleteRetentionPolicy; + + /* + * Protocol settings for file service + */ + @JsonProperty(value = "properties.protocolSettings") + private ProtocolSettings protocolSettings; + + /** + * Get the sku property: Sku name and tier. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * 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 FileServicePropertiesInner object itself. + */ + public FileServicePropertiesInner 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 FileServicePropertiesInner object itself. + */ + public FileServicePropertiesInner 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 FileServicePropertiesInner object itself. + */ + public FileServicePropertiesInner withProtocolSettings(ProtocolSettings protocolSettings) { + this.protocolSettings = protocolSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (cors() != null) { + cors().validate(); + } + if (shareDeleteRetentionPolicy() != null) { + shareDeleteRetentionPolicy().validate(); + } + if (protocolSettings() != null) { + protocolSettings().validate(); + } + } +} 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..0b4c0ffc2193a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileShareInner.java @@ -0,0 +1,395 @@ +// Copyright (c) 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.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.models.AzureEntityResource; +import com.azure.resourcemanager.storage.generated.models.EnabledProtocols; +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 com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Properties of the file share, including Id, resource name, resource type, Etag. */ +@JsonFlatten +@Fluent +public class FileShareInner extends AzureEntityResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FileShareInner.class); + + /* + * Returns the date and time the share was last modified. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTime; + + /* + * A name-value pair to associate with the share as metadata. + */ + @JsonProperty(value = "properties.metadata") + private Map metadata; + + /* + * The maximum size of the share, in gigabytes. Must be greater than 0, and + * less than or equal to 5TB (5120). For Large File Shares, the maximum + * size is 102400. + */ + @JsonProperty(value = "properties.shareQuota") + private Integer shareQuota; + + /* + * The authentication protocol that is used for the file share. Can only be + * specified when creating a share. + */ + @JsonProperty(value = "properties.enabledProtocols") + private EnabledProtocols enabledProtocols; + + /* + * The property is for NFS share only. The default is NoRootSquash. + */ + @JsonProperty(value = "properties.rootSquash") + private RootSquashType rootSquash; + + /* + * The version of the share. + */ + @JsonProperty(value = "properties.version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * Indicates whether the share was deleted. + */ + @JsonProperty(value = "properties.deleted", access = JsonProperty.Access.WRITE_ONLY) + private Boolean deleted; + + /* + * The deleted time if the share was deleted. + */ + @JsonProperty(value = "properties.deletedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime deletedTime; + + /* + * Remaining retention days for share that was soft deleted. + */ + @JsonProperty(value = "properties.remainingRetentionDays", access = JsonProperty.Access.WRITE_ONLY) + private Integer remainingRetentionDays; + + /* + * Access tier for specific share. GpV2 account can choose between + * TransactionOptimized (default), Hot, and Cool. FileStorage account can + * choose Premium. + */ + @JsonProperty(value = "properties.accessTier") + private ShareAccessTier accessTier; + + /* + * Indicates the last modification time for share access tier. + */ + @JsonProperty(value = "properties.accessTierChangeTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime accessTierChangeTime; + + /* + * Indicates if there is a pending transition for access tier. + */ + @JsonProperty(value = "properties.accessTierStatus", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "properties.shareUsageBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long shareUsageBytes; + + /* + * The lease status of the share. + */ + @JsonProperty(value = "properties.leaseStatus", access = JsonProperty.Access.WRITE_ONLY) + private LeaseStatus leaseStatus; + + /* + * Lease state of the share. + */ + @JsonProperty(value = "properties.leaseState", access = JsonProperty.Access.WRITE_ONLY) + private LeaseState leaseState; + + /* + * Specifies whether the lease on a share is of infinite or fixed duration, + * only when the share is leased. + */ + @JsonProperty(value = "properties.leaseDuration", access = JsonProperty.Access.WRITE_ONLY) + private LeaseDuration leaseDuration; + + /* + * List of stored access policies specified on the share. + */ + @JsonProperty(value = "properties.signedIdentifiers") + private List signedIdentifiers; + + /* + * Creation time of share snapshot returned in the response of list shares + * with expand param "snapshots". + */ + @JsonProperty(value = "properties.snapshotTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime snapshotTime; + + /** + * 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 FileShareInner object itself. + */ + public FileShareInner withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the shareQuota property: The maximum size of the share, in gigabytes. Must be greater than 0, and less than + * or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. + * + * @return the shareQuota value. + */ + public Integer shareQuota() { + return this.shareQuota; + } + + /** + * Set the shareQuota property: The maximum size of the share, in gigabytes. Must be greater than 0, and less than + * or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. + * + * @param shareQuota the shareQuota value to set. + * @return the FileShareInner object itself. + */ + public FileShareInner withShareQuota(Integer shareQuota) { + this.shareQuota = shareQuota; + return this; + } + + /** + * 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 FileShareInner object itself. + */ + public FileShareInner 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 FileShareInner object itself. + */ + public FileShareInner 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 FileShareInner object itself. + */ + public FileShareInner 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 FileShareInner object itself. + */ + public FileShareInner 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (signedIdentifiers() != null) { + signedIdentifiers().forEach(e -> e.validate()); + } + } +} 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..17219638fbd17 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/FileShareItemInner.java @@ -0,0 +1,395 @@ +// Copyright (c) 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.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.models.AzureEntityResource; +import com.azure.resourcemanager.storage.generated.models.EnabledProtocols; +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 com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** The file share properties be listed out. */ +@JsonFlatten +@Fluent +public class FileShareItemInner extends AzureEntityResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FileShareItemInner.class); + + /* + * Returns the date and time the share was last modified. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTime; + + /* + * A name-value pair to associate with the share as metadata. + */ + @JsonProperty(value = "properties.metadata") + private Map metadata; + + /* + * The maximum size of the share, in gigabytes. Must be greater than 0, and + * less than or equal to 5TB (5120). For Large File Shares, the maximum + * size is 102400. + */ + @JsonProperty(value = "properties.shareQuota") + private Integer shareQuota; + + /* + * The authentication protocol that is used for the file share. Can only be + * specified when creating a share. + */ + @JsonProperty(value = "properties.enabledProtocols") + private EnabledProtocols enabledProtocols; + + /* + * The property is for NFS share only. The default is NoRootSquash. + */ + @JsonProperty(value = "properties.rootSquash") + private RootSquashType rootSquash; + + /* + * The version of the share. + */ + @JsonProperty(value = "properties.version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * Indicates whether the share was deleted. + */ + @JsonProperty(value = "properties.deleted", access = JsonProperty.Access.WRITE_ONLY) + private Boolean deleted; + + /* + * The deleted time if the share was deleted. + */ + @JsonProperty(value = "properties.deletedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime deletedTime; + + /* + * Remaining retention days for share that was soft deleted. + */ + @JsonProperty(value = "properties.remainingRetentionDays", access = JsonProperty.Access.WRITE_ONLY) + private Integer remainingRetentionDays; + + /* + * Access tier for specific share. GpV2 account can choose between + * TransactionOptimized (default), Hot, and Cool. FileStorage account can + * choose Premium. + */ + @JsonProperty(value = "properties.accessTier") + private ShareAccessTier accessTier; + + /* + * Indicates the last modification time for share access tier. + */ + @JsonProperty(value = "properties.accessTierChangeTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime accessTierChangeTime; + + /* + * Indicates if there is a pending transition for access tier. + */ + @JsonProperty(value = "properties.accessTierStatus", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "properties.shareUsageBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long shareUsageBytes; + + /* + * The lease status of the share. + */ + @JsonProperty(value = "properties.leaseStatus", access = JsonProperty.Access.WRITE_ONLY) + private LeaseStatus leaseStatus; + + /* + * Lease state of the share. + */ + @JsonProperty(value = "properties.leaseState", access = JsonProperty.Access.WRITE_ONLY) + private LeaseState leaseState; + + /* + * Specifies whether the lease on a share is of infinite or fixed duration, + * only when the share is leased. + */ + @JsonProperty(value = "properties.leaseDuration", access = JsonProperty.Access.WRITE_ONLY) + private LeaseDuration leaseDuration; + + /* + * List of stored access policies specified on the share. + */ + @JsonProperty(value = "properties.signedIdentifiers") + private List signedIdentifiers; + + /* + * Creation time of share snapshot returned in the response of list shares + * with expand param "snapshots". + */ + @JsonProperty(value = "properties.snapshotTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime snapshotTime; + + /** + * 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 FileShareItemInner object itself. + */ + public FileShareItemInner withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the shareQuota property: The maximum size of the share, in gigabytes. Must be greater than 0, and less than + * or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. + * + * @return the shareQuota value. + */ + public Integer shareQuota() { + return this.shareQuota; + } + + /** + * Set the shareQuota property: The maximum size of the share, in gigabytes. Must be greater than 0, and less than + * or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. + * + * @param shareQuota the shareQuota value to set. + * @return the FileShareItemInner object itself. + */ + public FileShareItemInner withShareQuota(Integer shareQuota) { + this.shareQuota = shareQuota; + return this; + } + + /** + * 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 FileShareItemInner object itself. + */ + public FileShareItemInner 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 FileShareItemInner object itself. + */ + public FileShareItemInner 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 FileShareItemInner object itself. + */ + public FileShareItemInner 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 FileShareItemInner object itself. + */ + public FileShareItemInner 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (signedIdentifiers() != null) { + signedIdentifiers().forEach(e -> e.validate()); + } + } +} 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..ab3d510848a6e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ImmutabilityPolicyInner.java @@ -0,0 +1,114 @@ +// Copyright (c) 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.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.models.AzureEntityResource; +import com.azure.resourcemanager.storage.generated.models.ImmutabilityPolicyState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. */ +@JsonFlatten +@Fluent +public class ImmutabilityPolicyInner extends AzureEntityResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImmutabilityPolicyInner.class); + + /* + * The immutability period for the blobs in the container since the policy + * creation, in days. + */ + @JsonProperty(value = "properties.immutabilityPeriodSinceCreationInDays") + private Integer immutabilityPeriodSinceCreationInDays; + + /* + * The ImmutabilityPolicy state of a blob container, possible values + * include: Locked and Unlocked. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + 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 + */ + @JsonProperty(value = "properties.allowProtectedAppendWrites") + private Boolean allowProtectedAppendWrites; + + /** + * 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 ImmutabilityPolicyInner object itself. + */ + public ImmutabilityPolicyInner 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 ImmutabilityPolicyInner object itself. + */ + public ImmutabilityPolicyInner withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites) { + this.allowProtectedAppendWrites = allowProtectedAppendWrites; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} 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..c8f7180f2c204 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LeaseContainerResponseInner.java @@ -0,0 +1,79 @@ +// Copyright (c) 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Lease Container response schema. */ +@Fluent +public final class LeaseContainerResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LeaseContainerResponseInner.class); + + /* + * Returned unique lease ID that must be included with any request to + * delete the container, or to renew, change, or release the lease. + */ + @JsonProperty(value = "leaseId") + private String leaseId; + + /* + * Approximate time remaining in the lease period, in seconds. + */ + @JsonProperty(value = "leaseTimeSeconds") + private String leaseTimeSeconds; + + /** + * 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() { + } +} 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..e2d5c8922d3e5 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LeaseShareResponseInner.java @@ -0,0 +1,79 @@ +// Copyright (c) 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Lease Share response schema. */ +@Fluent +public final class LeaseShareResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LeaseShareResponseInner.class); + + /* + * Returned unique lease ID that must be included with any request to + * delete the share, or to renew, change, or release the lease. + */ + @JsonProperty(value = "leaseId") + private String leaseId; + + /* + * Approximate time remaining in the lease period, in seconds. + */ + @JsonProperty(value = "leaseTimeSeconds") + private String leaseTimeSeconds; + + /** + * 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() { + } +} 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..e7f58313ba350 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/LegalHoldInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The LegalHold property of a blob container. */ +@Fluent +public final class LegalHoldInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LegalHoldInner.class); + + /* + * 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. + */ + @JsonProperty(value = "hasLegalHold", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasLegalHold; + + /* + * Each tag should be 3 to 23 alphanumeric characters and is normalized to + * lower case at SRP. + */ + @JsonProperty(value = "tags", required = true) + private List tags; + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tags() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property tags in model LegalHoldInner")); + } + } +} 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..ddbc3c7d14a3c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListAccountSasResponseInner.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The List SAS credentials operation response. */ +@Immutable +public final class ListAccountSasResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListAccountSasResponseInner.class); + + /* + * List SAS credentials of storage account. + */ + @JsonProperty(value = "accountSasToken", access = JsonProperty.Access.WRITE_ONLY) + private String accountSasToken; + + /** + * 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() { + } +} 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..13c9929fe029a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListContainerItemInner.java @@ -0,0 +1,380 @@ +// Copyright (c) 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.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +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 com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** The blob container properties be listed out. */ +@JsonFlatten +@Fluent +public class ListContainerItemInner extends AzureEntityResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListContainerItemInner.class); + + /* + * The version of the deleted blob container. + */ + @JsonProperty(value = "properties.version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * Indicates whether the blob container was deleted. + */ + @JsonProperty(value = "properties.deleted", access = JsonProperty.Access.WRITE_ONLY) + private Boolean deleted; + + /* + * Blob container deletion time. + */ + @JsonProperty(value = "properties.deletedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime deletedTime; + + /* + * Remaining retention days for soft deleted blob container. + */ + @JsonProperty(value = "properties.remainingRetentionDays", access = JsonProperty.Access.WRITE_ONLY) + private Integer remainingRetentionDays; + + /* + * Default the container to use specified encryption scope for all writes. + */ + @JsonProperty(value = "properties.defaultEncryptionScope") + private String defaultEncryptionScope; + + /* + * Block override of encryption scope from the container default. + */ + @JsonProperty(value = "properties.denyEncryptionScopeOverride") + private Boolean denyEncryptionScopeOverride; + + /* + * Specifies whether data in the container may be accessed publicly and the + * level of access. + */ + @JsonProperty(value = "properties.publicAccess") + private PublicAccess publicAccess; + + /* + * Returns the date and time the container was last modified. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTime; + + /* + * The lease status of the container. + */ + @JsonProperty(value = "properties.leaseStatus", access = JsonProperty.Access.WRITE_ONLY) + private LeaseStatus leaseStatus; + + /* + * Lease state of the container. + */ + @JsonProperty(value = "properties.leaseState", access = JsonProperty.Access.WRITE_ONLY) + private LeaseState leaseState; + + /* + * Specifies whether the lease on a container is of infinite or fixed + * duration, only when the container is leased. + */ + @JsonProperty(value = "properties.leaseDuration", access = JsonProperty.Access.WRITE_ONLY) + private LeaseDuration leaseDuration; + + /* + * A name-value pair to associate with the container as metadata. + */ + @JsonProperty(value = "properties.metadata") + private Map metadata; + + /* + * The ImmutabilityPolicy property of the container. + */ + @JsonProperty(value = "properties.immutabilityPolicy", access = JsonProperty.Access.WRITE_ONLY) + private ImmutabilityPolicyProperties immutabilityPolicy; + + /* + * The LegalHold property of the container. + */ + @JsonProperty(value = "properties.legalHold", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "properties.hasLegalHold", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "properties.hasImmutabilityPolicy", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "properties.immutableStorageWithVersioning") + private ImmutableStorageWithVersioning immutableStorageWithVersioning; + + /** + * 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 ListContainerItemInner object itself. + */ + public ListContainerItemInner 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 ListContainerItemInner object itself. + */ + public ListContainerItemInner 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 ListContainerItemInner object itself. + */ + public ListContainerItemInner 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 ListContainerItemInner object itself. + */ + public ListContainerItemInner 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 ListContainerItemInner object itself. + */ + public ListContainerItemInner withImmutableStorageWithVersioning( + ImmutableStorageWithVersioning immutableStorageWithVersioning) { + this.immutableStorageWithVersioning = immutableStorageWithVersioning; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (immutabilityPolicy() != null) { + immutabilityPolicy().validate(); + } + if (legalHold() != null) { + legalHold().validate(); + } + if (immutableStorageWithVersioning() != null) { + immutableStorageWithVersioning().validate(); + } + } +} 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..bb16a378f66e6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListQueueInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The ListQueue model. */ +@JsonFlatten +@Fluent +public class ListQueueInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListQueueInner.class); + + /* + * A name-value pair that represents queue metadata. + */ + @JsonProperty(value = "properties.metadata") + private Map metadata; + + /** + * 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 ListQueueInner object itself. + */ + public ListQueueInner withMetadata(Map metadata) { + this.metadata = metadata; + 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/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..306449dab45a9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListQueueServicesInner.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ListQueueServices model. */ +@Immutable +public final class ListQueueServicesInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListQueueServicesInner.class); + + /* + * List of queue services returned. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * 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()); + } + } +} 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..99e35e81da82b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListServiceSasResponseInner.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The List service SAS credentials operation response. */ +@Immutable +public final class ListServiceSasResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListServiceSasResponseInner.class); + + /* + * List service SAS credentials of specific resource. + */ + @JsonProperty(value = "serviceSasToken", access = JsonProperty.Access.WRITE_ONLY) + private String serviceSasToken; + + /** + * 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() { + } +} 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..a341090272386 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ListTableServicesInner.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ListTableServices model. */ +@Immutable +public final class ListTableServicesInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListTableServicesInner.class); + + /* + * List of table services returned. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * 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()); + } + } +} 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..ec5c1cabd0fce --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ManagementPolicyInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.models.ManagementPolicySchema; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The Get Storage Account ManagementPolicies operation response. */ +@JsonFlatten +@Fluent +public class ManagementPolicyInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementPolicyInner.class); + + /* + * Returns the date and time the ManagementPolicies was last modified. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "properties.policy") + private ManagementPolicySchema policy; + + /** + * 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 ManagementPolicyInner object itself. + */ + public ManagementPolicyInner 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) { + policy().validate(); + } + } +} 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..86c0ce32d6215 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/ObjectReplicationPolicyInner.java @@ -0,0 +1,147 @@ +// Copyright (c) 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.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.models.ObjectReplicationPolicyRule; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The replication policy between two storage accounts. Multiple rules can be defined in one policy. */ +@JsonFlatten +@Fluent +public class ObjectReplicationPolicyInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ObjectReplicationPolicyInner.class); + + /* + * A unique id for object replication policy. + */ + @JsonProperty(value = "properties.policyId", access = JsonProperty.Access.WRITE_ONLY) + private String policyId; + + /* + * Indicates when the policy is enabled on the source account. + */ + @JsonProperty(value = "properties.enabledTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime enabledTime; + + /* + * Required. Source account name. It should be full resource id if + * allowCrossTenantReplication set to false. + */ + @JsonProperty(value = "properties.sourceAccount") + private String sourceAccount; + + /* + * Required. Destination account name. It should be full resource id if + * allowCrossTenantReplication set to false. + */ + @JsonProperty(value = "properties.destinationAccount") + private String destinationAccount; + + /* + * The storage account object replication rules. + */ + @JsonProperty(value = "properties.rules") + private List rules; + + /** + * 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 ObjectReplicationPolicyInner object itself. + */ + public ObjectReplicationPolicyInner 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 ObjectReplicationPolicyInner object itself. + */ + public ObjectReplicationPolicyInner 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 ObjectReplicationPolicyInner object itself. + */ + public ObjectReplicationPolicyInner 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) { + rules().forEach(e -> e.validate()); + } + } +} 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..fb03eee2dd034 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/OperationInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.models.OperationDisplay; +import com.azure.resourcemanager.storage.generated.models.ServiceSpecification; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Storage REST API operation definition. */ +@JsonFlatten +@Fluent +public class OperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); + + /* + * Operation name: {provider}/{resource}/{operation} + */ + @JsonProperty(value = "name") + private String name; + + /* + * Display metadata associated with the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * The origin of operations. + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * One property of operation, include metric specifications. + */ + @JsonProperty(value = "properties.serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** + * Get 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 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 OperationInner object itself. + */ + public OperationInner withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } +} 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..3dc2be03b0994 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateEndpointConnectionInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +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 com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Private Endpoint Connection resource. */ +@JsonFlatten +@Fluent +public class PrivateEndpointConnectionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); + + /* + * The resource of private end point. + */ + @JsonProperty(value = "properties.privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between + * service consumer and provider. + */ + @JsonProperty(value = "properties.privateLinkServiceConnectionState") + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** + * 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 PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner 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 PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner 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) { + privateLinkServiceConnectionState().validate(); + } + } +} 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..daa523e409dc6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/PrivateLinkResourceListResultInner.java @@ -0,0 +1,55 @@ +// Copyright (c) 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.resourcemanager.storage.generated.models.PrivateLinkResource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private link resources. */ +@Fluent +public final class PrivateLinkResourceListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceListResultInner.class); + + /* + * Array of private link resources + */ + @JsonProperty(value = "value") + private List value; + + /** + * 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()); + } + } +} 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..a58726888a623 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/QueueServicePropertiesInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of a storage account’s Queue service. */ +@JsonFlatten +@Fluent +public class QueueServicePropertiesInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QueueServicePropertiesInner.class); + + /* + * 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. + */ + @JsonProperty(value = "properties.cors") + private CorsRules cors; + + /** + * 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 QueueServicePropertiesInner object itself. + */ + public QueueServicePropertiesInner 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(); + } + } +} 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..411ef76ea679f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/SkuInformationInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +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 com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Storage SKU and its properties. */ +@Fluent +public final class SkuInformationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuInformationInner.class); + + /* + * The SKU name. Required for account creation; optional for update. Note + * that in older versions, SKU name was called accountType. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /* + * The SKU tier. This is based on the SKU name. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private SkuTier tier; + + /* + * The type of the resource, usually it is 'storageAccounts'. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /* + * Indicates the type of storage account. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + 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.). + */ + @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) + private List locations; + + /* + * The capability information in the specified SKU, including file + * encryption, network ACLs, change notification, etc. + */ + @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) + private List capabilities; + + /* + * The restrictions because of which SKU cannot be used. This is empty if + * there are no restrictions. + */ + @JsonProperty(value = "restrictions") + private List restrictions; + + /** + * 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 + .logExceptionAsError( + 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()); + } + } +} 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..8d46f501bef27 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountInner.java @@ -0,0 +1,808 @@ +// Copyright (c) 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.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.models.AccessTier; +import com.azure.resourcemanager.storage.generated.models.AccountStatus; +import com.azure.resourcemanager.storage.generated.models.AzureFilesIdentityBasedAuthentication; +import com.azure.resourcemanager.storage.generated.models.CustomDomain; +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.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.RoutingPreference; +import com.azure.resourcemanager.storage.generated.models.SasPolicy; +import com.azure.resourcemanager.storage.generated.models.Sku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** The storage account. */ +@JsonFlatten +@Fluent +public class StorageAccountInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountInner.class); + + /* + * Gets the SKU. + */ + @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) + private Sku sku; + + /* + * Gets the Kind. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private Kind kind; + + /* + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /* + * The extendedLocation of the resource. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * Gets the status of the storage account at the time the operation was + * called. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "properties.primaryEndpoints", access = JsonProperty.Access.WRITE_ONLY) + private Endpoints primaryEndpoints; + + /* + * Gets the location of the primary data center for the storage account. + */ + @JsonProperty(value = "properties.primaryLocation", access = JsonProperty.Access.WRITE_ONLY) + private String primaryLocation; + + /* + * Gets the status indicating whether the primary location of the storage + * account is available or unavailable. + */ + @JsonProperty(value = "properties.statusOfPrimary", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "properties.lastGeoFailoverTime", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "properties.secondaryLocation", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "properties.statusOfSecondary", access = JsonProperty.Access.WRITE_ONLY) + private AccountStatus statusOfSecondary; + + /* + * Gets the creation date and time of the storage account in UTC. + */ + @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationTime; + + /* + * Gets the custom domain the user assigned to this storage account. + */ + @JsonProperty(value = "properties.customDomain", access = JsonProperty.Access.WRITE_ONLY) + private CustomDomain customDomain; + + /* + * SasPolicy assigned to the storage account. + */ + @JsonProperty(value = "properties.sasPolicy", access = JsonProperty.Access.WRITE_ONLY) + private SasPolicy sasPolicy; + + /* + * KeyPolicy assigned to the storage account. + */ + @JsonProperty(value = "properties.keyPolicy", access = JsonProperty.Access.WRITE_ONLY) + private KeyPolicy keyPolicy; + + /* + * Storage account keys creation time. + */ + @JsonProperty(value = "properties.keyCreationTime", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "properties.secondaryEndpoints", access = JsonProperty.Access.WRITE_ONLY) + private Endpoints secondaryEndpoints; + + /* + * Gets the encryption settings on the account. If unspecified, the account + * is unencrypted. + */ + @JsonProperty(value = "properties.encryption", access = JsonProperty.Access.WRITE_ONLY) + private Encryption encryption; + + /* + * Required for storage accounts where kind = BlobStorage. The access tier + * used for billing. + */ + @JsonProperty(value = "properties.accessTier", access = JsonProperty.Access.WRITE_ONLY) + private AccessTier accessTier; + + /* + * Provides the identity based authentication settings for Azure Files. + */ + @JsonProperty(value = "properties.azureFilesIdentityBasedAuthentication") + private AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication; + + /* + * Allows https traffic only to storage service if sets to true. + */ + @JsonProperty(value = "properties.supportsHttpsTrafficOnly") + private Boolean enableHttpsTrafficOnly; + + /* + * Network rule set + */ + @JsonProperty(value = "properties.networkAcls", access = JsonProperty.Access.WRITE_ONLY) + private NetworkRuleSet networkRuleSet; + + /* + * Account HierarchicalNamespace enabled if sets to true. + */ + @JsonProperty(value = "properties.isHnsEnabled") + private Boolean isHnsEnabled; + + /* + * Geo Replication Stats + */ + @JsonProperty(value = "properties.geoReplicationStats", access = JsonProperty.Access.WRITE_ONLY) + private GeoReplicationStats geoReplicationStats; + + /* + * If the failover is in progress, the value will be true, otherwise, it + * will be null. + */ + @JsonProperty(value = "properties.failoverInProgress", access = JsonProperty.Access.WRITE_ONLY) + private Boolean failoverInProgress; + + /* + * Allow large file shares if sets to Enabled. It cannot be disabled once + * it is enabled. + */ + @JsonProperty(value = "properties.largeFileSharesState") + private LargeFileSharesState largeFileSharesState; + + /* + * List of private endpoint connection associated with the specified + * storage account + */ + @JsonProperty(value = "properties.privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /* + * Maintains information about the network routing choice opted by the user + * for data transfer + */ + @JsonProperty(value = "properties.routingPreference") + private RoutingPreference routingPreference; + + /* + * Blob restore status + */ + @JsonProperty(value = "properties.blobRestoreStatus", access = JsonProperty.Access.WRITE_ONLY) + private BlobRestoreStatusInner blobRestoreStatus; + + /* + * Allow or disallow public access to all blobs or containers in the + * storage account. The default interpretation is true for this property. + */ + @JsonProperty(value = "properties.allowBlobPublicAccess") + 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. + */ + @JsonProperty(value = "properties.minimumTlsVersion") + 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. + */ + @JsonProperty(value = "properties.allowSharedKeyAccess") + private Boolean allowSharedKeyAccess; + + /* + * NFS 3.0 protocol support enabled if set to true. + */ + @JsonProperty(value = "properties.isNfsV3Enabled") + private Boolean enableNfsV3; + + /* + * Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + */ + @JsonProperty(value = "properties.allowCrossTenantReplication") + private Boolean allowCrossTenantReplication; + + /** + * 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 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: Gets the encryption settings on the account. If unspecified, the account is + * unencrypted. + * + * @return the encryption value. + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Get the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier used for + * billing. + * + * @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 StorageAccountInner object itself. + */ + public StorageAccountInner 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 StorageAccountInner object itself. + */ + public StorageAccountInner 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 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 StorageAccountInner object itself. + */ + public StorageAccountInner 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 StorageAccountInner object itself. + */ + public StorageAccountInner 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 StorageAccountInner object itself. + */ + public StorageAccountInner 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 true 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 true for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner 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 StorageAccountInner object itself. + */ + public StorageAccountInner 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 StorageAccountInner object itself. + */ + public StorageAccountInner 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 StorageAccountInner object itself. + */ + public StorageAccountInner withEnableNfsV3(Boolean enableNfsV3) { + this.enableNfsV3 = enableNfsV3; + return this; + } + + /** + * Get the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + * + * @return the allowCrossTenantReplication value. + */ + public Boolean allowCrossTenantReplication() { + return this.allowCrossTenantReplication; + } + + /** + * Set the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + * + * @param allowCrossTenantReplication the allowCrossTenantReplication value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withAllowCrossTenantReplication(Boolean allowCrossTenantReplication) { + this.allowCrossTenantReplication = allowCrossTenantReplication; + return this; + } + + /** {@inheritDoc} */ + @Override + public StorageAccountInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public StorageAccountInner withTags(Map tags) { + super.withTags(tags); + 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 (extendedLocation() != null) { + extendedLocation().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(); + } + } +} 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..1259a93f43188 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageAccountListKeysResultInner.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.models.StorageAccountKey; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the ListKeys operation. */ +@Immutable +public final class StorageAccountListKeysResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountListKeysResultInner.class); + + /* + * Gets the list of storage account keys and their properties for the + * specified storage account. + */ + @JsonProperty(value = "keys", access = JsonProperty.Access.WRITE_ONLY) + private List keys; + + /** + * 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()); + } + } +} 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..e4ccca591b120 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/StorageQueueInner.java @@ -0,0 +1,72 @@ +// Copyright (c) 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.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The StorageQueue model. */ +@JsonFlatten +@Fluent +public class StorageQueueInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageQueueInner.class); + + /* + * A name-value pair that represents queue metadata. + */ + @JsonProperty(value = "properties.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. + */ + @JsonProperty(value = "properties.approximateMessageCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer approximateMessageCount; + + /** + * 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 StorageQueueInner object itself. + */ + public StorageQueueInner 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() { + } +} 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..8adabe63518b6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableInner.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the table, including Id, resource name, resource type. */ +@JsonFlatten +@Immutable +public class TableInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TableInner.class); + + /* + * Table name under the specified account + */ + @JsonProperty(value = "properties.tableName", access = JsonProperty.Access.WRITE_ONLY) + private String tableName; + + /** + * Get the tableName property: Table name under the specified account. + * + * @return the tableName value. + */ + public String tableName() { + return this.tableName; + } + + /** + * 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/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..3bd179d2e53da --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/TableServicePropertiesInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.models.CorsRules; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of a storage account’s Table service. */ +@JsonFlatten +@Fluent +public class TableServicePropertiesInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TableServicePropertiesInner.class); + + /* + * 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. + */ + @JsonProperty(value = "properties.cors") + private CorsRules cors; + + /** + * 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 TableServicePropertiesInner object itself. + */ + public TableServicePropertiesInner 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(); + } + } +} 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..c8e9685e73c28 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/models/UsageInner.java @@ -0,0 +1,90 @@ +// Copyright (c) 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.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.models.UsageName; +import com.azure.resourcemanager.storage.generated.models.UsageUnit; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes Storage Resource Usage. */ +@Immutable +public final class UsageInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageInner.class); + + /* + * Gets the unit of measurement. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private UsageUnit unit; + + /* + * Gets the current count of the allocated resources in the subscription. + */ + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) + private Integer currentValue; + + /* + * Gets the maximum count of the resources that can be allocated in the + * subscription. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Integer limit; + + /* + * Gets the name of the type of usage. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private UsageName name; + + /** + * 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(); + } + } +} 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..dec7a10810ff7 --- /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,6 @@ +// 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..e75af1291733e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/fluent/package-info.java @@ -0,0 +1,6 @@ +// 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..559b844229bc9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobContainerImpl.java @@ -0,0 +1,282 @@ +// Copyright (c) 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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.containerName = Utils.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 LegalHold setLegalHold(LegalHoldInner legalHold) { + return serviceManager.blobContainers().setLegalHold(resourceGroupName, accountName, containerName, legalHold); + } + + public Response setLegalHoldWithResponse(LegalHoldInner legalHold, Context context) { + return serviceManager + .blobContainers() + .setLegalHoldWithResponse(resourceGroupName, accountName, containerName, legalHold, context); + } + + public LegalHold clearLegalHold(LegalHoldInner legalHold) { + return serviceManager.blobContainers().clearLegalHold(resourceGroupName, accountName, containerName, legalHold); + } + + public Response clearLegalHoldWithResponse(LegalHoldInner legalHold, Context context) { + return serviceManager + .blobContainers() + .clearLegalHoldWithResponse(resourceGroupName, accountName, containerName, legalHold, context); + } + + public LeaseContainerResponse lease() { + return serviceManager.blobContainers().lease(resourceGroupName, accountName, containerName); + } + + public Response leaseWithResponse(LeaseContainerRequest parameters, Context context) { + return serviceManager + .blobContainers() + .leaseWithResponse(resourceGroupName, accountName, containerName, parameters, context); + } + + 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; + } +} 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..6c529ace9f86f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobContainersClientImpl.java @@ -0,0 +1,3653 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(BlobContainersClientImpl.class); + + /** 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") + private 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String accountName, String containerName, BlobContainerInner blobContainer) { + return createWithResponseAsync(resourceGroupName, accountName, containerName, blobContainer) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 createAsync(resourceGroupName, accountName, containerName, blobContainer).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Response createWithResponse( + String resourceGroupName, + String accountName, + String containerName, + BlobContainerInner blobContainer, + Context context) { + return createWithResponseAsync(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) + 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, String containerName, BlobContainerInner blobContainer) { + return updateWithResponseAsync(resourceGroupName, accountName, containerName, blobContainer) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 updateAsync(resourceGroupName, accountName, containerName, blobContainer).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Response updateWithResponse( + String resourceGroupName, + String accountName, + String containerName, + BlobContainerInner blobContainer, + Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, containerName, blobContainer, 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) + 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String containerName) { + return getWithResponseAsync(resourceGroupName, accountName, containerName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, accountName, containerName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Response getWithResponse( + String resourceGroupName, String accountName, String containerName, Context context) { + return getWithResponseAsync(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. + * @return the completion. + */ + @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 completion. + */ + @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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String containerName) { + return deleteWithResponseAsync(resourceGroupName, accountName, containerName) + .flatMap((Response res) -> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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) { + deleteAsync(resourceGroupName, accountName, containerName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response deleteWithResponse( + String resourceGroupName, String accountName, String containerName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, containerName, 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) + 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setLegalHoldAsync( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold) { + return setLegalHoldWithResponseAsync(resourceGroupName, accountName, containerName, legalHold) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 setLegalHoldAsync(resourceGroupName, accountName, containerName, legalHold).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response setLegalHoldWithResponse( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold, Context context) { + return setLegalHoldWithResponseAsync(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) + 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono clearLegalHoldAsync( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold) { + return clearLegalHoldWithResponseAsync(resourceGroupName, accountName, containerName, legalHold) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 clearLegalHoldAsync(resourceGroupName, accountName, containerName, legalHold).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response clearLegalHoldWithResponse( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold, Context context) { + return clearLegalHoldWithResponseAsync(resourceGroupName, accountName, containerName, legalHold, 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. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @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. + */ + @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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @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) + 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. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateImmutabilityPolicyAsync( + String resourceGroupName, + String accountName, + String containerName, + String ifMatch, + ImmutabilityPolicyInner parameters) { + return createOrUpdateImmutabilityPolicyWithResponseAsync( + resourceGroupName, accountName, containerName, ifMatch, parameters) + .flatMap( + (BlobContainersCreateOrUpdateImmutabilityPolicyResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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) + 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( + (BlobContainersCreateOrUpdateImmutabilityPolicyResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 createOrUpdateImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch, parameters) + .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. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @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(); + } + + /** + * 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + 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. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono getImmutabilityPolicyAsync( + String resourceGroupName, String accountName, String containerName, String ifMatch) { + return getImmutabilityPolicyWithResponseAsync(resourceGroupName, accountName, containerName, ifMatch) + .flatMap( + (BlobContainersGetImmutabilityPolicyResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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) + private Mono getImmutabilityPolicyAsync( + String resourceGroupName, String accountName, String containerName) { + final String ifMatch = null; + return getImmutabilityPolicyWithResponseAsync(resourceGroupName, accountName, containerName, ifMatch) + .flatMap( + (BlobContainersGetImmutabilityPolicyResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch).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. + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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(); + } + + /** + * 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono deleteImmutabilityPolicyAsync( + String resourceGroupName, String accountName, String containerName, String ifMatch) { + return deleteImmutabilityPolicyWithResponseAsync(resourceGroupName, accountName, containerName, ifMatch) + .flatMap( + (BlobContainersDeleteImmutabilityPolicyResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deleteImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch).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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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(); + } + + /** + * 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono lockImmutabilityPolicyAsync( + String resourceGroupName, String accountName, String containerName, String ifMatch) { + return lockImmutabilityPolicyWithResponseAsync(resourceGroupName, accountName, containerName, ifMatch) + .flatMap( + (BlobContainersLockImmutabilityPolicyResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 lockImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch).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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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(); + } + + /** + * 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @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. + */ + @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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @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) + 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono extendImmutabilityPolicyAsync( + String resourceGroupName, + String accountName, + String containerName, + String ifMatch, + ImmutabilityPolicyInner parameters) { + return extendImmutabilityPolicyWithResponseAsync( + resourceGroupName, accountName, containerName, ifMatch, parameters) + .flatMap( + (BlobContainersExtendImmutabilityPolicyResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + private Mono extendImmutabilityPolicyAsync( + String resourceGroupName, String accountName, String containerName, String ifMatch) { + final ImmutabilityPolicyInner parameters = null; + return extendImmutabilityPolicyWithResponseAsync( + resourceGroupName, accountName, containerName, ifMatch, parameters) + .flatMap( + (BlobContainersExtendImmutabilityPolicyResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 extendImmutabilityPolicyAsync(resourceGroupName, accountName, containerName, ifMatch, parameters) + .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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @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(); + } + + /** + * 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. + */ + @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. + */ + @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. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono leaseAsync( + String resourceGroupName, String accountName, String containerName, LeaseContainerRequest parameters) { + return leaseWithResponseAsync(resourceGroupName, accountName, containerName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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) + private Mono leaseAsync( + String resourceGroupName, String accountName, String containerName) { + final LeaseContainerRequest parameters = null; + return leaseWithResponseAsync(resourceGroupName, accountName, containerName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 leaseAsync(resourceGroupName, accountName, containerName, parameters).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. + * @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. + */ + @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(); + } + + /** + * 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 completion. + */ + @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 completion. + */ + @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, Context.NONE); + } + + /** + * 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginObjectLevelWorm( + String resourceGroupName, String accountName, String containerName) { + return 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginObjectLevelWorm( + String resourceGroupName, String accountName, String containerName, Context context) { + return 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 the completion. + */ + @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 the completion. + */ + @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 nextLink 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 response schema. + */ + @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 nextLink 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 response schema. + */ + @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..23c23bb418a77 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobContainersImpl.java @@ -0,0 +1,547 @@ +// Copyright (c) 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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BlobContainersImpl implements BlobContainers { + @JsonIgnore private 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 Utils.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 Utils.mapPage(inner, inner1 -> new ListContainerItemImpl(inner1, this.manager())); + } + + 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 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 void delete(String resourceGroupName, String accountName, String containerName) { + this.serviceClient().delete(resourceGroupName, accountName, containerName); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, String containerName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, containerName, context); + } + + 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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..ddfa681bf077a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobInventoryPoliciesClientImpl.java @@ -0,0 +1,896 @@ +// Copyright (c) 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.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.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 { + private final ClientLogger logger = new ClientLogger(BlobInventoryPoliciesClientImpl.class); + + /** 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") + private 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. + */ + @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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName) { + return getWithResponseAsync(resourceGroupName, accountName, blobInventoryPolicyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, accountName, blobInventoryPolicyName).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'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response getWithResponse( + String resourceGroupName, + String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, + Context context) { + return getWithResponseAsync(resourceGroupName, accountName, blobInventoryPolicyName, 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) + 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, + BlobInventoryPolicyInner properties) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, blobInventoryPolicyName, properties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 createOrUpdateAsync(resourceGroupName, accountName, blobInventoryPolicyName, properties).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, + BlobInventoryPolicyInner properties, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, accountName, blobInventoryPolicyName, properties, 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. + * @return the completion. + */ + @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 completion. + */ + @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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName) { + return deleteWithResponseAsync(resourceGroupName, accountName, blobInventoryPolicyName) + .flatMap((Response res) -> 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'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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) { + deleteAsync(resourceGroupName, accountName, blobInventoryPolicyName).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'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response deleteWithResponse( + String resourceGroupName, + String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, + Context context) { + return deleteWithResponseAsync(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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..f895ccd5d1e44 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobInventoryPoliciesImpl.java @@ -0,0 +1,218 @@ +// Copyright (c) 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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BlobInventoryPoliciesImpl implements BlobInventoryPolicies { + @JsonIgnore private 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 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 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 void delete(String resourceGroupName, String accountName, BlobInventoryPolicyName blobInventoryPolicyName) { + this.serviceClient().delete(resourceGroupName, accountName, blobInventoryPolicyName); + } + + public Response deleteWithResponse( + String resourceGroupName, + String accountName, + BlobInventoryPolicyName blobInventoryPolicyName, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, context); + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return Utils.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 Utils.mapPage(inner, inner1 -> new BlobInventoryPolicyImpl(inner1, this.manager())); + } + + public BlobInventoryPolicy getById(String id) { + String resourceGroupName = Utils.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 = Utils.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))); + } + BlobInventoryPolicyName blobInventoryPolicyName = + BlobInventoryPolicyName.fromString(Utils.getValueFromIdByName(id, "inventoryPolicies")); + if (blobInventoryPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'inventoryPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.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 = Utils.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))); + } + BlobInventoryPolicyName blobInventoryPolicyName = + BlobInventoryPolicyName.fromString(Utils.getValueFromIdByName(id, "inventoryPolicies")); + if (blobInventoryPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'inventoryPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.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 = Utils.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))); + } + BlobInventoryPolicyName blobInventoryPolicyName = + BlobInventoryPolicyName.fromString(Utils.getValueFromIdByName(id, "inventoryPolicies")); + if (blobInventoryPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'inventoryPolicies'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, blobInventoryPolicyName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.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 = Utils.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))); + } + BlobInventoryPolicyName blobInventoryPolicyName = + BlobInventoryPolicyName.fromString(Utils.getValueFromIdByName(id, "inventoryPolicies")); + if (blobInventoryPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'inventoryPolicies'.", id))); + } + 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..3e46c5fd952ad --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobInventoryPolicyImpl.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.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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.blobInventoryPolicyName = + BlobInventoryPolicyName.fromString(Utils.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..115fcba0472b3 --- /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..07fa6f4aa834d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobServicePropertiesImpl.java @@ -0,0 +1,217 @@ +// Copyright (c) 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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.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..5fb49219b7580 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobServicesClientImpl.java @@ -0,0 +1,655 @@ +// Copyright (c) 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.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.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 { + private final ClientLogger logger = new ClientLogger(BlobServicesClientImpl.class); + + /** 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") + private 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. + */ + @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. + */ + @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 response. + */ + @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 response. + */ + @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 response. + */ + @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 response. + */ + @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. + */ + @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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setServicePropertiesAsync( + String resourceGroupName, String accountName, BlobServicePropertiesInner parameters) { + return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 setServicePropertiesAsync(resourceGroupName, accountName, parameters).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response setServicePropertiesWithResponse( + String resourceGroupName, String accountName, BlobServicePropertiesInner parameters, Context context) { + return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters, 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) + 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getServicePropertiesAsync(String resourceGroupName, String accountName) { + return getServicePropertiesWithResponseAsync(resourceGroupName, accountName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getServicePropertiesAsync(resourceGroupName, accountName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response getServicePropertiesWithResponse( + String resourceGroupName, String accountName, Context context) { + return getServicePropertiesWithResponseAsync(resourceGroupName, accountName, context).block(); + } +} 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..7bb954832e01b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/BlobServicesImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BlobServicesImpl implements BlobServices { + @JsonIgnore private 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 Utils.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 Utils.mapPage(inner, inner1 -> new BlobServicePropertiesImpl(inner1, this.manager())); + } + + 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 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 getServicePropertiesById(String id) { + String resourceGroupName = Utils.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 = Utils.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 = Utils.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 = Utils.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..99be5d76d11b1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/CheckNameAvailabilityResultImpl.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.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..3d840edb6fb18 --- /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..2266ec4bf24dc --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/DeletedAccountsClientImpl.java @@ -0,0 +1,456 @@ +// Copyright (c) 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.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.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 { + private final ClientLogger logger = new ClientLogger(DeletedAccountsClientImpl.class); + + /** 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") + private 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String deletedAccountName, String location) { + return getWithResponseAsync(deletedAccountName, location) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(deletedAccountName, location).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Response getWithResponse(String deletedAccountName, String location, Context context) { + return getWithResponseAsync(deletedAccountName, location, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink 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 response from the List Deleted Accounts operation. + */ + @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 nextLink 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 response from the List Deleted Accounts operation. + */ + @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..e81c149d9f31a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/DeletedAccountsImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) 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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DeletedAccountsImpl implements DeletedAccounts { + @JsonIgnore private 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 Utils.mapPage(inner, inner1 -> new DeletedAccountImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new DeletedAccountImpl(inner1, this.manager())); + } + + 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; + } + } + + 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; + } + } + + 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..cc8675302a55d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/EncryptionScopeImpl.java @@ -0,0 +1,174 @@ +// Copyright (c) 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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.encryptionScopeName = Utils.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..e3d0a694f0585 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/EncryptionScopesClientImpl.java @@ -0,0 +1,1054 @@ +// Copyright (c) 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.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.EncryptionScopeListResult; +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 { + private final ClientLogger logger = new ClientLogger(EncryptionScopesClientImpl.class); + + /** 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") + private 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, + @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. + */ + @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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync( + String resourceGroupName, + String accountName, + String encryptionScopeName, + EncryptionScopeInner encryptionScope) { + return putWithResponseAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 putAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response putWithResponse( + String resourceGroupName, + String accountName, + String encryptionScopeName, + EncryptionScopeInner encryptionScope, + Context context) { + return putWithResponseAsync(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) + 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono patchAsync( + String resourceGroupName, + String accountName, + String encryptionScopeName, + EncryptionScopeInner encryptionScope) { + return patchWithResponseAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 patchAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response patchWithResponse( + String resourceGroupName, + String accountName, + String encryptionScopeName, + EncryptionScopeInner encryptionScope, + Context context) { + return patchWithResponseAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope, 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) + 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String accountName, String encryptionScopeName) { + return getWithResponseAsync(resourceGroupName, accountName, encryptionScopeName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, accountName, encryptionScopeName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response getWithResponse( + String resourceGroupName, String accountName, String encryptionScopeName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, encryptionScopeName, context).block(); + } + + /** + * 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. + */ + @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())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @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)); + } + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName), 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, accountName, 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @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 nextLink 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 list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes. + */ + @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 nextLink 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 list of encryption scopes requested, and if paging is required, a URL to the next page of encryption + * scopes. + */ + @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..98df7e00ba176 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/EncryptionScopesImpl.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.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.fasterxml.jackson.annotation.JsonIgnore; + +public final class EncryptionScopesImpl implements EncryptionScopes { + @JsonIgnore private 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 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 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 PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return Utils.mapPage(inner, inner1 -> new EncryptionScopeImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); + return Utils.mapPage(inner, inner1 -> new EncryptionScopeImpl(inner1, this.manager())); + } + + public EncryptionScope getById(String id) { + String resourceGroupName = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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..b1a4317367c15 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServiceItemsImpl.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.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..de52456bbb807 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServicePropertiesImpl.java @@ -0,0 +1,159 @@ +// Copyright (c) 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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.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/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..3f8179a3438ad --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServicesClientImpl.java @@ -0,0 +1,621 @@ +// Copyright (c) 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.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 reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in FileServicesClient. */ +public final class FileServicesClientImpl implements FileServicesClient { + private final ClientLogger logger = new ClientLogger(FileServicesClientImpl.class); + + /** 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") + private 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); + } + + /** + * 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) + 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String accountName) { + return listWithResponseAsync(resourceGroupName, accountName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 listAsync(resourceGroupName, accountName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response listWithResponse( + String resourceGroupName, String accountName, Context context) { + return listWithResponseAsync(resourceGroupName, accountName, 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) + 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setServicePropertiesAsync( + String resourceGroupName, String accountName, FileServicePropertiesInner parameters) { + return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 setServicePropertiesAsync(resourceGroupName, accountName, parameters).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response setServicePropertiesWithResponse( + String resourceGroupName, String accountName, FileServicePropertiesInner parameters, Context context) { + return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters, 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) + 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getServicePropertiesAsync(String resourceGroupName, String accountName) { + return getServicePropertiesWithResponseAsync(resourceGroupName, accountName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getServicePropertiesAsync(resourceGroupName, accountName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response getServicePropertiesWithResponse( + String resourceGroupName, String accountName, Context context) { + return getServicePropertiesWithResponseAsync(resourceGroupName, accountName, context).block(); + } +} 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..1abbfa332a2cb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileServicesImpl.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.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.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.models.FileServiceItems; +import com.azure.resourcemanager.storage.generated.models.FileServiceProperties; +import com.azure.resourcemanager.storage.generated.models.FileServices; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class FileServicesImpl implements FileServices { + @JsonIgnore private 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 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 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 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 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 getServicePropertiesById(String id) { + String resourceGroupName = Utils.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 = Utils.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 = Utils.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 = Utils.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..2577ef9438a1f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileShareImpl.java @@ -0,0 +1,291 @@ +// Copyright (c) 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.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 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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.shareName = Utils.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 void restore(DeletedShare deletedShare) { + serviceManager.fileShares().restore(resourceGroupName, accountName, shareName, deletedShare); + } + + public Response restoreWithResponse(DeletedShare deletedShare, Context context) { + return serviceManager + .fileShares() + .restoreWithResponse(resourceGroupName, accountName, shareName, deletedShare, context); + } + + public LeaseShareResponse lease() { + return serviceManager.fileShares().lease(resourceGroupName, accountName, shareName); + } + + public Response leaseWithResponse( + String xMsSnapshot, LeaseShareRequest parameters, Context context) { + return serviceManager + .fileShares() + .leaseWithResponse(resourceGroupName, accountName, shareName, xMsSnapshot, parameters, context); + } + + public FileShareImpl withMetadata(Map metadata) { + this.innerModel().withMetadata(metadata); + return this; + } + + public FileShareImpl withShareQuota(Integer shareQuota) { + this.innerModel().withShareQuota(shareQuota); + 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 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..5ee21438ba0a9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileShareItemImpl.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.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.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 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 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..be8c02e0e8b21 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileSharesClientImpl.java @@ -0,0 +1,1931 @@ +// Copyright (c) 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.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.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 { + private final ClientLogger logger = new ClientLogger(FileSharesClientImpl.class); + + /** 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") + private 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String accountName, String shareName, FileShareInner fileShare, String expand) { + return createWithResponseAsync(resourceGroupName, accountName, shareName, fileShare, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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) + private Mono createAsync( + String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { + final String expand = null; + return createWithResponseAsync(resourceGroupName, accountName, shareName, fileShare, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 createAsync(resourceGroupName, accountName, shareName, fileShare, expand).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. + * @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. + */ + @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(); + } + + /** + * 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) + 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, String shareName, FileShareInner fileShare) { + return updateWithResponseAsync(resourceGroupName, accountName, shareName, fileShare) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 updateAsync(resourceGroupName, accountName, shareName, fileShare).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Response updateWithResponse( + String resourceGroupName, String accountName, String shareName, FileShareInner fileShare, Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, shareName, fileShare, 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. + * @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. + */ + @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. + */ + @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. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String accountName, String shareName, String expand, String xMsSnapshot) { + return getWithResponseAsync(resourceGroupName, accountName, shareName, expand, xMsSnapshot) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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) + 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, accountName, shareName, expand, xMsSnapshot).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. + * @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. + */ + @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(); + } + + /** + * 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 completion. + */ + @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 completion. + */ + @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. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String accountName, String shareName, String xMsSnapshot, String include) { + return deleteWithResponseAsync(resourceGroupName, accountName, shareName, xMsSnapshot, include) + .flatMap((Response res) -> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @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((Response res) -> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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; + deleteAsync(resourceGroupName, accountName, shareName, xMsSnapshot, include).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. + * @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 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(); + } + + /** + * 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 deleted share to be restored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @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 deleted share to be restored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @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 deleted share to be restored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restoreAsync( + String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare) { + return restoreWithResponseAsync(resourceGroupName, accountName, shareName, deletedShare) + .flatMap((Response res) -> 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 deleted share to be restored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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) { + restoreAsync(resourceGroupName, accountName, shareName, deletedShare).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 deleted share to be restored. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response restoreWithResponse( + String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare, Context context) { + return restoreWithResponseAsync(resourceGroupName, accountName, shareName, deletedShare, 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. + * @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. + */ + @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. + */ + @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. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono leaseAsync( + String resourceGroupName, + String accountName, + String shareName, + String xMsSnapshot, + LeaseShareRequest parameters) { + return leaseWithResponseAsync(resourceGroupName, accountName, shareName, xMsSnapshot, parameters) + .flatMap( + (FileSharesLeaseResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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) + 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( + (FileSharesLeaseResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 leaseAsync(resourceGroupName, accountName, shareName, xMsSnapshot, parameters).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. + * @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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink 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 response schema. + */ + @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 nextLink 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 response schema. + */ + @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..ac7d4657acda8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/FileSharesImpl.java @@ -0,0 +1,271 @@ +// Copyright (c) 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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class FileSharesImpl implements FileShares { + @JsonIgnore private 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 Utils.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 Utils.mapPage(inner, inner1 -> new FileShareItemImpl(inner1, this.manager())); + } + + 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 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 void delete(String resourceGroupName, String accountName, String shareName) { + this.serviceClient().delete(resourceGroupName, accountName, shareName); + } + + 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 restore(String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare) { + this.serviceClient().restore(resourceGroupName, accountName, shareName, deletedShare); + } + + public Response restoreWithResponse( + String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare, Context context) { + return this + .serviceClient() + .restoreWithResponse(resourceGroupName, accountName, shareName, deletedShare, context); + } + + 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 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 FileShare getById(String id) { + String resourceGroupName = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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) + .getValue(); + } + + public Response deleteByIdWithResponse(String id, String xMsSnapshot, String include, Context context) { + String resourceGroupName = Utils.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 = Utils.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 = Utils.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..c08350fb75aef --- /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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.containerName = Utils.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 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..07e2ecbd2b884 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LeaseContainerResponseImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) 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..775b2061d835b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LeaseShareResponseImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) 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..26ad21e3a86f7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/LegalHoldImpl.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.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 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..f25e2893b4739 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListAccountSasResponseImpl.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.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..ec44a5cde4c79 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListContainerItemImpl.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.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 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..1d661e956ca83 --- /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..1607329b37bba --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListQueueServicesImpl.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.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..0c693fc99f586 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListServiceSasResponseImpl.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.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..6c789363556de --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ListTableServicesImpl.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.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/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..c1c780d1bbaec --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ManagementPoliciesClientImpl.java @@ -0,0 +1,660 @@ +// Copyright (c) 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.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.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 { + private final ClientLogger logger = new ClientLogger(ManagementPoliciesClientImpl.class); + + /** 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") + private 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. + */ + @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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName) { + return getWithResponseAsync(resourceGroupName, accountName, managementPolicyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, accountName, managementPolicyName).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'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response getWithResponse( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, managementPolicyName, 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) + 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String accountName, + ManagementPolicyName managementPolicyName, + ManagementPolicyInner properties) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, managementPolicyName, properties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 createOrUpdateAsync(resourceGroupName, accountName, managementPolicyName, properties).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + ManagementPolicyName managementPolicyName, + ManagementPolicyInner properties, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, accountName, managementPolicyName, properties, 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. + * @return the completion. + */ + @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 completion. + */ + @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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName) { + return deleteWithResponseAsync(resourceGroupName, accountName, managementPolicyName) + .flatMap((Response res) -> 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'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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) { + deleteAsync(resourceGroupName, accountName, managementPolicyName).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'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response deleteWithResponse( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, managementPolicyName, context).block(); + } +} 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..46d1f3eac593e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ManagementPoliciesImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ManagementPoliciesImpl implements ManagementPolicies { + @JsonIgnore private 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 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 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 void delete(String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName) { + this.serviceClient().delete(resourceGroupName, accountName, managementPolicyName); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, managementPolicyName, context); + } + + public ManagementPolicy getById(String id) { + String resourceGroupName = Utils.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 = Utils.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))); + } + ManagementPolicyName managementPolicyName = + ManagementPolicyName.fromString(Utils.getValueFromIdByName(id, "managementPolicies")); + if (managementPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managementPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, managementPolicyName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.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 = Utils.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))); + } + ManagementPolicyName managementPolicyName = + ManagementPolicyName.fromString(Utils.getValueFromIdByName(id, "managementPolicies")); + if (managementPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managementPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, managementPolicyName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.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 = Utils.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))); + } + ManagementPolicyName managementPolicyName = + ManagementPolicyName.fromString(Utils.getValueFromIdByName(id, "managementPolicies")); + if (managementPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managementPolicies'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, managementPolicyName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.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 = Utils.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))); + } + ManagementPolicyName managementPolicyName = + ManagementPolicyName.fromString(Utils.getValueFromIdByName(id, "managementPolicies")); + if (managementPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managementPolicies'.", id))); + } + 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..54e52322e313b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ManagementPolicyImpl.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.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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.managementPolicyName = + ManagementPolicyName.fromString(Utils.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/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..81b75e13e0cb5 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ObjectReplicationPoliciesOperationsClientImpl.java @@ -0,0 +1,929 @@ +// Copyright (c) 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.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.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 { + private final ClientLogger logger = new ClientLogger(ObjectReplicationPoliciesOperationsClientImpl.class); + + /** 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") + private 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String accountName, String objectReplicationPolicyId) { + return getWithResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, accountName, objectReplicationPolicyId).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response getWithResponse( + String resourceGroupName, String accountName, String objectReplicationPolicyId, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId, 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) + 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String accountName, + String objectReplicationPolicyId, + ObjectReplicationPolicyInner properties) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId, properties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 createOrUpdateAsync(resourceGroupName, accountName, objectReplicationPolicyId, properties).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + String objectReplicationPolicyId, + ObjectReplicationPolicyInner properties, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, accountName, objectReplicationPolicyId, properties, 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. + * @return the completion. + */ + @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 completion. + */ + @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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String objectReplicationPolicyId) { + return deleteWithResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId) + .flatMap((Response res) -> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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) { + deleteAsync(resourceGroupName, accountName, objectReplicationPolicyId).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response deleteWithResponse( + String resourceGroupName, String accountName, String objectReplicationPolicyId, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, objectReplicationPolicyId, context).block(); + } +} 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..e4a7f76cffde5 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ObjectReplicationPoliciesOperationsImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ObjectReplicationPoliciesOperationsImpl implements ObjectReplicationPoliciesOperations { + @JsonIgnore private 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 Utils.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 Utils.mapPage(inner, inner1 -> new ObjectReplicationPolicyImpl(inner1, this.manager())); + } + + 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 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 void delete(String resourceGroupName, String accountName, String objectReplicationPolicyId) { + this.serviceClient().delete(resourceGroupName, accountName, objectReplicationPolicyId); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, String objectReplicationPolicyId, Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, accountName, objectReplicationPolicyId, context); + } + + public ObjectReplicationPolicy getById(String id) { + String resourceGroupName = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.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 = Utils.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 = Utils.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..e7c406ca51b9e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/ObjectReplicationPolicyImpl.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.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.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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.objectReplicationPolicyId = Utils.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; + } +} 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..fd0c003c519e3 --- /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..700b7035281c2 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/OperationsClientImpl.java @@ -0,0 +1,176 @@ +// Copyright (c) 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.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.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 { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** 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") + private 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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..1347c6ebd2b71 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/OperationsImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private 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 Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.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..50b2b3a0c8151 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,159 @@ +// Copyright (c) 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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.privateEndpointConnectionName = Utils.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..4d0f23eea1db6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,889 @@ +// Copyright (c) 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.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.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 { + private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsClientImpl.class); + + /** 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") + private 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String accountName, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, accountName, privateEndpointConnectionName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response getWithResponse( + String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName, 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) + 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync( + String resourceGroupName, + String accountName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties) { + return putWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName, properties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 putAsync(resourceGroupName, accountName, privateEndpointConnectionName, properties).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response putWithResponse( + String resourceGroupName, + String accountName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties, + Context context) { + return putWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName, properties, 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. + * @return the completion. + */ + @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 completion. + */ + @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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName) { + return deleteWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName) + .flatMap((Response res) -> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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) { + deleteAsync(resourceGroupName, accountName, privateEndpointConnectionName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response deleteWithResponse( + String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName, context).block(); + } +} 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..f89f0afa93d1a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateEndpointConnectionsImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + @JsonIgnore private 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 Utils.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 Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + 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 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 void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, accountName, privateEndpointConnectionName); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, context); + } + + public PrivateEndpointConnection getById(String id) { + String resourceGroupName = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.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 = Utils.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 = Utils.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..b261db709053d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateLinkResourceListResultImpl.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.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..20993a90df08c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateLinkResourcesClientImpl.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.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.core.util.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesClientImpl.class); + + /** 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") + private 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. + */ + @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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByStorageAccountAsync( + String resourceGroupName, String accountName) { + return listByStorageAccountWithResponseAsync(resourceGroupName, accountName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 listByStorageAccountAsync(resourceGroupName, accountName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response listByStorageAccountWithResponse( + String resourceGroupName, String accountName, Context context) { + return listByStorageAccountWithResponseAsync(resourceGroupName, accountName, context).block(); + } +} 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..ef52c187f4d95 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,63 @@ +// Copyright (c) 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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateLinkResourcesImpl implements PrivateLinkResources { + @JsonIgnore private 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 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; + } + } + + 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; + } + } + + 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..c254b162c8f5a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueueServicePropertiesImpl.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.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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.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..e5372b70a4b66 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueueServicesClientImpl.java @@ -0,0 +1,631 @@ +// Copyright (c) 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.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 reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in QueueServicesClient. */ +public final class QueueServicesClientImpl implements QueueServicesClient { + private final ClientLogger logger = new ClientLogger(QueueServicesClientImpl.class); + + /** 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") + private 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. + */ + @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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String accountName) { + return listWithResponseAsync(resourceGroupName, accountName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 listAsync(resourceGroupName, accountName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response listWithResponse( + String resourceGroupName, String accountName, Context context) { + return listWithResponseAsync(resourceGroupName, accountName, 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) + 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setServicePropertiesAsync( + String resourceGroupName, String accountName, QueueServicePropertiesInner parameters) { + return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 setServicePropertiesAsync(resourceGroupName, accountName, parameters).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response setServicePropertiesWithResponse( + String resourceGroupName, String accountName, QueueServicePropertiesInner parameters, Context context) { + return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters, 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) + 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getServicePropertiesAsync(String resourceGroupName, String accountName) { + return getServicePropertiesWithResponseAsync(resourceGroupName, accountName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getServicePropertiesAsync(resourceGroupName, accountName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response getServicePropertiesWithResponse( + String resourceGroupName, String accountName, Context context) { + return getServicePropertiesWithResponseAsync(resourceGroupName, accountName, context).block(); + } +} 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..8f9fa58d22b99 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueueServicesImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class QueueServicesImpl implements QueueServices { + @JsonIgnore private 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 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 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 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 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 getServicePropertiesById(String id) { + String resourceGroupName = Utils.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 = Utils.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 = Utils.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 = Utils.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..4b109744b6d96 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueuesClientImpl.java @@ -0,0 +1,1223 @@ +// Copyright (c) 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.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.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 { + private final ClientLogger logger = new ClientLogger(QueuesClientImpl.class); + + /** 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") + private 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. + */ + @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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String accountName, String queueName, StorageQueueInner queue) { + return createWithResponseAsync(resourceGroupName, accountName, queueName, queue) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 createAsync(resourceGroupName, accountName, queueName, queue).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 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) + 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, String queueName, StorageQueueInner queue) { + return updateWithResponseAsync(resourceGroupName, accountName, queueName, queue) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 updateAsync(resourceGroupName, accountName, queueName, queue).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response updateWithResponse( + String resourceGroupName, String accountName, String queueName, StorageQueueInner queue, Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, queueName, queue, 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) + 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String queueName) { + return getWithResponseAsync(resourceGroupName, accountName, queueName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, accountName, queueName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response getWithResponse( + String resourceGroupName, String accountName, String queueName, Context context) { + return getWithResponseAsync(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. + * @return the completion. + */ + @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 completion. + */ + @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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String queueName) { + return deleteWithResponseAsync(resourceGroupName, accountName, queueName) + .flatMap((Response res) -> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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) { + deleteAsync(resourceGroupName, accountName, queueName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response deleteWithResponse( + String resourceGroupName, String accountName, String queueName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, queueName, context).block(); + } + + /** + * 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 nextLink 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 response schema. + */ + @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 nextLink 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 response schema. + */ + @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..1a5a4981d44a3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/QueuesImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class QueuesImpl implements Queues { + @JsonIgnore private 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 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 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 void delete(String resourceGroupName, String accountName, String queueName) { + this.serviceClient().delete(resourceGroupName, accountName, queueName); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, String queueName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, queueName, context); + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return Utils.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 Utils.mapPage(inner, inner1 -> new ListQueueImpl(inner1, this.manager())); + } + + public StorageQueue getById(String id) { + String resourceGroupName = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.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 = Utils.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 = Utils.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/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..c7d6ab438ccae --- /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..ec4af3801d453 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/SkusClientImpl.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.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.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.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 { + private final ClientLogger logger = new ClientLogger(SkusClientImpl.class); + + /** 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") + private 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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..0e1c5c6738477 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/SkusImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SkusImpl implements Skus { + @JsonIgnore private 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 Utils.mapPage(inner, inner1 -> new SkuInformationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.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..c826905d66102 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountImpl.java @@ -0,0 +1,618 @@ +// Copyright (c) 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.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.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.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.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.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.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 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.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 StorageAccountListKeysResult listKeys() { + return serviceManager.storageAccounts().listKeys(resourceGroupName, accountName); + } + + public Response listKeysWithResponse(ListKeyExpand expand, Context context) { + return serviceManager.storageAccounts().listKeysWithResponse(resourceGroupName, accountName, expand, context); + } + + public StorageAccountListKeysResult regenerateKey(StorageAccountRegenerateKeyParameters regenerateKey) { + return serviceManager.storageAccounts().regenerateKey(resourceGroupName, accountName, regenerateKey); + } + + public Response regenerateKeyWithResponse( + StorageAccountRegenerateKeyParameters regenerateKey, Context context) { + return serviceManager + .storageAccounts() + .regenerateKeyWithResponse(resourceGroupName, accountName, regenerateKey, context); + } + + public ListAccountSasResponse listAccountSas(AccountSasParameters parameters) { + return serviceManager.storageAccounts().listAccountSas(resourceGroupName, accountName, parameters); + } + + public Response listAccountSasWithResponse( + AccountSasParameters parameters, Context context) { + return serviceManager + .storageAccounts() + .listAccountSasWithResponse(resourceGroupName, accountName, parameters, context); + } + + public ListServiceSasResponse listServiceSas(ServiceSasParameters parameters) { + return serviceManager.storageAccounts().listServiceSas(resourceGroupName, accountName, parameters); + } + + public Response listServiceSasWithResponse( + ServiceSasParameters parameters, Context context) { + return serviceManager + .storageAccounts() + .listServiceSasWithResponse(resourceGroupName, accountName, parameters, context); + } + + public void failover() { + serviceManager.storageAccounts().failover(resourceGroupName, accountName); + } + + public void failover(Context context) { + serviceManager.storageAccounts().failover(resourceGroupName, accountName, 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 void revokeUserDelegationKeys() { + serviceManager.storageAccounts().revokeUserDelegationKeys(resourceGroupName, accountName); + } + + public Response revokeUserDelegationKeysWithResponse(Context context) { + return serviceManager + .storageAccounts() + .revokeUserDelegationKeysWithResponse(resourceGroupName, accountName, context); + } + + 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 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 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; + } + } + + 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..79bb96317f120 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountListKeysResultImpl.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.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/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..b4f82c4ea080c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountsClientImpl.java @@ -0,0 +1,3222 @@ +// Copyright (c) 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.logging.ClientLogger; +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.models.AccountSasParameters; +import com.azure.resourcemanager.storage.generated.models.BlobRestoreParameters; +import com.azure.resourcemanager.storage.generated.models.ListKeyExpand; +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 { + private final ClientLogger logger = new ClientLogger(StorageAccountsClientImpl.class); + + /** 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") + private 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, + 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. + */ + @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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + StorageAccountCheckNameAvailabilityParameters accountName) { + return checkNameAvailabilityWithResponseAsync(accountName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 checkNameAvailabilityAsync(accountName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response checkNameAvailabilityWithResponse( + StorageAccountCheckNameAvailabilityParameters accountName, Context context) { + return checkNameAvailabilityWithResponseAsync(accountName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + 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. + */ + @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 storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, + Context.NONE); + } + + /** + * 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) + 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 storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, StorageAccountInner> beginCreate( + String resourceGroupName, String accountName, StorageAccountCreateParameters parameters) { + return 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 storage account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, StorageAccountInner> beginCreate( + String resourceGroupName, String accountName, StorageAccountCreateParameters parameters, Context context) { + return 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. + */ + @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. + */ + @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 completion. + */ + @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 completion. + */ + @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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName) { + return deleteWithResponseAsync(resourceGroupName, accountName).flatMap((Response res) -> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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) { + deleteAsync(resourceGroupName, accountName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response deleteWithResponse(String resourceGroupName, String accountName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, 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. + * @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. + */ + @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. + */ + @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. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String accountName, StorageAccountExpand expand) { + return getByResourceGroupWithResponseAsync(resourceGroupName, accountName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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) + private Mono getByResourceGroupAsync(String resourceGroupName, String accountName) { + final StorageAccountExpand expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, accountName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getByResourceGroupAsync(resourceGroupName, accountName, expand).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. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, StorageAccountExpand expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, accountName, expand, 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) + 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters) { + return updateWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 updateAsync(resourceGroupName, accountName, parameters).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response updateWithResponse( + String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listKeysAsync( + String resourceGroupName, String accountName, ListKeyExpand expand) { + return listKeysWithResponseAsync(resourceGroupName, accountName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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) + private Mono listKeysAsync(String resourceGroupName, String accountName) { + final ListKeyExpand expand = null; + return listKeysWithResponseAsync(resourceGroupName, accountName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 listKeysAsync(resourceGroupName, accountName, expand).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. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listKeysWithResponse( + String resourceGroupName, String accountName, ListKeyExpand expand, Context context) { + return listKeysWithResponseAsync(resourceGroupName, accountName, expand, 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) + 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateKeyAsync( + String resourceGroupName, String accountName, StorageAccountRegenerateKeyParameters regenerateKey) { + return regenerateKeyWithResponseAsync(resourceGroupName, accountName, regenerateKey) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 regenerateKeyAsync(resourceGroupName, accountName, regenerateKey).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response regenerateKeyWithResponse( + String resourceGroupName, + String accountName, + StorageAccountRegenerateKeyParameters regenerateKey, + Context context) { + return regenerateKeyWithResponseAsync(resourceGroupName, accountName, regenerateKey, 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) + 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAccountSasAsync( + String resourceGroupName, String accountName, AccountSasParameters parameters) { + return listAccountSasWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 listAccountSasAsync(resourceGroupName, accountName, parameters).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response listAccountSasWithResponse( + String resourceGroupName, String accountName, AccountSasParameters parameters, Context context) { + return listAccountSasWithResponseAsync(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) + 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listServiceSasAsync( + String resourceGroupName, String accountName, ServiceSasParameters parameters) { + return listServiceSasWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 listServiceSasAsync(resourceGroupName, accountName, parameters).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response listServiceSasWithResponse( + String resourceGroupName, String accountName, ServiceSasParameters parameters, Context context) { + return listServiceSasWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> failoverWithResponseAsync(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 + .failover( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> failoverWithResponseAsync( + 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 + .failover( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + context); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginFailoverAsync(String resourceGroupName, String accountName) { + Mono>> mono = failoverWithResponseAsync(resourceGroupName, accountName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginFailoverAsync( + String resourceGroupName, String accountName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = failoverWithResponseAsync(resourceGroupName, accountName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginFailover(String resourceGroupName, String accountName) { + return beginFailoverAsync(resourceGroupName, accountName).getSyncPoller(); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginFailover( + String resourceGroupName, String accountName, Context context) { + return beginFailoverAsync(resourceGroupName, accountName, context).getSyncPoller(); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono failoverAsync(String resourceGroupName, String accountName) { + return beginFailoverAsync(resourceGroupName, accountName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono failoverAsync(String resourceGroupName, String accountName, Context context) { + return beginFailoverAsync(resourceGroupName, accountName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within 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) { + failoverAsync(resourceGroupName, accountName).block(); + } + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the 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 failover(String resourceGroupName, String accountName, Context context) { + failoverAsync(resourceGroupName, accountName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + 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. + */ + @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 blob restore status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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, + Context.NONE); + } + + /** + * 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) + 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 blob restore status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, BlobRestoreStatusInner> beginRestoreBlobRanges( + String resourceGroupName, String accountName, BlobRestoreParameters parameters) { + return 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 blob restore status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, BlobRestoreStatusInner> beginRestoreBlobRanges( + String resourceGroupName, String accountName, BlobRestoreParameters parameters, Context context) { + return 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. + */ + @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. + */ + @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 completion. + */ + @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 completion. + */ + @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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono revokeUserDelegationKeysAsync(String resourceGroupName, String accountName) { + return revokeUserDelegationKeysWithResponseAsync(resourceGroupName, accountName) + .flatMap((Response res) -> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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) { + revokeUserDelegationKeysAsync(resourceGroupName, accountName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response revokeUserDelegationKeysWithResponse( + String resourceGroupName, String accountName, Context context) { + return revokeUserDelegationKeysWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink 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 response from the List Storage Accounts operation. + */ + @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 nextLink 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 response from the List Storage Accounts operation. + */ + @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 nextLink 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 response from the List Storage Accounts operation. + */ + @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 nextLink 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 response from the List Storage Accounts operation. + */ + @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..5e9206cb77277 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageAccountsImpl.java @@ -0,0 +1,363 @@ +// Copyright (c) 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.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.ListAccountSasResponse; +import com.azure.resourcemanager.storage.generated.models.ListKeyExpand; +import com.azure.resourcemanager.storage.generated.models.ListServiceSasResponse; +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.StorageAccountRegenerateKeyParameters; +import com.azure.resourcemanager.storage.generated.models.StorageAccounts; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class StorageAccountsImpl implements StorageAccounts { + @JsonIgnore private 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 CheckNameAvailabilityResult checkNameAvailability( + StorageAccountCheckNameAvailabilityParameters accountName) { + CheckNameAvailabilityResultInner inner = this.serviceClient().checkNameAvailability(accountName); + if (inner != null) { + return new CheckNameAvailabilityResultImpl(inner, this.manager()); + } else { + return null; + } + } + + 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 void deleteByResourceGroup(String resourceGroupName, String accountName) { + this.serviceClient().delete(resourceGroupName, accountName); + } + + public Response deleteWithResponse(String resourceGroupName, String accountName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, context); + } + + 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 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 PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new StorageAccountImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new StorageAccountImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new StorageAccountImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new StorageAccountImpl(inner1, this.manager())); + } + + 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 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 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 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 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 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 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 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 void failover(String resourceGroupName, String accountName) { + this.serviceClient().failover(resourceGroupName, accountName); + } + + public void failover(String resourceGroupName, String accountName, Context context) { + this.serviceClient().failover(resourceGroupName, accountName, context); + } + + 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 void revokeUserDelegationKeys(String resourceGroupName, String accountName) { + this.serviceClient().revokeUserDelegationKeys(resourceGroupName, accountName); + } + + public Response revokeUserDelegationKeysWithResponse( + String resourceGroupName, String accountName, Context context) { + return this.serviceClient().revokeUserDelegationKeysWithResponse(resourceGroupName, accountName, context); + } + + public StorageAccount getById(String id) { + String resourceGroupName = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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 = Utils.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.deleteWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.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 = Utils.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.deleteWithResponse(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..42f9e6406cb8a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageManagementClientBuilder.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.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +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 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 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 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() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + StorageManagementClientImpl client = + new StorageManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + 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..b48c5d4998f39 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageManagementClientImpl.java @@ -0,0 +1,545 @@ +// Copyright (c) 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.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.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.ManagementPoliciesClient; +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.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 java.util.Map; +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 { + private final ClientLogger logger = new ClientLogger(StorageManagementClientImpl.class); + + /** 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 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 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 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 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; + } + + /** + * 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 = "2021-04-01"; + 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.encryptionScopes = new EncryptionScopesClientImpl(this); + 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.tableServices = new TableServicesClientImpl(this); + this.tables = new TablesClientImpl(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) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return 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(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)); + } + } +} 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..a1eb289703b6d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/StorageQueueImpl.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.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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.queueName = Utils.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/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..92a48923ea2a8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableImpl.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.implementation; + +import com.azure.resourcemanager.storage.generated.fluent.models.TableInner; +import com.azure.resourcemanager.storage.generated.models.Table; + +public final class TableImpl implements Table { + private TableInner innerObject; + + private final com.azure.resourcemanager.storage.generated.StorageManager serviceManager; + + TableImpl(TableInner 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 tableName() { + return this.innerModel().tableName(); + } + + public TableInner 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/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..ce9b69563001a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableServicePropertiesImpl.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.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 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.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..e53712aa62801 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableServicesClientImpl.java @@ -0,0 +1,631 @@ +// Copyright (c) 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.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 reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in TableServicesClient. */ +public final class TableServicesClientImpl implements TableServicesClient { + private final ClientLogger logger = new ClientLogger(TableServicesClientImpl.class); + + /** 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") + private 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. + */ + @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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String accountName) { + return listWithResponseAsync(resourceGroupName, accountName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 listAsync(resourceGroupName, accountName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response listWithResponse( + String resourceGroupName, String accountName, Context context) { + return listWithResponseAsync(resourceGroupName, accountName, 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) + 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setServicePropertiesAsync( + String resourceGroupName, String accountName, TableServicePropertiesInner parameters) { + return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 setServicePropertiesAsync(resourceGroupName, accountName, parameters).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response setServicePropertiesWithResponse( + String resourceGroupName, String accountName, TableServicePropertiesInner parameters, Context context) { + return setServicePropertiesWithResponseAsync(resourceGroupName, accountName, parameters, 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) + 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getServicePropertiesAsync(String resourceGroupName, String accountName) { + return getServicePropertiesWithResponseAsync(resourceGroupName, accountName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getServicePropertiesAsync(resourceGroupName, accountName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response getServicePropertiesWithResponse( + String resourceGroupName, String accountName, Context context) { + return getServicePropertiesWithResponseAsync(resourceGroupName, accountName, context).block(); + } +} 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..d0aa667718348 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TableServicesImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class TableServicesImpl implements TableServices { + @JsonIgnore private 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 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 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 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 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 getServicePropertiesById(String id) { + String resourceGroupName = Utils.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 = Utils.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 = Utils.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 = Utils.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..e25cdb9634fb6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TablesClientImpl.java @@ -0,0 +1,1112 @@ +// Copyright (c) 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.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.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.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 { + private final ClientLogger logger = new ClientLogger(TablesClientImpl.class); + + /** 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") + private 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, + @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, + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + private Mono> createWithResponseAsync( + 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 + .create( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + tableName, + 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + private Mono> createWithResponseAsync( + 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 + .create( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + tableName, + 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String accountName, String tableName) { + return createWithResponseAsync(resourceGroupName, accountName, tableName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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) { + return createAsync(resourceGroupName, accountName, tableName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Response createWithResponse( + String resourceGroupName, String accountName, String tableName, Context context) { + return createWithResponseAsync(resourceGroupName, accountName, tableName, 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) + private Mono> updateWithResponseAsync( + 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 + .update( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + tableName, + 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + private Mono> updateWithResponseAsync( + 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 + .update( + this.client.getEndpoint(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + tableName, + 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String accountName, String tableName) { + return updateWithResponseAsync(resourceGroupName, accountName, tableName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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) { + return updateAsync(resourceGroupName, accountName, tableName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Response updateWithResponse( + String resourceGroupName, String accountName, String tableName, Context context) { + return updateWithResponseAsync(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) + 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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String tableName) { + return getWithResponseAsync(resourceGroupName, accountName, tableName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, accountName, tableName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response getWithResponse( + String resourceGroupName, String accountName, String tableName, Context context) { + return getWithResponseAsync(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. + * @return the completion. + */ + @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 completion. + */ + @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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String tableName) { + return deleteWithResponseAsync(resourceGroupName, accountName, tableName) + .flatMap((Response res) -> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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) { + deleteAsync(resourceGroupName, accountName, tableName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Response deleteWithResponse( + String resourceGroupName, String accountName, String tableName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, tableName, context).block(); + } + + /** + * 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 nextLink 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 response schema. + */ + @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 nextLink 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 response schema. + */ + @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..32d28aa36fb3e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/TablesImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class TablesImpl implements Tables { + @JsonIgnore private 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 Table create(String resourceGroupName, String accountName, String tableName) { + TableInner inner = this.serviceClient().create(resourceGroupName, accountName, tableName); + if (inner != null) { + return new TableImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createWithResponse( + String resourceGroupName, String accountName, String tableName, Context context) { + Response inner = + this.serviceClient().createWithResponse(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 update(String resourceGroupName, String accountName, String tableName) { + TableInner inner = this.serviceClient().update(resourceGroupName, accountName, tableName); + if (inner != null) { + return new TableImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response
updateWithResponse( + String resourceGroupName, String accountName, String tableName, Context context) { + Response inner = + this.serviceClient().updateWithResponse(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
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 void delete(String resourceGroupName, String accountName, String tableName) { + this.serviceClient().delete(resourceGroupName, accountName, tableName); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, String tableName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, tableName, context); + } + + public PagedIterable
list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return Utils.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 Utils.mapPage(inner, inner1 -> new TableImpl(inner1, this.manager())); + } + + private TablesClient 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/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..ca9338202c343 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/UsagesClientImpl.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.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.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.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 { + private final ClientLogger logger = new ClientLogger(UsagesClientImpl.class); + + /** 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") + private 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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..03d21f348fc11 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/UsagesImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class UsagesImpl implements Usages { + @JsonIgnore private 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 Utils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public PagedIterable listByLocation(String location, Context context) { + PagedIterable inner = this.serviceClient().listByLocation(location, context); + return Utils.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/Utils.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/Utils.java new file mode 100644 index 0000000000000..e9456b247b1f4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/Utils.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.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 Utils { + 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.size() > 0 && 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, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + 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/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..bc02703abe68e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/implementation/package-info.java @@ -0,0 +1,6 @@ +// 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..1e34d0ed7760d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccessPolicy.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The AccessPolicy model. */ +@Fluent +public final class AccessPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AccessPolicy.class); + + /* + * Start time of the access policy + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * Expiry time of the access policy + */ + @JsonProperty(value = "expiryTime") + private OffsetDateTime expiryTime; + + /* + * List of abbreviated permissions. + */ + @JsonProperty(value = "permission") + private String permission; + + /** + * 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() { + } +} 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..63603a282351c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccessTier.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for AccessTier. */ +public enum AccessTier { + /** Enum value Hot. */ + HOT("Hot"), + + /** Enum value Cool. */ + COOL("Cool"); + + /** 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. + */ + @JsonCreator + public static AccessTier fromString(String value) { + AccessTier[] items = AccessTier.values(); + for (AccessTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @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/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..1dd66610c7592 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountSasParameters.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The parameters to list SAS credentials of a storage account. */ +@Fluent +public final class AccountSasParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AccountSasParameters.class); + + /* + * The signed services accessible with the account SAS. Possible values + * include: Blob (b), Queue (q), Table (t), File (f). + */ + @JsonProperty(value = "signedServices", required = true) + 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. + */ + @JsonProperty(value = "signedResourceTypes", required = true) + 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). + */ + @JsonProperty(value = "signedPermission", required = true) + private Permissions permissions; + + /* + * An IP address or a range of IP addresses from which to accept requests. + */ + @JsonProperty(value = "signedIp") + private String ipAddressOrRange; + + /* + * The protocol permitted for a request made with the account SAS. + */ + @JsonProperty(value = "signedProtocol") + private HttpProtocol protocols; + + /* + * The time at which the SAS becomes valid. + */ + @JsonProperty(value = "signedStart") + private OffsetDateTime sharedAccessStartTime; + + /* + * The time at which the shared access signature becomes invalid. + */ + @JsonProperty(value = "signedExpiry", required = true) + private OffsetDateTime sharedAccessExpiryTime; + + /* + * The key to sign the account SAS token with. + */ + @JsonProperty(value = "keyToSign") + private String keyToSign; + + /** + * 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property services in model AccountSasParameters")); + } + if (resourceTypes() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property resourceTypes in model AccountSasParameters")); + } + if (permissions() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property permissions in model AccountSasParameters")); + } + if (sharedAccessExpiryTime() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sharedAccessExpiryTime in model AccountSasParameters")); + } + } +} 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..64d2fec0a2efa --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AccountStatus.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for AccountStatus. */ +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. + */ + @JsonCreator + public static AccountStatus fromString(String value) { + AccountStatus[] items = AccountStatus.values(); + for (AccountStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @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/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..5a8626a88ff79 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Action.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.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for Action. */ +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. + */ + @JsonCreator + public static Action fromString(String value) { + Action[] items = Action.values(); + for (Action item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @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..2f307171774a7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ActiveDirectoryProperties.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Settings properties for Active Directory (AD). */ +@Fluent +public final class ActiveDirectoryProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ActiveDirectoryProperties.class); + + /* + * Specifies the primary domain that the AD DNS server is authoritative + * for. + */ + @JsonProperty(value = "domainName", required = true) + private String domainName; + + /* + * Specifies the NetBIOS domain name. + */ + @JsonProperty(value = "netBiosDomainName", required = true) + private String netBiosDomainName; + + /* + * Specifies the Active Directory forest to get. + */ + @JsonProperty(value = "forestName", required = true) + private String forestName; + + /* + * Specifies the domain GUID. + */ + @JsonProperty(value = "domainGuid", required = true) + private String domainGuid; + + /* + * Specifies the security identifier (SID). + */ + @JsonProperty(value = "domainSid", required = true) + private String domainSid; + + /* + * Specifies the security identifier (SID) for Azure Storage. + */ + @JsonProperty(value = "azureStorageSid", required = true) + private String azureStorageSid; + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (domainName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property domainName in model ActiveDirectoryProperties")); + } + if (netBiosDomainName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property netBiosDomainName in model ActiveDirectoryProperties")); + } + if (forestName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property forestName in model ActiveDirectoryProperties")); + } + if (domainGuid() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property domainGuid in model ActiveDirectoryProperties")); + } + if (domainSid() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property domainSid in model ActiveDirectoryProperties")); + } + if (azureStorageSid() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property azureStorageSid in model ActiveDirectoryProperties")); + } + } +} 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..7750f47f8e043 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AzureEntityResource.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.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The resource model definition for an Azure Resource Manager resource with an etag. */ +@Immutable +public class AzureEntityResource extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureEntityResource.class); + + /* + * Resource Etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the etag property: Resource Etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * 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/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..d7518a6e0342d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/AzureFilesIdentityBasedAuthentication.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.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Settings for Azure Files identity based authentication. */ +@Fluent +public final class AzureFilesIdentityBasedAuthentication { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFilesIdentityBasedAuthentication.class); + + /* + * Indicates the directory service used. + */ + @JsonProperty(value = "directoryServiceOptions", required = true) + private DirectoryServiceOptions directoryServiceOptions; + + /* + * Required if choose AD. + */ + @JsonProperty(value = "activeDirectoryProperties") + private ActiveDirectoryProperties activeDirectoryProperties; + + /* + * Default share permission for users using Kerberos authentication if RBAC + * role is not assigned. + */ + @JsonProperty(value = "defaultSharePermission") + private DefaultSharePermission defaultSharePermission; + + /** + * Get the directoryServiceOptions property: Indicates the directory service used. + * + * @return the directoryServiceOptions value. + */ + public DirectoryServiceOptions directoryServiceOptions() { + return this.directoryServiceOptions; + } + + /** + * Set the directoryServiceOptions property: Indicates the directory service used. + * + * @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 choose AD. + * + * @return the activeDirectoryProperties value. + */ + public ActiveDirectoryProperties activeDirectoryProperties() { + return this.activeDirectoryProperties; + } + + /** + * Set the activeDirectoryProperties property: Required if choose AD. + * + * @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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property directoryServiceOptions in model" + + " AzureFilesIdentityBasedAuthentication")); + } + if (activeDirectoryProperties() != null) { + activeDirectoryProperties().validate(); + } + } +} 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..411e46519efe4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainer.java @@ -0,0 +1,484 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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 { + /** + * 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); + } + } + /** + * 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 { + /** + * 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); + } + } + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. + */ + Response setLegalHoldWithResponse(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); + + /** + * 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. + */ + Response clearLegalHoldWithResponse(LegalHoldInner legalHold, 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(); + + /** + * 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. + */ + Response leaseWithResponse(LeaseContainerRequest parameters, 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. + * + * @throws com.azure.core.management.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..0c6be04e678c2 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainers.java @@ -0,0 +1,585 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. + */ + 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. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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. + */ + Response getWithResponse( + 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); + + /** + * 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 response. + */ + Response deleteWithResponse( + String resourceGroupName, String accountName, String containerName, 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); + + /** + * 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. + */ + Response setLegalHoldWithResponse( + 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); + + /** + * 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. + */ + Response clearLegalHoldWithResponse( + String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold, 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); + + /** + * 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @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); + + /** + * 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @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); + + /** + * 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @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); + + /** + * 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @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); + + /** + * 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); + + /** + * 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. + */ + Response leaseWithResponse( + String resourceGroupName, + String accountName, + String containerName, + LeaseContainerRequest parameters, + 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. + */ + 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. + */ + 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. + */ + 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @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 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. A value of "*" can be used + * to apply the operation only if the immutability policy already exists. If omitted, this operation will always + * be applied. + * @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..83493823604c6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The BlobContainersCreateOrUpdateImmutabilityPolicyHeaders model. */ +@Fluent +public final class BlobContainersCreateOrUpdateImmutabilityPolicyHeaders { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String 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..ca8da73ba0f86 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersCreateOrUpdateImmutabilityPolicyResponse.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.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); + } + + /** @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..d5841a41f218e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersDeleteImmutabilityPolicyHeaders.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The BlobContainersDeleteImmutabilityPolicyHeaders model. */ +@Fluent +public final class BlobContainersDeleteImmutabilityPolicyHeaders { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(BlobContainersDeleteImmutabilityPolicyHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String 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..1f98812e5af82 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersDeleteImmutabilityPolicyResponse.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.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); + } + + /** @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..c0c8457df8ecb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersExtendImmutabilityPolicyHeaders.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The BlobContainersExtendImmutabilityPolicyHeaders model. */ +@Fluent +public final class BlobContainersExtendImmutabilityPolicyHeaders { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(BlobContainersExtendImmutabilityPolicyHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String 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..6b61757874a9a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersExtendImmutabilityPolicyResponse.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.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); + } + + /** @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..fb49802fd87da --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersGetImmutabilityPolicyHeaders.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The BlobContainersGetImmutabilityPolicyHeaders model. */ +@Fluent +public final class BlobContainersGetImmutabilityPolicyHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobContainersGetImmutabilityPolicyHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String 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..abc1ada1b0552 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersGetImmutabilityPolicyResponse.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.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); + } + + /** @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..2c2cb4b6f43af --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersLockImmutabilityPolicyHeaders.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The BlobContainersLockImmutabilityPolicyHeaders model. */ +@Fluent +public final class BlobContainersLockImmutabilityPolicyHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobContainersLockImmutabilityPolicyHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String 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..503f1f0f144a1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobContainersLockImmutabilityPolicyResponse.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.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); + } + + /** @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/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..5374f262e1a67 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicies.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.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'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. + */ + Response getWithResponse( + 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); + + /** + * 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 response. + */ + Response deleteWithResponse( + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + 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. + */ + 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. + */ + 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. + */ + 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 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..300221ee7524a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicy.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.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 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..3d4fc846b4731 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyDefinition.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An object that defines the blob inventory rule. */ +@Fluent +public final class BlobInventoryPolicyDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobInventoryPolicyDefinition.class); + + /* + * An object that defines the filter set. + */ + @JsonProperty(value = "filters") + private BlobInventoryPolicyFilter filters; + + /* + * This is a required field, it specifies the format for the inventory + * files. + */ + @JsonProperty(value = "format", required = true) + private Format format; + + /* + * This is a required field. This field is used to schedule an inventory + * formation. + */ + @JsonProperty(value = "schedule", required = true) + private Schedule schedule; + + /* + * This is a required field. This field specifies the scope of the + * inventory created either at the blob or container level. + */ + @JsonProperty(value = "objectType", required = true) + 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, Expiry-Time, hdi_isfolder, Owner, Group, + * Permissions, Acl, Snapshot, VersionId, IsCurrentVersion, Metadata, + * LastAccessTime'. The valid values for 'Container' definition.objectType + * include 'Name, Last-Modified, Metadata, LeaseStatus, LeaseState, + * LeaseDuration, PublicAccess, HasImmutabilityPolicy, HasLegalHold'. + * Schema field values 'Expiry-Time, hdi_isfolder, Owner, Group, + * Permissions, Acl' are valid only for Hns enabled accounts. + */ + @JsonProperty(value = "schemaFields", required = true) + private List schemaFields; + + /** + * 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, Expiry-Time, hdi_isfolder, Owner, Group, Permissions, + * Acl, Snapshot, VersionId, IsCurrentVersion, Metadata, LastAccessTime'. The valid values for 'Container' + * definition.objectType include 'Name, Last-Modified, Metadata, LeaseStatus, LeaseState, LeaseDuration, + * PublicAccess, HasImmutabilityPolicy, HasLegalHold'. Schema field values 'Expiry-Time, hdi_isfolder, Owner, Group, + * Permissions, Acl' are valid only for Hns enabled 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, Expiry-Time, hdi_isfolder, Owner, Group, Permissions, + * Acl, Snapshot, VersionId, IsCurrentVersion, Metadata, LastAccessTime'. The valid values for 'Container' + * definition.objectType include 'Name, Last-Modified, Metadata, LeaseStatus, LeaseState, LeaseDuration, + * PublicAccess, HasImmutabilityPolicy, HasLegalHold'. Schema field values 'Expiry-Time, hdi_isfolder, Owner, Group, + * Permissions, Acl' are valid only for Hns enabled 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property format in model BlobInventoryPolicyDefinition")); + } + if (schedule() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property schedule in model BlobInventoryPolicyDefinition")); + } + if (objectType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property objectType in model BlobInventoryPolicyDefinition")); + } + if (schemaFields() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property schemaFields in model BlobInventoryPolicyDefinition")); + } + } +} 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..fe7747293fb8d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyFilter.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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobInventoryPolicyFilter.class); + + /* + * An array of strings for blob prefixes to be matched. + */ + @JsonProperty(value = "prefixMatch") + private List prefixMatch; + + /* + * 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'. + */ + @JsonProperty(value = "blobTypes") + 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. + */ + @JsonProperty(value = "includeBlobVersions") + 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. + */ + @JsonProperty(value = "includeSnapshots") + private Boolean includeSnapshots; + + /** + * Get the prefixMatch property: An array of strings for blob prefixes to be matched. + * + * @return the prefixMatch value. + */ + public List prefixMatch() { + return this.prefixMatch; + } + + /** + * Set the prefixMatch property: An array of strings for blob prefixes to be matched. + * + * @param prefixMatch the prefixMatch value to set. + * @return the BlobInventoryPolicyFilter object itself. + */ + public BlobInventoryPolicyFilter withPrefixMatch(List prefixMatch) { + this.prefixMatch = prefixMatch; + 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; + } + + /** + * 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/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..d7e43b8d53238 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyName.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 com.fasterxml.jackson.annotation.JsonCreator; +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 or finds a BlobInventoryPolicyName from its string representation. + * + * @param name a name to look for. + * @return the corresponding BlobInventoryPolicyName. + */ + @JsonCreator + public static BlobInventoryPolicyName fromString(String name) { + return fromString(name, BlobInventoryPolicyName.class); + } + + /** @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..c993b0280174e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicyRule.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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An object that wraps the blob inventory rule. Each rule is uniquely defined by name. */ +@Fluent +public final class BlobInventoryPolicyRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobInventoryPolicyRule.class); + + /* + * Rule is enabled when set to true. + */ + @JsonProperty(value = "enabled", required = 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. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Container name where blob inventory files are stored. Must be + * pre-created. + */ + @JsonProperty(value = "destination", required = true) + private String destination; + + /* + * An object that defines the blob inventory policy rule. + */ + @JsonProperty(value = "definition", required = true) + private BlobInventoryPolicyDefinition definition; + + /** + * 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model BlobInventoryPolicyRule")); + } + if (destination() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destination in model BlobInventoryPolicyRule")); + } + if (definition() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property definition in model BlobInventoryPolicyRule")); + } else { + definition().validate(); + } + } +} 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..2b8a0059d3028 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobInventoryPolicySchema.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The storage account blob inventory policy rules. */ +@Fluent +public final class BlobInventoryPolicySchema { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobInventoryPolicySchema.class); + + /* + * Policy is enabled if set to true. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * The valid value is Inventory + */ + @JsonProperty(value = "type", required = true) + private InventoryRuleType type; + + /* + * The storage account blob inventory policy rules. The rule is applied + * when it is enabled. + */ + @JsonProperty(value = "rules", required = true) + private List rules; + + /** + * 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 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model BlobInventoryPolicySchema")); + } + if (rules() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property rules in model BlobInventoryPolicySchema")); + } else { + rules().forEach(e -> e.validate()); + } + } +} 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..3ddaccb648bcc --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreParameters.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Blob restore parameters. */ +@Fluent +public final class BlobRestoreParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobRestoreParameters.class); + + /* + * Restore blob to the specified time. + */ + @JsonProperty(value = "timeToRestore", required = true) + private OffsetDateTime timeToRestore; + + /* + * Blob ranges to restore. + */ + @JsonProperty(value = "blobRanges", required = true) + private List blobRanges; + + /** + * 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property timeToRestore in model BlobRestoreParameters")); + } + if (blobRanges() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property blobRanges in model BlobRestoreParameters")); + } else { + blobRanges().forEach(e -> e.validate()); + } + } +} 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..c2d689586f477 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreProgressStatus.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BlobRestoreProgressStatus. */ +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 or finds a BlobRestoreProgressStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding BlobRestoreProgressStatus. + */ + @JsonCreator + public static BlobRestoreProgressStatus fromString(String name) { + return fromString(name, BlobRestoreProgressStatus.class); + } + + /** @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..87f98f2529d56 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreRange.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; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Blob range. */ +@Fluent +public final class BlobRestoreRange { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobRestoreRange.class); + + /* + * Blob start range. This is inclusive. Empty means account start. + */ + @JsonProperty(value = "startRange", required = true) + private String startRange; + + /* + * Blob end range. This is exclusive. Empty means account end. + */ + @JsonProperty(value = "endRange", required = true) + private String endRange; + + /** + * 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property startRange in model BlobRestoreRange")); + } + if (endRange() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property endRange in model BlobRestoreRange")); + } + } +} 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..5b0a72a7915dd --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobRestoreStatus.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.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..3e75e909af810 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobServiceItems.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobServicePropertiesInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The BlobServiceItems model. */ +@Immutable +public final class BlobServiceItems { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobServiceItems.class); + + /* + * List of blob services returned. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * 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()); + } + } +} 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..6583fc82d6b78 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobServiceProperties.java @@ -0,0 +1,421 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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..90cd84d2e00ad --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/BlobServices.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 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 response. + */ + 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 response. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the 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. + */ + 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 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. + */ + 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. + */ + 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/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..188fbe2651c6c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Bypass.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Bypass. */ +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 or finds a Bypass from its string representation. + * + * @param name a name to look for. + * @return the corresponding Bypass. + */ + @JsonCreator + public static Bypass fromString(String name) { + return fromString(name, Bypass.class); + } + + /** @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..7906ac51c768b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ChangeFeed.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The blob service properties for change feed events. */ +@Fluent +public final class ChangeFeed { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ChangeFeed.class); + + /* + * Indicates whether change feed event logging is enabled for the Blob + * service. + */ + @JsonProperty(value = "enabled") + 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. + */ + @JsonProperty(value = "retentionInDays") + private Integer retentionInDays; + + /** + * 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() { + } +} 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..9f009f279f86f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CheckNameAvailabilityResult.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.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..b2f23729d97e0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CorsRule.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.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifies a CORS rule for the Blob service. */ +@Fluent +public final class CorsRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CorsRule.class); + + /* + * Required if CorsRule element is present. A list of origin domains that + * will be allowed via CORS, or "*" to allow all domains + */ + @JsonProperty(value = "allowedOrigins", required = true) + private List allowedOrigins; + + /* + * Required if CorsRule element is present. A list of HTTP methods that are + * allowed to be executed by the origin. + */ + @JsonProperty(value = "allowedMethods", required = true) + private List allowedMethods; + + /* + * Required if CorsRule element is present. The number of seconds that the + * client/browser should cache a preflight response. + */ + @JsonProperty(value = "maxAgeInSeconds", required = true) + private int maxAgeInSeconds; + + /* + * Required if CorsRule element is present. A list of response headers to + * expose to CORS clients. + */ + @JsonProperty(value = "exposedHeaders", required = true) + private List exposedHeaders; + + /* + * Required if CorsRule element is present. A list of headers allowed to be + * part of the cross-origin request. + */ + @JsonProperty(value = "allowedHeaders", required = true) + private List allowedHeaders; + + /** + * 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property allowedOrigins in model CorsRule")); + } + if (allowedMethods() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property allowedMethods in model CorsRule")); + } + if (exposedHeaders() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property exposedHeaders in model CorsRule")); + } + if (allowedHeaders() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property allowedHeaders in model CorsRule")); + } + } +} diff --git a/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CorsRuleAllowedMethodsItem.java b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CorsRuleAllowedMethodsItem.java new file mode 100644 index 0000000000000..4e306739ffaab --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CorsRuleAllowedMethodsItem.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CorsRuleAllowedMethodsItem. */ +public final class CorsRuleAllowedMethodsItem extends ExpandableStringEnum { + /** Static value DELETE for CorsRuleAllowedMethodsItem. */ + public static final CorsRuleAllowedMethodsItem DELETE = fromString("DELETE"); + + /** Static value GET for CorsRuleAllowedMethodsItem. */ + public static final CorsRuleAllowedMethodsItem GET = fromString("GET"); + + /** Static value HEAD for CorsRuleAllowedMethodsItem. */ + public static final CorsRuleAllowedMethodsItem HEAD = fromString("HEAD"); + + /** Static value MERGE for CorsRuleAllowedMethodsItem. */ + public static final CorsRuleAllowedMethodsItem MERGE = fromString("MERGE"); + + /** Static value POST for CorsRuleAllowedMethodsItem. */ + public static final CorsRuleAllowedMethodsItem POST = fromString("POST"); + + /** Static value OPTIONS for CorsRuleAllowedMethodsItem. */ + public static final CorsRuleAllowedMethodsItem OPTIONS = fromString("OPTIONS"); + + /** Static value PUT for CorsRuleAllowedMethodsItem. */ + public static final CorsRuleAllowedMethodsItem PUT = fromString("PUT"); + + /** + * Creates or finds a CorsRuleAllowedMethodsItem from its string representation. + * + * @param name a name to look for. + * @return the corresponding CorsRuleAllowedMethodsItem. + */ + @JsonCreator + public static CorsRuleAllowedMethodsItem fromString(String name) { + return fromString(name, CorsRuleAllowedMethodsItem.class); + } + + /** @return known CorsRuleAllowedMethodsItem values. */ + public static Collection values() { + return values(CorsRuleAllowedMethodsItem.class); + } +} 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..7ff2165fbfe13 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CorsRules.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Sets the CORS rules. You can include up to five CorsRule elements in the request. */ +@Fluent +public final class CorsRules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CorsRules.class); + + /* + * The List of CORS rules. You can include up to five CorsRule elements in + * the request. + */ + @JsonProperty(value = "corsRules") + private List 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()); + } + } +} 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..88568c14c6884 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/CustomDomain.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The custom domain assigned to this storage account. This can be set via Update. */ +@Fluent +public final class CustomDomain { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomDomain.class); + + /* + * Gets or sets the custom domain name assigned to the storage account. + * Name is the CNAME source. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Indicates whether indirect CName validation is enabled. Default value is + * false. This should only be set on updates. + */ + @JsonProperty(value = "useSubDomainName") + private Boolean useSubDomainName; + + /** + * 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model CustomDomain")); + } + } +} 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..c2c011de3abf2 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DateAfterCreation.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Object to define the number of days after creation. */ +@Fluent +public final class DateAfterCreation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DateAfterCreation.class); + + /* + * Value indicating the age in days after creation + */ + @JsonProperty(value = "daysAfterCreationGreaterThan", required = true) + private float daysAfterCreationGreaterThan; + + /** + * 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; + } + + /** + * 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/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..a9bde83a20ec1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DateAfterModification.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Object to define the number of days after object last modification Or last access. Properties + * daysAfterModificationGreaterThan and daysAfterLastAccessTimeGreaterThan are mutually exclusive. + */ +@Fluent +public final class DateAfterModification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DateAfterModification.class); + + /* + * Value indicating the age in days after last modification + */ + @JsonProperty(value = "daysAfterModificationGreaterThan") + 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 + */ + @JsonProperty(value = "daysAfterLastAccessTimeGreaterThan") + private Float daysAfterLastAccessTimeGreaterThan; + + /** + * 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; + } + + /** + * 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/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..a811312365b05 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DefaultAction.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for DefaultAction. */ +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. + */ + @JsonCreator + public static DefaultAction fromString(String value) { + DefaultAction[] items = DefaultAction.values(); + for (DefaultAction item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @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..d2dba4e90c678 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DefaultSharePermission.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DefaultSharePermission. */ +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"); + + /** Static value StorageFileDataSmbShareOwner for DefaultSharePermission. */ + public static final DefaultSharePermission STORAGE_FILE_DATA_SMB_SHARE_OWNER = + fromString("StorageFileDataSmbShareOwner"); + + /** + * Creates or finds a DefaultSharePermission from its string representation. + * + * @param name a name to look for. + * @return the corresponding DefaultSharePermission. + */ + @JsonCreator + public static DefaultSharePermission fromString(String name) { + return fromString(name, DefaultSharePermission.class); + } + + /** @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..70e04c29a41c7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeleteRetentionPolicy.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The service properties for soft delete. */ +@Fluent +public final class DeleteRetentionPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeleteRetentionPolicy.class); + + /* + * Indicates whether DeleteRetentionPolicy is enabled. + */ + @JsonProperty(value = "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. + */ + @JsonProperty(value = "days") + private Integer days; + + /** + * 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; + } + + /** + * 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/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..6e614aa9cd110 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedAccount.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights 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..43f80993282e4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedAccountListResult.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.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.models.DeletedAccountInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List Deleted Accounts operation. */ +@Immutable +public final class DeletedAccountListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeletedAccountListResult.class); + + /* + * Gets the list of deleted accounts and their properties. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * 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()); + } + } +} 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..b91a6479502de --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedAccounts.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.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. + */ + 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. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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. + */ + Response getWithResponse(String deletedAccountName, String location, Context context); +} 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..91dff636588c3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DeletedShare.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The deleted share to be restored. */ +@Fluent +public final class DeletedShare { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeletedShare.class); + + /* + * Required. Identify the name of the deleted share that will be restored. + */ + @JsonProperty(value = "deletedShareName", required = true) + private String deletedShareName; + + /* + * Required. Identify the version of the deleted share that will be + * restored. + */ + @JsonProperty(value = "deletedShareVersion", required = true) + private String deletedShareVersion; + + /** + * 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property deletedShareName in model DeletedShare")); + } + if (deletedShareVersion() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property deletedShareVersion in model DeletedShare")); + } + } +} 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..0a39b02a16846 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Dimension.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.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Dimension of blobs, possibly be blob type or access tier. */ +@Fluent +public final class Dimension { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Dimension.class); + + /* + * Display name of dimension. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Display name of dimension. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * 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() { + } +} 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..cb53f55cbe7f3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/DirectoryServiceOptions.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DirectoryServiceOptions. */ +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"); + + /** + * Creates or finds a DirectoryServiceOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding DirectoryServiceOptions. + */ + @JsonCreator + public static DirectoryServiceOptions fromString(String name) { + return fromString(name, DirectoryServiceOptions.class); + } + + /** @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/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..d4adf532b4eaa --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EnabledProtocols.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EnabledProtocols. */ +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 or finds a EnabledProtocols from its string representation. + * + * @param name a name to look for. + * @return the corresponding EnabledProtocols. + */ + @JsonCreator + public static EnabledProtocols fromString(String name) { + return fromString(name, EnabledProtocols.class); + } + + /** @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..542dc44e2d3e6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Encryption.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The encryption settings on the storage account. */ +@Fluent +public final class Encryption { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Encryption.class); + + /* + * List of services which support encryption. + */ + @JsonProperty(value = "services") + private EncryptionServices services; + + /* + * The encryption keySource (provider). Possible values (case-insensitive): + * Microsoft.Storage, Microsoft.Keyvault + */ + @JsonProperty(value = "keySource", required = true) + 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. + */ + @JsonProperty(value = "requireInfrastructureEncryption") + private Boolean requireInfrastructureEncryption; + + /* + * Properties provided by key vault. + */ + @JsonProperty(value = "keyvaultproperties") + private KeyVaultProperties keyVaultProperties; + + /* + * The identity to be used with service-side encryption at rest. + */ + @JsonProperty(value = "identity") + private EncryptionIdentity encryptionIdentity; + + /** + * 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 (keySource() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property keySource in model Encryption")); + } + if (keyVaultProperties() != null) { + keyVaultProperties().validate(); + } + if (encryptionIdentity() != null) { + encryptionIdentity().validate(); + } + } +} 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..b769837881e96 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionIdentity.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Encryption identity for the storage account. */ +@Fluent +public class EncryptionIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionIdentity.class); + + /* + * Resource identifier of the UserAssigned identity to be associated with + * server-side encryption on the storage account. + */ + @JsonProperty(value = "userAssignedIdentity") + private String encryptionUserAssignedIdentity; + + /** + * 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; + } + + /** + * 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/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..af4e9049811cb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScope.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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..b7866c6b47d16 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeKeyVaultProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionScopeKeyVaultProperties.class); + + /* + * 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. + */ + @JsonProperty(value = "keyUri") + private String keyUri; + + /* + * The object identifier of the current versioned Key Vault Key in use. + */ + @JsonProperty(value = "currentVersionedKeyIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String currentVersionedKeyIdentifier; + + /* + * Timestamp of last rotation of the Key Vault Key. + */ + @JsonProperty(value = "lastKeyRotationTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastKeyRotationTimestamp; + + /** + * 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() { + } +} 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..bc58909febf08 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeListResult.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.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.models.EncryptionScopeInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionScopeListResult.class); + + /* + * List of encryption scopes requested. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * 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()); + } + } +} 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..2992a7ea4fbde --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeSource.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EncryptionScopeSource. */ +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 or finds a EncryptionScopeSource from its string representation. + * + * @param name a name to look for. + * @return the corresponding EncryptionScopeSource. + */ + @JsonCreator + public static EncryptionScopeSource fromString(String name) { + return fromString(name, EncryptionScopeSource.class); + } + + /** @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..c1cbcf9ee7719 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopeState.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EncryptionScopeState. */ +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 or finds a EncryptionScopeState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EncryptionScopeState. + */ + @JsonCreator + public static EncryptionScopeState fromString(String name) { + return fromString(name, EncryptionScopeState.class); + } + + /** @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..ad68db3d80afd --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionScopes.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.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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String encryptionScopeName, Context 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 com.azure.core.management.exception.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. + */ + 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 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. + */ + PagedIterable list(String resourceGroupName, String accountName, 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. + */ + 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. + */ + 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..dc1203a8edaf5 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionService.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** A service that allows server-side encryption to be used. */ +@Fluent +public final class EncryptionService { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionService.class); + + /* + * A boolean indicating whether or not the service encrypts the data as it + * is stored. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * Gets a rough estimate of the date/time when the encryption was last + * enabled by the user. Only returned when encryption is enabled. There + * might be some unencrypted blobs which were written after this time, as + * it is just a rough estimate. + */ + @JsonProperty(value = "lastEnabledTime", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "keyType") + private KeyType keyType; + + /** + * Get the enabled property: A boolean indicating whether or not the service encrypts the data as it is stored. + * + * @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. + * + * @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. Only returned when encryption is enabled. There might be some unencrypted blobs which were written + * after this time, as it is just a rough estimate. + * + * @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() { + } +} 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..b1ee87d06dbb1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/EncryptionServices.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A list of services that support encryption. */ +@Fluent +public final class EncryptionServices { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionServices.class); + + /* + * The encryption function of the blob storage service. + */ + @JsonProperty(value = "blob") + private EncryptionService blob; + + /* + * The encryption function of the file storage service. + */ + @JsonProperty(value = "file") + private EncryptionService file; + + /* + * The encryption function of the table storage service. + */ + @JsonProperty(value = "table") + private EncryptionService table; + + /* + * The encryption function of the queue storage service. + */ + @JsonProperty(value = "queue") + private EncryptionService queue; + + /** + * 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(); + } + } +} 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..7192f512192d4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Endpoints.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object. */ +@Fluent +public final class Endpoints { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Endpoints.class); + + /* + * Gets the blob endpoint. + */ + @JsonProperty(value = "blob", access = JsonProperty.Access.WRITE_ONLY) + private String blob; + + /* + * Gets the queue endpoint. + */ + @JsonProperty(value = "queue", access = JsonProperty.Access.WRITE_ONLY) + private String queue; + + /* + * Gets the table endpoint. + */ + @JsonProperty(value = "table", access = JsonProperty.Access.WRITE_ONLY) + private String table; + + /* + * Gets the file endpoint. + */ + @JsonProperty(value = "file", access = JsonProperty.Access.WRITE_ONLY) + private String file; + + /* + * Gets the web endpoint. + */ + @JsonProperty(value = "web", access = JsonProperty.Access.WRITE_ONLY) + private String web; + + /* + * Gets the dfs endpoint. + */ + @JsonProperty(value = "dfs", access = JsonProperty.Access.WRITE_ONLY) + private String dfs; + + /* + * Gets the microsoft routing storage endpoints. + */ + @JsonProperty(value = "microsoftEndpoints") + private StorageAccountMicrosoftEndpoints microsoftEndpoints; + + /* + * Gets the internet routing storage endpoints + */ + @JsonProperty(value = "internetEndpoints") + private StorageAccountInternetEndpoints internetEndpoints; + + /** + * 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(); + } + } +} 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..dfd1a326cdb24 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExpirationAction.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpirationAction. */ +public final class ExpirationAction extends ExpandableStringEnum { + /** Static value Log for ExpirationAction. */ + public static final ExpirationAction LOG = fromString("Log"); + + /** + * Creates or finds a ExpirationAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpirationAction. + */ + @JsonCreator + public static ExpirationAction fromString(String name) { + return fromString(name, ExpirationAction.class); + } + + /** @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..1dd788a72aadf --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExtendedLocation.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.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The complex type of the extended location. */ +@Fluent +public final class ExtendedLocation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtendedLocation.class); + + /* + * The name of the extended location. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The type of the extended location. + */ + @JsonProperty(value = "type") + private ExtendedLocationTypes type; + + /** + * 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() { + } +} 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..e8c500ded0afe --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ExtendedLocationTypes.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExtendedLocationTypes. */ +public final class ExtendedLocationTypes extends ExpandableStringEnum { + /** Static value EdgeZone for ExtendedLocationTypes. */ + public static final ExtendedLocationTypes EDGE_ZONE = fromString("EdgeZone"); + + /** + * Creates or finds a ExtendedLocationTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExtendedLocationTypes. + */ + @JsonCreator + public static ExtendedLocationTypes fromString(String name) { + return fromString(name, ExtendedLocationTypes.class); + } + + /** @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/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..f49e2c81c4eaf --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServiceItems.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.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..316efcab4243c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServiceProperties.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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/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..4ac931d05851a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileServices.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.models; + +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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. + */ + Response listWithResponse(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 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. + */ + 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 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. + */ + 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. + */ + 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..24f1c1d5e3c2c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShare.java @@ -0,0 +1,470 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 maximum size of the share, in gigabytes. Must be greater than 0, and less than + * or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. + * + * @return the shareQuota value. + */ + Integer shareQuota(); + + /** + * 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 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.WithEnabledProtocols, + DefinitionStages.WithRootSquash, + DefinitionStages.WithAccessTier, + DefinitionStages.WithSignedIdentifiers, + 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 maximum size of the share, in gigabytes. Must be greater than 0, + * and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400.. + * + * @param shareQuota The maximum size of the share, in gigabytes. Must be greater than 0, and less than or + * equal to 5TB (5120). For Large File Shares, the maximum size is 102400. + * @return the next definition stage. + */ + WithCreate withShareQuota(Integer shareQuota); + } + /** 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 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.WithEnabledProtocols, + UpdateStages.WithRootSquash, + UpdateStages.WithAccessTier, + UpdateStages.WithSignedIdentifiers { + /** + * 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 maximum size of the share, in gigabytes. Must be greater than 0, + * and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400.. + * + * @param shareQuota The maximum size of the share, in gigabytes. Must be greater than 0, and less than or + * equal to 5TB (5120). For Large File Shares, the maximum size is 102400. + * @return the next definition stage. + */ + Update withShareQuota(Integer shareQuota); + } + /** The stage of the FileShare update 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. + */ + Update withEnabledProtocols(EnabledProtocols enabledProtocols); + } + /** 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); + } + } + /** + * 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 deleted share to be restored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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); + + /** + * Restore a file share within a valid retention days if share soft delete is enabled. + * + * @param deletedShare The deleted share to be restored. + * @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. + */ + Response restoreWithResponse(DeletedShare deletedShare, 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(); + + /** + * 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); +} 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..f88b7e349eb59 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShareItem.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.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 maximum size of the share, in gigabytes. Must be greater than 0, and less than + * or equal to 5TB (5120). For Large File Shares, the maximum size is 102400. + * + * @return the shareQuota value. + */ + Integer shareQuota(); + + /** + * 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 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..d01a5f8d07e8b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShareItems.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.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.models.FileShareItemInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FileShareItems.class); + + /* + * List of file shares returned. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * 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()); + } + } +} 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..5ae8d9ea744cd --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileShares.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.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. + */ + 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. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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. + */ + Response getWithResponse( + String resourceGroupName, + String accountName, + String shareName, + String expand, + String xMsSnapshot, + 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); + + /** + * 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 response. + */ + Response deleteWithResponse( + String resourceGroupName, + String accountName, + String shareName, + String xMsSnapshot, + String include, + 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 deleted share to be restored. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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); + + /** + * 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 deleted share to be restored. + * @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. + */ + Response restoreWithResponse( + String resourceGroupName, String accountName, String shareName, DeletedShare deletedShare, 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); + + /** + * 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); + + /** + * 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. + */ + 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. + */ + 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 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..cf699195fffb0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileSharesLeaseHeaders.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The FileSharesLeaseHeaders model. */ +@Fluent +public final class FileSharesLeaseHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FileSharesLeaseHeaders.class); + + /* + * The Etag property. + */ + @JsonProperty(value = "Etag") + private String 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..ca046b072aaba --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/FileSharesLeaseResponse.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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); + } + + /** @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..3941c74b16ec1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Format.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Format. */ +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 or finds a Format from its string representation. + * + * @param name a name to look for. + * @return the corresponding Format. + */ + @JsonCreator + public static Format fromString(String name) { + return fromString(name, Format.class); + } + + /** @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..0332b821c2dba --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/GeoReplicationStats.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GeoReplicationStats.class); + + /* + * 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. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "lastSyncTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastSyncTime; + + /* + * A boolean flag which indicates whether or not account failover is + * supported for the account. + */ + @JsonProperty(value = "canFailover", access = JsonProperty.Access.WRITE_ONLY) + private Boolean canFailover; + + /** + * 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; + } + + /** + * 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/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..79f18a65d06e0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/GeoReplicationStatus.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for GeoReplicationStatus. */ +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 or finds a GeoReplicationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding GeoReplicationStatus. + */ + @JsonCreator + public static GeoReplicationStatus fromString(String name) { + return fromString(name, GeoReplicationStatus.class); + } + + /** @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..9a7b81de83314 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/HttpProtocol.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for HttpProtocol. */ +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. + */ + @JsonCreator + public static HttpProtocol fromString(String value) { + HttpProtocol[] items = HttpProtocol.values(); + for (HttpProtocol item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @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..8994858c3ffda --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Identity.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.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Identity for the resource. */ +@Fluent +public class Identity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Identity.class); + + /* + * The principal ID of resource identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The tenant ID of resource. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * The identity type. + */ + @JsonProperty(value = "type", required = true) + 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. + */ + @JsonProperty(value = "userAssignedIdentities") + private Map userAssignedIdentities; + + /** + * 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 + .logExceptionAsError(new IllegalArgumentException("Missing required property type in model Identity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} 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..e9363182e256d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/IdentityType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IdentityType. */ +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 or finds a IdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IdentityType. + */ + @JsonCreator + public static IdentityType fromString(String name) { + return fromString(name, IdentityType.class); + } + + /** @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..749b8eae02d31 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicy.java @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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.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 ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: The entity state (ETag) version of the immutability policy to update. A + * value of "*" can be used to apply the operation only if the immutability policy already exists. If + * omitted, this operation will always be applied.. + * + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can + * be used to apply the operation only if the immutability policy already exists. If omitted, this + * operation will always be applied. + * @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.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 ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: The entity state (ETag) version of the immutability policy to update. A + * value of "*" can be used to apply the operation only if the immutability policy already exists. If + * omitted, this operation will always be applied.. + * + * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can + * be used to apply the operation only if the immutability policy already exists. If omitted, this + * operation will always be applied. + * @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..3862a6dccddcc --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicyProperties.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.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of an ImmutabilityPolicy of a blob container. */ +@JsonFlatten +@Fluent +public class ImmutabilityPolicyProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImmutabilityPolicyProperties.class); + + /* + * ImmutabilityPolicy Etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The ImmutabilityPolicy update history of the blob container. + */ + @JsonProperty(value = "updateHistory", access = JsonProperty.Access.WRITE_ONLY) + private List updateHistory; + + /* + * The immutability period for the blobs in the container since the policy + * creation, in days. + */ + @JsonProperty(value = "properties.immutabilityPeriodSinceCreationInDays") + private Integer immutabilityPeriodSinceCreationInDays; + + /* + * The ImmutabilityPolicy state of a blob container, possible values + * include: Locked and Unlocked. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + 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 + */ + @JsonProperty(value = "properties.allowProtectedAppendWrites") + private Boolean allowProtectedAppendWrites; + + /** + * 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.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) { + 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 ImmutabilityPolicyProperties object itself. + */ + public ImmutabilityPolicyProperties withAllowProtectedAppendWrites(Boolean allowProtectedAppendWrites) { + this.allowProtectedAppendWrites = allowProtectedAppendWrites; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (updateHistory() != null) { + updateHistory().forEach(e -> e.validate()); + } + } +} 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..47f7821b8989c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicyState.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ImmutabilityPolicyState. */ +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 or finds a ImmutabilityPolicyState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImmutabilityPolicyState. + */ + @JsonCreator + public static ImmutabilityPolicyState fromString(String name) { + return fromString(name, ImmutabilityPolicyState.class); + } + + /** @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..110af3d0e0ca9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutabilityPolicyUpdateType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ImmutabilityPolicyUpdateType. */ +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 or finds a ImmutabilityPolicyUpdateType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImmutabilityPolicyUpdateType. + */ + @JsonCreator + public static ImmutabilityPolicyUpdateType fromString(String name) { + return fromString(name, ImmutabilityPolicyUpdateType.class); + } + + /** @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/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..e3689c2230bab --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ImmutableStorageWithVersioning.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; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Object level immutability properties of the container. */ +@Fluent +public final class ImmutableStorageWithVersioning { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImmutableStorageWithVersioning.class); + + /* + * This is an immutable property, when set to true it enables object level + * immutability at the container level. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * Returns the date and time the object level immutability was enabled. + */ + @JsonProperty(value = "timeStamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timestamp; + + /* + * This property denotes the container level immutability to object level + * immutability migration state. + */ + @JsonProperty(value = "migrationState", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState migrationState; + + /** + * 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() { + } +} 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..93019454e6808 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/InventoryRuleType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for InventoryRuleType. */ +public final class InventoryRuleType extends ExpandableStringEnum { + /** Static value Inventory for InventoryRuleType. */ + public static final InventoryRuleType INVENTORY = fromString("Inventory"); + + /** + * Creates or finds a InventoryRuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding InventoryRuleType. + */ + @JsonCreator + public static InventoryRuleType fromString(String name) { + return fromString(name, InventoryRuleType.class); + } + + /** @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..b7a1dffd77ea8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/IpRule.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP rule with specific IP or IP range in CIDR format. */ +@Fluent +public final class IpRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpRule.class); + + /* + * Specifies the IP or IP range in CIDR format. Only IPV4 address is + * allowed. + */ + @JsonProperty(value = "value", required = true) + private String ipAddressOrRange; + + /* + * The action of IP ACL rule. + */ + @JsonProperty(value = "action") + private Action action; + + /** + * 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property ipAddressOrRange in model IpRule")); + } + } +} 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..197508b671832 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyCreationTime.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Storage account keys creation time. */ +@Fluent +public final class KeyCreationTime { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyCreationTime.class); + + /* + * The key1 property. + */ + @JsonProperty(value = "key1") + private OffsetDateTime key1; + + /* + * The key2 property. + */ + @JsonProperty(value = "key2") + private OffsetDateTime key2; + + /** + * 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() { + } +} 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..216a539dbf506 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyPermission.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for KeyPermission. */ +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. + */ + @JsonCreator + public static KeyPermission fromString(String value) { + KeyPermission[] items = KeyPermission.values(); + for (KeyPermission item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @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..87ea2744645e4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyPolicy.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** KeyPolicy assigned to the storage account. */ +@Fluent +public final class KeyPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyPolicy.class); + + /* + * The key expiration period in days. + */ + @JsonProperty(value = "keyExpirationPeriodInDays", required = true) + private int keyExpirationPeriodInDays; + + /** + * 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() { + } +} 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..1f380c219fce5 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeySource.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for KeySource. */ +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 or finds a KeySource from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeySource. + */ + @JsonCreator + public static KeySource fromString(String name) { + return fromString(name, KeySource.class); + } + + /** @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..d6ffa03878692 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyType.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for KeyType. */ +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 or finds a KeyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeyType. + */ + @JsonCreator + public static KeyType fromString(String name) { + return fromString(name, KeyType.class); + } + + /** @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..1a662b0685a09 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/KeyVaultProperties.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of key vault. */ +@Fluent +public final class KeyVaultProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultProperties.class); + + /* + * The name of KeyVault key. + */ + @JsonProperty(value = "keyname") + private String keyName; + + /* + * The version of KeyVault key. + */ + @JsonProperty(value = "keyversion") + private String keyVersion; + + /* + * The Uri of KeyVault. + */ + @JsonProperty(value = "keyvaulturi") + private String keyVaultUri; + + /* + * The object identifier of the current versioned Key Vault Key in use. + */ + @JsonProperty(value = "currentVersionedKeyIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String currentVersionedKeyIdentifier; + + /* + * Timestamp of last rotation of the Key Vault Key. + */ + @JsonProperty(value = "lastKeyRotationTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastKeyRotationTimestamp; + + /** + * 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; + } + + /** + * 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/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..ddbb05b00852c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Kind.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Kind. */ +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 or finds a Kind from its string representation. + * + * @param name a name to look for. + * @return the corresponding Kind. + */ + @JsonCreator + public static Kind fromString(String name) { + return fromString(name, Kind.class); + } + + /** @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..3f8b35d69bdd4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LargeFileSharesState.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LargeFileSharesState. */ +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 or finds a LargeFileSharesState from its string representation. + * + * @param name a name to look for. + * @return the corresponding LargeFileSharesState. + */ + @JsonCreator + public static LargeFileSharesState fromString(String name) { + return fromString(name, LargeFileSharesState.class); + } + + /** @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..e113083cdbb96 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LastAccessTimeTrackingPolicy.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The blob service properties for Last access time based tracking policy. */ +@Fluent +public final class LastAccessTimeTrackingPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LastAccessTimeTrackingPolicy.class); + + /* + * When set to true last access time based tracking is enabled. + */ + @JsonProperty(value = "enable", required = true) + private boolean enable; + + /* + * Name of the policy. The valid value is AccessTimeTracking. This field is + * currently read only + */ + @JsonProperty(value = "name") + 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 + */ + @JsonProperty(value = "trackingGranularityInDays") + private Integer trackingGranularityInDays; + + /* + * An array of predefined supported blob types. Only blockBlob is the + * supported value. This field is currently read only + */ + @JsonProperty(value = "blobType") + private List blobType; + + /** + * 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() { + } +} 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..b6cbfa92f6fc5 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseContainerRequest.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Lease Container request schema. */ +@Fluent +public final class LeaseContainerRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LeaseContainerRequest.class); + + /* + * Specifies the lease action. Can be one of the available actions. + */ + @JsonProperty(value = "action", required = true) + private LeaseContainerRequestAction action; + + /* + * Identifies the lease. Can be specified in any valid GUID string format. + */ + @JsonProperty(value = "leaseId") + private String leaseId; + + /* + * Optional. For a break action, proposed duration the lease should + * continue before it is broken, in seconds, between 0 and 60. + */ + @JsonProperty(value = "breakPeriod") + private Integer breakPeriod; + + /* + * Required for acquire. Specifies the duration of the lease, in seconds, + * or negative one (-1) for a lease that never expires. + */ + @JsonProperty(value = "leaseDuration") + private Integer leaseDuration; + + /* + * Optional for acquire, required for change. Proposed lease ID, in a GUID + * string format. + */ + @JsonProperty(value = "proposedLeaseId") + private String proposedLeaseId; + + /** + * 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property action in model LeaseContainerRequest")); + } + } +} 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..3b522d150ec83 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseContainerRequestAction.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LeaseContainerRequestAction. */ +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 or finds a LeaseContainerRequestAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding LeaseContainerRequestAction. + */ + @JsonCreator + public static LeaseContainerRequestAction fromString(String name) { + return fromString(name, LeaseContainerRequestAction.class); + } + + /** @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..197dddc327b73 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseContainerResponse.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.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..ef7e457859b39 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseDuration.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LeaseDuration. */ +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 or finds a LeaseDuration from its string representation. + * + * @param name a name to look for. + * @return the corresponding LeaseDuration. + */ + @JsonCreator + public static LeaseDuration fromString(String name) { + return fromString(name, LeaseDuration.class); + } + + /** @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..0c26ef68ca5e9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseShareAction.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LeaseShareAction. */ +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 or finds a LeaseShareAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding LeaseShareAction. + */ + @JsonCreator + public static LeaseShareAction fromString(String name) { + return fromString(name, LeaseShareAction.class); + } + + /** @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..57868a381f723 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseShareRequest.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Lease Share request schema. */ +@Fluent +public final class LeaseShareRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LeaseShareRequest.class); + + /* + * Specifies the lease action. Can be one of the available actions. + */ + @JsonProperty(value = "action", required = true) + private LeaseShareAction action; + + /* + * Identifies the lease. Can be specified in any valid GUID string format. + */ + @JsonProperty(value = "leaseId") + private String leaseId; + + /* + * Optional. For a break action, proposed duration the lease should + * continue before it is broken, in seconds, between 0 and 60. + */ + @JsonProperty(value = "breakPeriod") + private Integer breakPeriod; + + /* + * Required for acquire. Specifies the duration of the lease, in seconds, + * or negative one (-1) for a lease that never expires. + */ + @JsonProperty(value = "leaseDuration") + private Integer leaseDuration; + + /* + * Optional for acquire, required for change. Proposed lease ID, in a GUID + * string format. + */ + @JsonProperty(value = "proposedLeaseId") + private String proposedLeaseId; + + /** + * 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property action in model LeaseShareRequest")); + } + } +} 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..5c606b97d261b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseShareResponse.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.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..01805acde964b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseState.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LeaseState. */ +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 or finds a LeaseState from its string representation. + * + * @param name a name to look for. + * @return the corresponding LeaseState. + */ + @JsonCreator + public static LeaseState fromString(String name) { + return fromString(name, LeaseState.class); + } + + /** @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..3ffce72b371fb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LeaseStatus.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LeaseStatus. */ +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 or finds a LeaseStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding LeaseStatus. + */ + @JsonCreator + public static LeaseStatus fromString(String name) { + return fromString(name, LeaseStatus.class); + } + + /** @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..2b25ef8bb29ff --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LegalHold.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.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 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..28c03d33f5b64 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/LegalHoldProperties.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The LegalHold property of a blob container. */ +@Fluent +public final class LegalHoldProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LegalHoldProperties.class); + + /* + * 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. + */ + @JsonProperty(value = "hasLegalHold", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasLegalHold; + + /* + * The list of LegalHold tags of a blob container. + */ + @JsonProperty(value = "tags") + private List tags; + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } +} 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..b3f2ecd4de033 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListAccountSasResponse.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.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..183359ccbe3df --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListBlobInventoryPolicy.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.models.BlobInventoryPolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of blob inventory policies returned. */ +@Immutable +public final class ListBlobInventoryPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListBlobInventoryPolicy.class); + + /* + * List of blob inventory policies. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * 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()); + } + } +} 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..a1426a656a105 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListContainerItem.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights 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 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..cc1fdcf3fd1f4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListContainerItems.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.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.models.ListContainerItemInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListContainerItems.class); + + /* + * List of blobs containers returned. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * 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()); + } + } +} 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..5b4e730124375 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListContainersInclude.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 com.fasterxml.jackson.annotation.JsonCreator; +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 or finds a ListContainersInclude from its string representation. + * + * @param name a name to look for. + * @return the corresponding ListContainersInclude. + */ + @JsonCreator + public static ListContainersInclude fromString(String name) { + return fromString(name, ListContainersInclude.class); + } + + /** @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/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..ff3dfc80d5418 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListKeyExpand.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.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** 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. + */ + @JsonCreator + public static ListKeyExpand fromString(String value) { + ListKeyExpand[] items = ListKeyExpand.values(); + for (ListKeyExpand item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @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/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..58e5c518257f7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListQueue.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.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..cca87fd2eb39c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListQueueResource.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.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.models.ListQueueInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response schema. Contains list of queues returned. */ +@Immutable +public final class ListQueueResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListQueueResource.class); + + /* + * List of queues returned. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Request URL that can be used to list next page of queues + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * 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()); + } + } +} 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..b005134f75146 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListQueueServices.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.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..51264cc8b2b58 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListServiceSasResponse.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.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..f5d83773648b6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListTableResource.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.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.models.TableInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response schema. Contains list of tables returned. */ +@Immutable +public final class ListTableResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListTableResource.class); + + /* + * List of tables returned. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Request URL that can be used to query next page of tables + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * 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()); + } + } +} 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..1b6289ba36b0f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ListTableServices.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.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/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..4f7cb64b201dc --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicies.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.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'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. + */ + Response getWithResponse( + 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); + + /** + * 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 response. + */ + Response deleteWithResponse( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, Context context); + + /** + * 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. + */ + 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. + */ + 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 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..daa790667a935 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicy.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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..d7f2e494f0777 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyAction.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Actions are applied to the filtered blobs when the execution condition is met. */ +@Fluent +public final class ManagementPolicyAction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementPolicyAction.class); + + /* + * The management policy action for base blob + */ + @JsonProperty(value = "baseBlob") + private ManagementPolicyBaseBlob baseBlob; + + /* + * The management policy action for snapshot + */ + @JsonProperty(value = "snapshot") + private ManagementPolicySnapShot snapshot; + + /* + * The management policy action for version + */ + @JsonProperty(value = "version") + private ManagementPolicyVersion version; + + /** + * 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(); + } + } +} 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..d7ed65e38203c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyBaseBlob.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Management policy action for base blob. */ +@Fluent +public final class ManagementPolicyBaseBlob { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementPolicyBaseBlob.class); + + /* + * The function to tier blobs to cool storage. Support blobs currently at + * Hot tier + */ + @JsonProperty(value = "tierToCool") + private DateAfterModification tierToCool; + + /* + * The function to tier blobs to archive storage. Support blobs currently + * at Hot or Cool tier + */ + @JsonProperty(value = "tierToArchive") + private DateAfterModification tierToArchive; + + /* + * The function to delete the blob + */ + @JsonProperty(value = "delete") + private DateAfterModification delete; + + /* + * This property enables auto tiering of a blob from cool to hot on a blob + * access. This property requires + * tierToCool.daysAfterLastAccessTimeGreaterThan. + */ + @JsonProperty(value = "enableAutoTierToHotFromCool") + private Boolean enableAutoTierToHotFromCool; + + /** + * Get the tierToCool property: The function to tier blobs to cool storage. Support blobs currently at Hot tier. + * + * @return the tierToCool value. + */ + public DateAfterModification tierToCool() { + return this.tierToCool; + } + + /** + * Set the tierToCool property: The function to tier blobs to cool storage. Support blobs currently at Hot tier. + * + * @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. Support blobs currently at Hot or + * Cool tier. + * + * @return the tierToArchive value. + */ + public DateAfterModification tierToArchive() { + return this.tierToArchive; + } + + /** + * Set the tierToArchive property: The function to tier blobs to archive storage. Support blobs currently at Hot or + * Cool tier. + * + * @param tierToArchive the tierToArchive value to set. + * @return the ManagementPolicyBaseBlob object itself. + */ + public ManagementPolicyBaseBlob withTierToArchive(DateAfterModification tierToArchive) { + this.tierToArchive = tierToArchive; + 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 (delete() != null) { + delete().validate(); + } + } +} 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..c3c5911be2593 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyDefinition.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementPolicyDefinition.class); + + /* + * An object that defines the action set. + */ + @JsonProperty(value = "actions", required = true) + private ManagementPolicyAction actions; + + /* + * An object that defines the filter set. + */ + @JsonProperty(value = "filters") + private ManagementPolicyFilter filters; + + /** + * 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property actions in model ManagementPolicyDefinition")); + } else { + actions().validate(); + } + if (filters() != null) { + filters().validate(); + } + } +} 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..150e751027947 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyFilter.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementPolicyFilter.class); + + /* + * An array of strings for prefixes to be match. + */ + @JsonProperty(value = "prefixMatch") + private List prefixMatch; + + /* + * An array of predefined enum values. Currently blockBlob supports all + * tiering and delete actions. Only delete actions are supported for + * appendBlob. + */ + @JsonProperty(value = "blobTypes", required = true) + private List blobTypes; + + /* + * An array of blob index tag based filters, there can be at most 10 tag + * filters + */ + @JsonProperty(value = "blobIndexMatch") + private List blobIndexMatch; + + /** + * 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property blobTypes in model ManagementPolicyFilter")); + } + if (blobIndexMatch() != null) { + blobIndexMatch().forEach(e -> e.validate()); + } + } +} 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..6dd4fceaa7acf --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyName.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 com.fasterxml.jackson.annotation.JsonCreator; +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 or finds a ManagementPolicyName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagementPolicyName. + */ + @JsonCreator + public static ManagementPolicyName fromString(String name) { + return fromString(name, ManagementPolicyName.class); + } + + /** @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..fc4532c7f185f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyRule.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An object that wraps the Lifecycle rule. Each rule is uniquely defined by name. */ +@Fluent +public final class ManagementPolicyRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementPolicyRule.class); + + /* + * Rule is enabled if set to true. + */ + @JsonProperty(value = "enabled") + 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. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The valid value is Lifecycle + */ + @JsonProperty(value = "type", required = true) + private RuleType type; + + /* + * An object that defines the Lifecycle rule. + */ + @JsonProperty(value = "definition", required = true) + private ManagementPolicyDefinition definition; + + /** + * 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model ManagementPolicyRule")); + } + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model ManagementPolicyRule")); + } + if (definition() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property definition in model ManagementPolicyRule")); + } else { + definition().validate(); + } + } +} 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..92c5a2aa4c175 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicySchema.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementPolicySchema.class); + + /* + * The Storage Account ManagementPolicies Rules. See more details in: + * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + */ + @JsonProperty(value = "rules", required = true) + private List rules; + + /** + * 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property rules in model ManagementPolicySchema")); + } else { + rules().forEach(e -> e.validate()); + } + } +} 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..1558ec8830642 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicySnapShot.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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Management policy action for snapshot. */ +@Fluent +public final class ManagementPolicySnapShot { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementPolicySnapShot.class); + + /* + * The function to tier blob snapshot to cool storage. Support blob + * snapshot currently at Hot tier + */ + @JsonProperty(value = "tierToCool") + private DateAfterCreation tierToCool; + + /* + * The function to tier blob snapshot to archive storage. Support blob + * snapshot currently at Hot or Cool tier + */ + @JsonProperty(value = "tierToArchive") + private DateAfterCreation tierToArchive; + + /* + * The function to delete the blob snapshot + */ + @JsonProperty(value = "delete") + private DateAfterCreation delete; + + /** + * Get the tierToCool property: The function to tier blob snapshot to cool storage. Support blob snapshot currently + * at Hot tier. + * + * @return the tierToCool value. + */ + public DateAfterCreation tierToCool() { + return this.tierToCool; + } + + /** + * Set the tierToCool property: The function to tier blob snapshot to cool storage. Support blob snapshot currently + * at Hot tier. + * + * @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. Support blob snapshot + * currently at Hot or Cool tier. + * + * @return the tierToArchive value. + */ + public DateAfterCreation tierToArchive() { + return this.tierToArchive; + } + + /** + * Set the tierToArchive property: The function to tier blob snapshot to archive storage. Support blob snapshot + * currently at Hot or Cool tier. + * + * @param tierToArchive the tierToArchive value to set. + * @return the ManagementPolicySnapShot object itself. + */ + public ManagementPolicySnapShot withTierToArchive(DateAfterCreation tierToArchive) { + this.tierToArchive = tierToArchive; + 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 (delete() != null) { + delete().validate(); + } + } +} 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..4465551b39556 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ManagementPolicyVersion.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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Management policy action for blob version. */ +@Fluent +public final class ManagementPolicyVersion { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementPolicyVersion.class); + + /* + * The function to tier blob version to cool storage. Support blob version + * currently at Hot tier + */ + @JsonProperty(value = "tierToCool") + private DateAfterCreation tierToCool; + + /* + * The function to tier blob version to archive storage. Support blob + * version currently at Hot or Cool tier + */ + @JsonProperty(value = "tierToArchive") + private DateAfterCreation tierToArchive; + + /* + * The function to delete the blob version + */ + @JsonProperty(value = "delete") + private DateAfterCreation delete; + + /** + * Get the tierToCool property: The function to tier blob version to cool storage. Support blob version currently at + * Hot tier. + * + * @return the tierToCool value. + */ + public DateAfterCreation tierToCool() { + return this.tierToCool; + } + + /** + * Set the tierToCool property: The function to tier blob version to cool storage. Support blob version currently at + * Hot tier. + * + * @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. Support blob version + * currently at Hot or Cool tier. + * + * @return the tierToArchive value. + */ + public DateAfterCreation tierToArchive() { + return this.tierToArchive; + } + + /** + * Set the tierToArchive property: The function to tier blob version to archive storage. Support blob version + * currently at Hot or Cool tier. + * + * @param tierToArchive the tierToArchive value to set. + * @return the ManagementPolicyVersion object itself. + */ + public ManagementPolicyVersion withTierToArchive(DateAfterCreation tierToArchive) { + this.tierToArchive = tierToArchive; + 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 (delete() != null) { + delete().validate(); + } + } +} 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..8c8ce8591814e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MetricSpecification.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Metric specification of operation. */ +@Fluent +public final class MetricSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricSpecification.class); + + /* + * Name of metric specification. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Display name of metric specification. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Display description of metric specification. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /* + * Unit could be Bytes or Count. + */ + @JsonProperty(value = "unit") + private String unit; + + /* + * Dimensions of blobs, including blob type and access tier. + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /* + * Aggregation type could be Average. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /* + * The property to decide fill gap with zero or not. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /* + * The category this metric specification belong to, could be Capacity. + */ + @JsonProperty(value = "category") + private String category; + + /* + * Account Resource Id. + */ + @JsonProperty(value = "resourceIdDimensionNameOverride") + private String resourceIdDimensionNameOverride; + + /** + * Get 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()); + } + } +} 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..5f81e652e7528 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MigrationState.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MigrationState. */ +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 or finds a MigrationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding MigrationState. + */ + @JsonCreator + public static MigrationState fromString(String name) { + return fromString(name, MigrationState.class); + } + + /** @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/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..02db3fc474ba5 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/MinimumTlsVersion.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MinimumTlsVersion. */ +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"); + + /** + * Creates or finds a MinimumTlsVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding MinimumTlsVersion. + */ + @JsonCreator + public static MinimumTlsVersion fromString(String name) { + return fromString(name, MinimumTlsVersion.class); + } + + /** @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..687e55f00292e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Multichannel.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Multichannel setting. Applies to Premium FileStorage only. */ +@Fluent +public final class Multichannel { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Multichannel.class); + + /* + * Indicates whether multichannel is enabled + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * 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() { + } +} 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..7e71692a14108 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Name.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Name. */ +public final class Name extends ExpandableStringEnum { + /** Static value AccessTimeTracking for Name. */ + public static final Name ACCESS_TIME_TRACKING = fromString("AccessTimeTracking"); + + /** + * Creates or finds a Name from its string representation. + * + * @param name a name to look for. + * @return the corresponding Name. + */ + @JsonCreator + public static Name fromString(String name) { + return fromString(name, Name.class); + } + + /** @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..bb04e33f50f4e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/NetworkRuleSet.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network rule set. */ +@Fluent +public final class NetworkRuleSet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkRuleSet.class); + + /* + * 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. + */ + @JsonProperty(value = "bypass") + private Bypass bypass; + + /* + * Sets the resource access rules + */ + @JsonProperty(value = "resourceAccessRules") + private List resourceAccessRules; + + /* + * Sets the virtual network rules + */ + @JsonProperty(value = "virtualNetworkRules") + private List virtualNetworkRules; + + /* + * Sets the IP ACL rules + */ + @JsonProperty(value = "ipRules") + private List ipRules; + + /* + * Specifies the default action of allow or deny when no other rules match. + */ + @JsonProperty(value = "defaultAction", required = true) + private DefaultAction defaultAction; + + /** + * 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property defaultAction in model NetworkRuleSet")); + } + } +} 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..1ccc7a4748ef2 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicies.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.resourcemanager.storage.generated.fluent.models.ObjectReplicationPolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List storage account object replication policies. */ +@Fluent +public final class ObjectReplicationPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ObjectReplicationPolicies.class); + + /* + * The replication policy between two storage accounts. + */ + @JsonProperty(value = "value") + private List value; + + /** + * 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()); + } + } +} 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..1d25e2ddb55f7 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPoliciesOperations.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.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. + */ + 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. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. + */ + Response getWithResponse( + 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); + + /** + * 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 response. + */ + Response deleteWithResponse( + String resourceGroupName, String accountName, String objectReplicationPolicyId, Context context); + + /** + * 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. + */ + 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. + */ + 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 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..d0cffd624608f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicy.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.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 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 { + /** + * 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); + } + } + /** + * 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 { + /** + * 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); + } + } + /** + * 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..73768e670469c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicyFilter.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ObjectReplicationPolicyFilter.class); + + /* + * Optional. Filters the results to replicate only blobs whose names begin + * with the specified prefix. + */ + @JsonProperty(value = "prefixMatch") + 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 + */ + @JsonProperty(value = "minCreationTime") + private String minCreationTime; + + /** + * 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() { + } +} 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..78e7ca583f19c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectReplicationPolicyRule.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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The replication policy rule between two containers. */ +@Fluent +public final class ObjectReplicationPolicyRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ObjectReplicationPolicyRule.class); + + /* + * Rule Id is auto-generated for each new rule on destination account. It + * is required for put policy on source account. + */ + @JsonProperty(value = "ruleId") + private String ruleId; + + /* + * Required. Source container name. + */ + @JsonProperty(value = "sourceContainer", required = true) + private String sourceContainer; + + /* + * Required. Destination container name. + */ + @JsonProperty(value = "destinationContainer", required = true) + private String destinationContainer; + + /* + * Optional. An object that defines the filter set. + */ + @JsonProperty(value = "filters") + private ObjectReplicationPolicyFilter filters; + + /** + * 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceContainer in model ObjectReplicationPolicyRule")); + } + if (destinationContainer() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property destinationContainer in model ObjectReplicationPolicyRule")); + } + if (filters() != null) { + filters().validate(); + } + } +} 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..1169fd277af0e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ObjectType.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ObjectType. */ +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 or finds a ObjectType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ObjectType. + */ + @JsonCreator + public static ObjectType fromString(String name) { + return fromString(name, ObjectType.class); + } + + /** @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..92e73c11e7d00 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Operation.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.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..c1db073b697a3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/OperationDisplay.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.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Display metadata associated with the operation. */ +@Fluent +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * Service provider: Microsoft Storage. + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Resource on which the operation is performed etc. + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * Type of operation: get, read, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * 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() { + } +} 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..6f03efd44d7e6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/OperationListResult.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.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); + + /* + * List of Storage operations supported by the Storage resource provider. + */ + @JsonProperty(value = "value") + private List value; + + /** + * 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()); + } + } +} 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..2baf7023c8aa1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. + */ + 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. + */ + PagedIterable list(Context context); +} 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..7b1b221e0970e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Permissions.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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Permissions. */ +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 or finds a Permissions from its string representation. + * + * @param name a name to look for. + * @return the corresponding Permissions. + */ + @JsonCreator + public static Permissions fromString(String name) { + return fromString(name, Permissions.class); + } + + /** @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/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..3ca2733bd5634 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpoint.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.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Private Endpoint resource. */ +@Immutable +public final class PrivateEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpoint.class); + + /* + * The ARM identifier for Private Endpoint + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * 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() { + } +} 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..57e41836079ba --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnection.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.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 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..5b01fa81531ae --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.resourcemanager.storage.generated.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of private endpoint connection associated with the specified storage account. */ +@Fluent +public final class PrivateEndpointConnectionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionListResult.class); + + /* + * Array of private endpoint connections + */ + @JsonProperty(value = "value") + private List value; + + /** + * 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()); + } + } +} 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..f66e4badc703d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnectionProvisioningState.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrivateEndpointConnectionProvisioningState. */ +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 or finds a PrivateEndpointConnectionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointConnectionProvisioningState. + */ + @JsonCreator + public static PrivateEndpointConnectionProvisioningState fromString(String name) { + return fromString(name, PrivateEndpointConnectionProvisioningState.class); + } + + /** @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..cb3908df23a56 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointConnections.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.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. + */ + 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. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. + */ + Response getWithResponse( + 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); + + /** + * 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 response. + */ + Response deleteWithResponse( + String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context); + + /** + * 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. + */ + 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. + */ + 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 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..2fad8b5d4693a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateEndpointServiceConnectionStatus.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrivateEndpointServiceConnectionStatus. */ +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 or finds a PrivateEndpointServiceConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointServiceConnectionStatus. + */ + @JsonCreator + public static PrivateEndpointServiceConnectionStatus fromString(String name) { + return fromString(name, PrivateEndpointServiceConnectionStatus.class); + } + + /** @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..4da5b371b73bf --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkResource.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A private link resource. */ +@JsonFlatten +@Fluent +public class PrivateLinkResource extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResource.class); + + /* + * The private link resource group id. + */ + @JsonProperty(value = "properties.groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "properties.requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * The private link resource Private link DNS zone name. + */ + @JsonProperty(value = "properties.requiredZoneNames") + private List requiredZoneNames; + + /** + * 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 PrivateLinkResource object itself. + */ + public PrivateLinkResource withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + 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/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..5a97ee184f390 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkResourceListResult.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.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..3b84ed8013610 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkResources.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.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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. + */ + Response listByStorageAccountWithResponse( + String resourceGroupName, String accountName, Context context); +} 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..fea6488f9069c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PrivateLinkServiceConnectionState.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A collection of information about the state of the connection between service consumer and provider. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnectionState.class); + + /* + * Indicates whether the connection has been Approved/Rejected/Removed by + * the owner of the service. + */ + @JsonProperty(value = "status") + private PrivateEndpointServiceConnectionStatus status; + + /* + * The reason for approval/rejection of the connection. + */ + @JsonProperty(value = "description") + private String description; + + /* + * A message indicating if changes on the service provider require any + * updates on the consumer. + */ + @JsonProperty(value = "actionRequired") + private String actionRequired; + + /** + * 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() { + } +} 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..b37ad8a500f6d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProtocolSettings.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Protocol settings for file service. */ +@Fluent +public final class ProtocolSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProtocolSettings.class); + + /* + * Setting for SMB protocol + */ + @JsonProperty(value = "smb") + private SmbSetting smb; + + /** + * 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(); + } + } +} 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..82a74935137be --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ProvisioningState.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ProvisioningState. */ +public enum ProvisioningState { + /** Enum value Creating. */ + CREATING("Creating"), + + /** Enum value ResolvingDNS. */ + RESOLVING_DNS("ResolvingDNS"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"); + + /** 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. + */ + @JsonCreator + public static ProvisioningState fromString(String value) { + ProvisioningState[] items = ProvisioningState.values(); + for (ProvisioningState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @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..95766d33c40ff --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/PublicAccess.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for PublicAccess. */ +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. + */ + @JsonCreator + public static PublicAccess fromString(String value) { + PublicAccess[] items = PublicAccess.values(); + for (PublicAccess item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @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/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..8b055e625b984 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/QueueServiceProperties.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.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 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..ca2e7f605e18a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/QueueServices.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.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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. + */ + Response listWithResponse(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 resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the 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. + */ + 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 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. + */ + 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. + */ + 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..fafa75bf0e8f0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Queues.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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. + */ + Response getWithResponse( + 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); + + /** + * 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 response. + */ + Response deleteWithResponse(String resourceGroupName, String accountName, String queueName, Context 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 com.azure.core.management.exception.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. + */ + 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. + */ + 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. + */ + 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. + */ + 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 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..a0dbc0a946e76 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Reason.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for Reason. */ +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. + */ + @JsonCreator + public static Reason fromString(String value) { + Reason[] items = Reason.values(); + for (Reason item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @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..79f87236132e0 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ReasonCode.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ReasonCode. */ +public final class ReasonCode extends ExpandableStringEnum { + /** Static value QuotaId for ReasonCode. */ + public static final ReasonCode QUOTA_ID = fromString("QuotaId"); + + /** Static value NotAvailableForSubscription for ReasonCode. */ + public static final ReasonCode NOT_AVAILABLE_FOR_SUBSCRIPTION = fromString("NotAvailableForSubscription"); + + /** + * Creates or finds a ReasonCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReasonCode. + */ + @JsonCreator + public static ReasonCode fromString(String name) { + return fromString(name, ReasonCode.class); + } + + /** @return known ReasonCode values. */ + public static Collection values() { + return values(ReasonCode.class); + } +} diff --git a/sdk/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..8bb795fb73126 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ResourceAccessRule.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.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resource Access Rule. */ +@Fluent +public final class ResourceAccessRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceAccessRule.class); + + /* + * Tenant Id + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /* + * Resource Id + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** + * 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() { + } +} 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..7be6eb10d6965 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RestorePolicyProperties.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The blob service properties for blob restore policy. */ +@Fluent +public final class RestorePolicyProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RestorePolicyProperties.class); + + /* + * Blob restore is enabled if set to true. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * how long this blob can be restored. It should be great than zero and + * less than DeleteRetentionPolicy.days. + */ + @JsonProperty(value = "days") + private Integer days; + + /* + * Deprecated in favor of minRestoreTime property. + */ + @JsonProperty(value = "lastEnabledTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastEnabledTime; + + /* + * Returns the minimum date and time that the restore can be started. + */ + @JsonProperty(value = "minRestoreTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime minRestoreTime; + + /** + * 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() { + } +} 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..b01f71fdb4415 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Restriction.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The restriction because of which SKU cannot be used. */ +@Fluent +public final class Restriction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Restriction.class); + + /* + * The type of restrictions. As of now only possible value for this is + * location. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The value of restrictions. If the restriction type is set to location. + * This would be different locations where the SKU is restricted. + */ + @JsonProperty(value = "values", access = JsonProperty.Access.WRITE_ONLY) + private List values; + + /* + * The reason for the restriction. As of now this can be "QuotaId" or + * "NotAvailableForSubscription". 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. + */ + @JsonProperty(value = "reasonCode") + private ReasonCode reasonCode; + + /** + * 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() { + } +} 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..8d7683bd64a21 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RootSquashType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RootSquashType. */ +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 or finds a RootSquashType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RootSquashType. + */ + @JsonCreator + public static RootSquashType fromString(String name) { + return fromString(name, RootSquashType.class); + } + + /** @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..172f02e781006 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RoutingChoice.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RoutingChoice. */ +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 or finds a RoutingChoice from its string representation. + * + * @param name a name to look for. + * @return the corresponding RoutingChoice. + */ + @JsonCreator + public static RoutingChoice fromString(String name) { + return fromString(name, RoutingChoice.class); + } + + /** @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..3ba4b208453b9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RoutingPreference.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RoutingPreference.class); + + /* + * Routing Choice defines the kind of network routing opted by the user. + */ + @JsonProperty(value = "routingChoice") + private RoutingChoice routingChoice; + + /* + * A boolean flag which indicates whether microsoft routing storage + * endpoints are to be published + */ + @JsonProperty(value = "publishMicrosoftEndpoints") + private Boolean publishMicrosoftEndpoints; + + /* + * A boolean flag which indicates whether internet routing storage + * endpoints are to be published + */ + @JsonProperty(value = "publishInternetEndpoints") + private Boolean publishInternetEndpoints; + + /** + * 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() { + } +} 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..e6e9c18e2e83b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/RuleType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RuleType. */ +public final class RuleType extends ExpandableStringEnum { + /** Static value Lifecycle for RuleType. */ + public static final RuleType LIFECYCLE = fromString("Lifecycle"); + + /** + * Creates or finds a RuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleType. + */ + @JsonCreator + public static RuleType fromString(String name) { + return fromString(name, RuleType.class); + } + + /** @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/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..abdfa592c99c4 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SasPolicy.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; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SasPolicy assigned to the storage account. */ +@Fluent +public final class SasPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SasPolicy.class); + + /* + * The SAS expiration period, DD.HH:MM:SS. + */ + @JsonProperty(value = "sasExpirationPeriod", required = true) + private String sasExpirationPeriod; + + /* + * The SAS expiration action. Can only be Log. + */ + @JsonProperty(value = "expirationAction", required = true) + private ExpirationAction expirationAction; + + /** + * 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. Can only be Log. + * + * @return the expirationAction value. + */ + public ExpirationAction expirationAction() { + return this.expirationAction; + } + + /** + * Set the expirationAction property: The SAS expiration action. Can only be Log. + * + * @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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property sasExpirationPeriod in model SasPolicy")); + } + if (expirationAction() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property expirationAction in model SasPolicy")); + } + } +} 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..a89a678bea58b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Schedule.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Schedule. */ +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 or finds a Schedule from its string representation. + * + * @param name a name to look for. + * @return the corresponding Schedule. + */ + @JsonCreator + public static Schedule fromString(String name) { + return fromString(name, Schedule.class); + } + + /** @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..1ef6be6d3b46c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ServiceSasParameters.java @@ -0,0 +1,509 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The parameters to list service SAS credentials of a specific resource. */ +@Fluent +public final class ServiceSasParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceSasParameters.class); + + /* + * The canonical path to the signed resource. + */ + @JsonProperty(value = "canonicalizedResource", required = true) + private String canonicalizedResource; + + /* + * The signed services accessible with the service SAS. Possible values + * include: Blob (b), Container (c), File (f), Share (s). + */ + @JsonProperty(value = "signedResource") + 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). + */ + @JsonProperty(value = "signedPermission") + private Permissions permissions; + + /* + * An IP address or a range of IP addresses from which to accept requests. + */ + @JsonProperty(value = "signedIp") + private String ipAddressOrRange; + + /* + * The protocol permitted for a request made with the account SAS. + */ + @JsonProperty(value = "signedProtocol") + private HttpProtocol protocols; + + /* + * The time at which the SAS becomes valid. + */ + @JsonProperty(value = "signedStart") + private OffsetDateTime sharedAccessStartTime; + + /* + * The time at which the shared access signature becomes invalid. + */ + @JsonProperty(value = "signedExpiry") + 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. + */ + @JsonProperty(value = "signedIdentifier") + private String identifier; + + /* + * The start of partition key. + */ + @JsonProperty(value = "startPk") + private String partitionKeyStart; + + /* + * The end of partition key. + */ + @JsonProperty(value = "endPk") + private String partitionKeyEnd; + + /* + * The start of row key. + */ + @JsonProperty(value = "startRk") + private String rowKeyStart; + + /* + * The end of row key. + */ + @JsonProperty(value = "endRk") + private String rowKeyEnd; + + /* + * The key to sign the account SAS token with. + */ + @JsonProperty(value = "keyToSign") + private String keyToSign; + + /* + * The response header override for cache control. + */ + @JsonProperty(value = "rscc") + private String cacheControl; + + /* + * The response header override for content disposition. + */ + @JsonProperty(value = "rscd") + private String contentDisposition; + + /* + * The response header override for content encoding. + */ + @JsonProperty(value = "rsce") + private String contentEncoding; + + /* + * The response header override for content language. + */ + @JsonProperty(value = "rscl") + private String contentLanguage; + + /* + * The response header override for content type. + */ + @JsonProperty(value = "rsct") + private String contentType; + + /** + * 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property canonicalizedResource in model ServiceSasParameters")); + } + } +} 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..242367a7f1730 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ServiceSpecification.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** One property of operation, include metric specifications. */ +@Fluent +public final class ServiceSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceSpecification.class); + + /* + * Metric specifications of operation. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * 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()); + } + } +} 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..7cfe77b587af3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Services.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Services. */ +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 or finds a Services from its string representation. + * + * @param name a name to look for. + * @return the corresponding Services. + */ + @JsonCreator + public static Services fromString(String name) { + return fromString(name, Services.class); + } + + /** @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/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..acb1fdc831360 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/ShareAccessTier.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ShareAccessTier. */ +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 or finds a ShareAccessTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding ShareAccessTier. + */ + @JsonCreator + public static ShareAccessTier fromString(String name) { + return fromString(name, ShareAccessTier.class); + } + + /** @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..dd0b7bf068d21 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SignedIdentifier.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SignedIdentifier model. */ +@Fluent +public final class SignedIdentifier { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignedIdentifier.class); + + /* + * An unique identifier of the stored access policy. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Access policy + */ + @JsonProperty(value = "accessPolicy") + private AccessPolicy accessPolicy; + + /** + * 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(); + } + } +} 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..258203c27599b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SignedResource.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SignedResource. */ +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 or finds a SignedResource from its string representation. + * + * @param name a name to look for. + * @return the corresponding SignedResource. + */ + @JsonCreator + public static SignedResource fromString(String name) { + return fromString(name, SignedResource.class); + } + + /** @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..91c3afe15989b --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SignedResourceTypes.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SignedResourceTypes. */ +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 or finds a SignedResourceTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding SignedResourceTypes. + */ + @JsonCreator + public static SignedResourceTypes fromString(String name) { + return fromString(name, SignedResourceTypes.class); + } + + /** @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..1442095b7d69a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Sku.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SKU of the storage account. */ +@Fluent +public final class Sku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); + + /* + * The SKU name. Required for account creation; optional for update. Note + * that in older versions, SKU name was called accountType. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /* + * The SKU tier. This is based on the SKU name. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private SkuTier tier; + + /** + * 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 + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); + } + } +} 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..f1cf843c0a77d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuCapability.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.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The capability information in the specified SKU, including file encryption, network ACLs, change notification, etc. + */ +@Immutable +public final class SkuCapability { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuCapability.class); + + /* + * The name of capability, The capability information in the specified SKU, + * including file encryption, network ACLs, change notification, etc. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * A string value to indicate states of given capability. Possibly 'true' + * or 'false'. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * 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() { + } +} 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..d2576e72fea3a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuInformation.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights 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..a2fd628b7f7db --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuName.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 com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuName. */ +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"); + + /** + * Creates or finds a SkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuName. + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** @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..081bcb3da16d3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SkuTier.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for SkuTier. */ +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. + */ + @JsonCreator + public static SkuTier fromString(String value) { + SkuTier[] items = SkuTier.values(); + for (SkuTier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @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..db3550d023099 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Skus.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. + */ + 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. + */ + 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..7f68b8ed5e03e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/SmbSetting.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Setting for SMB protocol. */ +@Fluent +public final class SmbSetting { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SmbSetting.class); + + /* + * Multichannel setting. Applies to Premium FileStorage only. + */ + @JsonProperty(value = "multichannel") + 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 ';'. + */ + @JsonProperty(value = "versions") + private String versions; + + /* + * SMB authentication methods supported by server. Valid values are NTLMv2, + * Kerberos. Should be passed as a string with delimiter ';'. + */ + @JsonProperty(value = "authenticationMethods") + private String authenticationMethods; + + /* + * Kerberos ticket encryption supported by server. Valid values are + * RC4-HMAC, AES-256. Should be passed as a string with delimiter ';' + */ + @JsonProperty(value = "kerberosTicketEncryption") + 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 ';'. + */ + @JsonProperty(value = "channelEncryption") + private String channelEncryption; + + /** + * 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(); + } + } +} 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..2e074f32ecd74 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/State.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for State. */ +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 or finds a State from its string representation. + * + * @param name a name to look for. + * @return the corresponding State. + */ + @JsonCreator + public static State fromString(String name) { + return fromString(name, State.class); + } + + /** @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..5b5d192b16e25 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccount.java @@ -0,0 +1,1101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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: Gets the encryption settings on the account. If unspecified, the account is + * unencrypted. + * + * @return the encryption value. + */ + Encryption encryption(); + + /** + * Gets the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier used for + * billing. + * + * @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 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 true 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. The default + * interpretation is true for this property. + * + * @return the allowCrossTenantReplication value. + */ + Boolean allowCrossTenantReplication(); + + /** + * 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 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.WithSasPolicy, + DefinitionStages.WithKeyPolicy, + DefinitionStages.WithCustomDomain, + DefinitionStages.WithEncryption, + DefinitionStages.WithNetworkRuleSet, + DefinitionStages.WithAccessTier, + DefinitionStages.WithAzureFilesIdentityBasedAuthentication, + DefinitionStages.WithEnableHttpsTrafficOnly, + DefinitionStages.WithIsHnsEnabled, + DefinitionStages.WithLargeFileSharesState, + DefinitionStages.WithRoutingPreference, + DefinitionStages.WithAllowBlobPublicAccess, + DefinitionStages.WithMinimumTlsVersion, + DefinitionStages.WithAllowSharedKeyAccess, + DefinitionStages.WithEnableNfsV3, + DefinitionStages.WithAllowCrossTenantReplication { + /** + * 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 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: Not applicable. Azure Storage encryption is enabled for all storage + * accounts and cannot be disabled.. + * + * @param encryption Not applicable. Azure Storage encryption is enabled for all storage accounts and cannot + * be disabled. + * @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 used for billing.. + * + * @param accessTier Required for storage accounts where kind = BlobStorage. The access tier used for + * billing. + * @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 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 true for this property.. + * + * @param allowBlobPublicAccess Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is true 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. The default interpretation is true for this property.. + * + * @param allowCrossTenantReplication Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + * @return the next definition stage. + */ + WithCreate withAllowCrossTenantReplication(Boolean allowCrossTenantReplication); + } + } + /** + * 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.WithNetworkRuleSet, + UpdateStages.WithLargeFileSharesState, + UpdateStages.WithRoutingPreference, + UpdateStages.WithAllowBlobPublicAccess, + UpdateStages.WithMinimumTlsVersion, + UpdateStages.WithAllowSharedKeyAccess, + UpdateStages.WithAllowCrossTenantReplication { + /** + * 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: Provides the encryption settings on the account. The default setting + * is unencrypted.. + * + * @param encryption Provides the encryption settings on the account. The default setting is unencrypted. + * @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 used for billing.. + * + * @param accessTier Required for storage accounts where kind = BlobStorage. The access tier used for + * billing. + * @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 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 true for this property.. + * + * @param allowBlobPublicAccess Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is true 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. The default interpretation is true for this property.. + * + * @param allowCrossTenantReplication Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + * @return the next definition stage. + */ + Update withAllowCrossTenantReplication(Boolean allowCrossTenantReplication); + } + } + /** + * 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. + * + * @throws com.azure.core.management.exception.ManagementException 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(); + + /** + * 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. + */ + Response listKeysWithResponse(ListKeyExpand expand, 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); + + /** + * 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. + */ + Response regenerateKeyWithResponse( + StorageAccountRegenerateKeyParameters regenerateKey, 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 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. + */ + Response listAccountSasWithResponse(AccountSasParameters 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); + + /** + * 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. + */ + Response listServiceSasWithResponse(ServiceSasParameters parameters, Context context); + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @throws com.azure.core.management.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(); + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @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(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. + * + * @throws com.azure.core.management.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(); + + /** + * 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 response. + */ + Response revokeUserDelegationKeysWithResponse(Context context); +} 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..47daac7523d54 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountCheckNameAvailabilityParameters.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters used to check the availability of the storage account name. */ +@Fluent +public final class StorageAccountCheckNameAvailabilityParameters { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(StorageAccountCheckNameAvailabilityParameters.class); + + /* + * The storage account name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The type of resource, Microsoft.Storage/storageAccounts + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** Creates an instance of StorageAccountCheckNameAvailabilityParameters class. */ + public StorageAccountCheckNameAvailabilityParameters() { + type = "Microsoft.Storage/storageAccounts"; + } + + /** + * 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; + } + + /** + * Set the type property: The type of resource, Microsoft.Storage/storageAccounts. + * + * @param type the type value to set. + * @return the StorageAccountCheckNameAvailabilityParameters object itself. + */ + public StorageAccountCheckNameAvailabilityParameters withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model StorageAccountCheckNameAvailabilityParameters")); + } + } +} 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..b4596bcff4e86 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountCreateParameters.java @@ -0,0 +1,712 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The parameters used when creating a storage account. */ +@JsonFlatten +@Fluent +public class StorageAccountCreateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountCreateParameters.class); + + /* + * Required. Gets or sets the SKU name. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /* + * Required. Indicates the type of storage account. + */ + @JsonProperty(value = "kind", required = true) + 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. + */ + @JsonProperty(value = "location", required = true) + 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 + */ + @JsonProperty(value = "extendedLocation") + 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. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /* + * SasPolicy assigned to the storage account. + */ + @JsonProperty(value = "properties.sasPolicy") + private SasPolicy sasPolicy; + + /* + * KeyPolicy assigned to the storage account. + */ + @JsonProperty(value = "properties.keyPolicy") + 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. + */ + @JsonProperty(value = "properties.customDomain") + private CustomDomain customDomain; + + /* + * Not applicable. Azure Storage encryption is enabled for all storage + * accounts and cannot be disabled. + */ + @JsonProperty(value = "properties.encryption") + private Encryption encryption; + + /* + * Network rule set + */ + @JsonProperty(value = "properties.networkAcls") + private NetworkRuleSet networkRuleSet; + + /* + * Required for storage accounts where kind = BlobStorage. The access tier + * used for billing. + */ + @JsonProperty(value = "properties.accessTier") + private AccessTier accessTier; + + /* + * Provides the identity based authentication settings for Azure Files. + */ + @JsonProperty(value = "properties.azureFilesIdentityBasedAuthentication") + 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. + */ + @JsonProperty(value = "properties.supportsHttpsTrafficOnly") + private Boolean enableHttpsTrafficOnly; + + /* + * Account HierarchicalNamespace enabled if sets to true. + */ + @JsonProperty(value = "properties.isHnsEnabled") + private Boolean isHnsEnabled; + + /* + * Allow large file shares if sets to Enabled. It cannot be disabled once + * it is enabled. + */ + @JsonProperty(value = "properties.largeFileSharesState") + private LargeFileSharesState largeFileSharesState; + + /* + * Maintains information about the network routing choice opted by the user + * for data transfer + */ + @JsonProperty(value = "properties.routingPreference") + private RoutingPreference routingPreference; + + /* + * Allow or disallow public access to all blobs or containers in the + * storage account. The default interpretation is true for this property. + */ + @JsonProperty(value = "properties.allowBlobPublicAccess") + 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. + */ + @JsonProperty(value = "properties.minimumTlsVersion") + 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. + */ + @JsonProperty(value = "properties.allowSharedKeyAccess") + private Boolean allowSharedKeyAccess; + + /* + * NFS 3.0 protocol support enabled if set to true. + */ + @JsonProperty(value = "properties.isNfsV3Enabled") + private Boolean enableNfsV3; + + /* + * Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + */ + @JsonProperty(value = "properties.allowCrossTenantReplication") + private Boolean allowCrossTenantReplication; + + /** + * 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 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 StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters 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 StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters 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 StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withCustomDomain(CustomDomain customDomain) { + this.customDomain = customDomain; + return this; + } + + /** + * Get the encryption property: Not applicable. Azure Storage encryption is enabled 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 is enabled for all storage accounts and + * cannot be disabled. + * + * @param encryption the encryption value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters 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 StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + this.networkRuleSet = networkRuleSet; + return this; + } + + /** + * Get the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier used for + * billing. + * + * @return the accessTier value. + */ + public AccessTier accessTier() { + return this.accessTier; + } + + /** + * Set the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier used for + * billing. + * + * @param accessTier the accessTier value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters 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 StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters 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 StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withEnableHttpsTrafficOnly(Boolean enableHttpsTrafficOnly) { + this.enableHttpsTrafficOnly = enableHttpsTrafficOnly; + 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 StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters 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 StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters 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 StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters 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 true 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 true for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters 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 StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters 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 StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters 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 StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withEnableNfsV3(Boolean enableNfsV3) { + this.enableNfsV3 = enableNfsV3; + return this; + } + + /** + * Get the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + * + * @return the allowCrossTenantReplication value. + */ + public Boolean allowCrossTenantReplication() { + return this.allowCrossTenantReplication; + } + + /** + * Set the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + * + * @param allowCrossTenantReplication the allowCrossTenantReplication value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withAllowCrossTenantReplication(Boolean allowCrossTenantReplication) { + this.allowCrossTenantReplication = allowCrossTenantReplication; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sku in model StorageAccountCreateParameters")); + } else { + sku().validate(); + } + if (kind() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property kind in model StorageAccountCreateParameters")); + } + if (location() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property location in model StorageAccountCreateParameters")); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (identity() != null) { + identity().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(); + } + } +} 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..c1ae4cf65a9b2 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountExpand.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** 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. + */ + @JsonCreator + public static StorageAccountExpand fromString(String value) { + StorageAccountExpand[] items = StorageAccountExpand.values(); + for (StorageAccountExpand item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @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..ba31ad5cde8c1 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountInternetEndpoints.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountInternetEndpoints.class); + + /* + * Gets the blob endpoint. + */ + @JsonProperty(value = "blob", access = JsonProperty.Access.WRITE_ONLY) + private String blob; + + /* + * Gets the file endpoint. + */ + @JsonProperty(value = "file", access = JsonProperty.Access.WRITE_ONLY) + private String file; + + /* + * Gets the web endpoint. + */ + @JsonProperty(value = "web", access = JsonProperty.Access.WRITE_ONLY) + private String web; + + /* + * Gets the dfs endpoint. + */ + @JsonProperty(value = "dfs", access = JsonProperty.Access.WRITE_ONLY) + private String dfs; + + /** + * 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() { + } +} 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..aa0ec4438d776 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountKey.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.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** An access key for the storage account. */ +@Immutable +public final class StorageAccountKey { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountKey.class); + + /* + * Name of the key. + */ + @JsonProperty(value = "keyName", access = JsonProperty.Access.WRITE_ONLY) + private String keyName; + + /* + * Base 64-encoded value of the key. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /* + * Permissions for the key -- read-only or full permissions. + */ + @JsonProperty(value = "permissions", access = JsonProperty.Access.WRITE_ONLY) + private KeyPermission permissions; + + /* + * Creation time of the key, in round trip date format. + */ + @JsonProperty(value = "creationTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationTime; + + /** + * 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() { + } +} 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..59780dcdb9ae9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountListKeysResult.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.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..ede227837effd --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountListResult.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.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.models.StorageAccountInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List Storage Accounts operation. */ +@Immutable +public final class StorageAccountListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountListResult.class); + + /* + * Gets the list of storage accounts and their properties. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * 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()); + } + } +} 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..d3f86b2c77240 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountMicrosoftEndpoints.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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountMicrosoftEndpoints.class); + + /* + * Gets the blob endpoint. + */ + @JsonProperty(value = "blob", access = JsonProperty.Access.WRITE_ONLY) + private String blob; + + /* + * Gets the queue endpoint. + */ + @JsonProperty(value = "queue", access = JsonProperty.Access.WRITE_ONLY) + private String queue; + + /* + * Gets the table endpoint. + */ + @JsonProperty(value = "table", access = JsonProperty.Access.WRITE_ONLY) + private String table; + + /* + * Gets the file endpoint. + */ + @JsonProperty(value = "file", access = JsonProperty.Access.WRITE_ONLY) + private String file; + + /* + * Gets the web endpoint. + */ + @JsonProperty(value = "web", access = JsonProperty.Access.WRITE_ONLY) + private String web; + + /* + * Gets the dfs endpoint. + */ + @JsonProperty(value = "dfs", access = JsonProperty.Access.WRITE_ONLY) + private String dfs; + + /** + * 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() { + } +} 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..48af1d8cb0f5c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountRegenerateKeyParameters.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters used to regenerate the storage account key. */ +@Fluent +public final class StorageAccountRegenerateKeyParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountRegenerateKeyParameters.class); + + /* + * The name of storage keys that want to be regenerated, possible values + * are key1, key2, kerb1, kerb2. + */ + @JsonProperty(value = "keyName", required = true) + private String keyName; + + /** + * 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyName in model StorageAccountRegenerateKeyParameters")); + } + } +} 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..10ae732ff1141 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccountUpdateParameters.java @@ -0,0 +1,576 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The parameters that can be provided when updating the storage account properties. */ +@JsonFlatten +@Fluent +public class StorageAccountUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountUpdateParameters.class); + + /* + * 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. + */ + @JsonProperty(value = "sku") + 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. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /* + * Optional. Indicates the type of storage account. Currently only + * StorageV2 value supported by server. + */ + @JsonProperty(value = "kind") + private Kind kind; + + /* + * 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. + */ + @JsonProperty(value = "properties.customDomain") + private CustomDomain customDomain; + + /* + * Provides the encryption settings on the account. The default setting is + * unencrypted. + */ + @JsonProperty(value = "properties.encryption") + private Encryption encryption; + + /* + * SasPolicy assigned to the storage account. + */ + @JsonProperty(value = "properties.sasPolicy") + private SasPolicy sasPolicy; + + /* + * KeyPolicy assigned to the storage account. + */ + @JsonProperty(value = "properties.keyPolicy") + private KeyPolicy keyPolicy; + + /* + * Required for storage accounts where kind = BlobStorage. The access tier + * used for billing. + */ + @JsonProperty(value = "properties.accessTier") + private AccessTier accessTier; + + /* + * Provides the identity based authentication settings for Azure Files. + */ + @JsonProperty(value = "properties.azureFilesIdentityBasedAuthentication") + private AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication; + + /* + * Allows https traffic only to storage service if sets to true. + */ + @JsonProperty(value = "properties.supportsHttpsTrafficOnly") + private Boolean enableHttpsTrafficOnly; + + /* + * Network rule set + */ + @JsonProperty(value = "properties.networkAcls") + private NetworkRuleSet networkRuleSet; + + /* + * Allow large file shares if sets to Enabled. It cannot be disabled once + * it is enabled. + */ + @JsonProperty(value = "properties.largeFileSharesState") + private LargeFileSharesState largeFileSharesState; + + /* + * Maintains information about the network routing choice opted by the user + * for data transfer + */ + @JsonProperty(value = "properties.routingPreference") + private RoutingPreference routingPreference; + + /* + * Allow or disallow public access to all blobs or containers in the + * storage account. The default interpretation is true for this property. + */ + @JsonProperty(value = "properties.allowBlobPublicAccess") + 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. + */ + @JsonProperty(value = "properties.minimumTlsVersion") + 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. + */ + @JsonProperty(value = "properties.allowSharedKeyAccess") + private Boolean allowSharedKeyAccess; + + /* + * Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + */ + @JsonProperty(value = "properties.allowCrossTenantReplication") + private Boolean allowCrossTenantReplication; + + /** + * 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 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.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) { + this.customDomain = customDomain; + return this; + } + + /** + * Get the encryption property: Provides the encryption settings on the account. The default setting is unencrypted. + * + * @return the encryption value. + */ + public Encryption encryption() { + return this.encryption; + } + + /** + * Set the encryption property: Provides the encryption settings on the account. The default setting is unencrypted. + * + * @param encryption the encryption value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters 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 StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters 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 StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withKeyPolicy(KeyPolicy keyPolicy) { + this.keyPolicy = keyPolicy; + return this; + } + + /** + * Get the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier used for + * billing. + * + * @return the accessTier value. + */ + public AccessTier accessTier() { + return this.accessTier; + } + + /** + * Set the accessTier property: Required for storage accounts where kind = BlobStorage. The access tier used for + * billing. + * + * @param accessTier the accessTier value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters 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 StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters 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 StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters 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; + } + + /** + * Set the networkRuleSet property: Network rule set. + * + * @param networkRuleSet the networkRuleSet value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters 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 StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters 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 StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters 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 true 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 true for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters 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 StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters 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 StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withAllowSharedKeyAccess(Boolean allowSharedKeyAccess) { + this.allowSharedKeyAccess = allowSharedKeyAccess; + return this; + } + + /** + * Get the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + * + * @return the allowCrossTenantReplication value. + */ + public Boolean allowCrossTenantReplication() { + return this.allowCrossTenantReplication; + } + + /** + * Set the allowCrossTenantReplication property: Allow or disallow cross AAD tenant object replication. The default + * interpretation is true for this property. + * + * @param allowCrossTenantReplication the allowCrossTenantReplication value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withAllowCrossTenantReplication(Boolean allowCrossTenantReplication) { + this.allowCrossTenantReplication = allowCrossTenantReplication; + 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 (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(); + } + } +} 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..c622664bc4823 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageAccounts.java @@ -0,0 +1,430 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. + */ + Response checkNameAvailabilityWithResponse( + StorageAccountCheckNameAvailabilityParameters 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); + + /** + * 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 response. + */ + Response deleteWithResponse(String resourceGroupName, String accountName, 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); + + /** + * 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. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, StorageAccountExpand expand, Context context); + + /** + * 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. + */ + 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. + */ + 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. + */ + 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. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. + */ + Response listKeysWithResponse( + String resourceGroupName, String accountName, ListKeyExpand expand, 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); + + /** + * 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. + */ + Response regenerateKeyWithResponse( + String resourceGroupName, + String accountName, + StorageAccountRegenerateKeyParameters regenerateKey, + 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 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. + */ + Response listAccountSasWithResponse( + String resourceGroupName, String accountName, AccountSasParameters 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); + + /** + * 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. + */ + Response listServiceSasWithResponse( + String resourceGroupName, String accountName, ServiceSasParameters parameters, Context context); + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within 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); + + /** + * Failover request can be triggered for a storage account in case of availability issues. The failover occurs from + * the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become + * primary after failover. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the 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 failover(String resourceGroupName, String accountName, 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. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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); + + /** + * 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 response. + */ + Response revokeUserDelegationKeysWithResponse(String resourceGroupName, String accountName, 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 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. + */ + 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. + */ + 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 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..c7ed6795c3a1f --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageQueue.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.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 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..6a15fc52bd11a --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/StorageSkuListResult.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storage.generated.fluent.models.SkuInformationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List Storage SKUs operation. */ +@Immutable +public final class StorageSkuListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageSkuListResult.class); + + /* + * Get the list result of storage SKUs and their properties. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * 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()); + } + } +} 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..469a8a6d00bc2 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Table.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.models; + +import com.azure.resourcemanager.storage.generated.fluent.models.TableInner; + +/** 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 inner com.azure.resourcemanager.storage.generated.fluent.models.TableInner object. + * + * @return the inner object. + */ + TableInner innerModel(); +} 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..9a9257c9160fa --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableServiceProperties.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.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 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..fa1ba7fa4d3f8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TableServices.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.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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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. + */ + Response listWithResponse(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 resourceGroupName The name of the resource group within the user's subscription. The name is case + * insensitive. + * @param accountName The name of the storage account within the 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. + */ + 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 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. + */ + 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. + */ + 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/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..a559b00a533d6 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Tables.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.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 { + /** + * 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. + */ + Table 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 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. + */ + Response
createWithResponse(String resourceGroupName, String accountName, String tableName, 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. + */ + Table update(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 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. + */ + Response
updateWithResponse(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); + + /** + * 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. + */ + Response
getWithResponse(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); + + /** + * 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 response. + */ + Response deleteWithResponse(String resourceGroupName, String accountName, String tableName, Context 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 com.azure.core.management.exception.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. + */ + 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. + */ + 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/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..b0e0ed96e8e77 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TagFilter.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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Blob index tag based filtering for blob objects. */ +@Fluent +public final class TagFilter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagFilter.class); + + /* + * This is the filter tag name, it can have 1 - 128 characters + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * This is the comparison operator which is used for object comparison and + * filtering. Only == (equality operator) is currently supported + */ + @JsonProperty(value = "op", required = true) + private String op; + + /* + * This is the filter tag value field used for tag based filtering, it can + * have 0 - 256 characters + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * 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 + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model TagFilter")); + } + if (op() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property op in model TagFilter")); + } + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model TagFilter")); + } + } +} 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..c34c170dd4ef9 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/TagProperty.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** A tag of the LegalHold of a blob container. */ +@Immutable +public final class TagProperty { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagProperty.class); + + /* + * The tag value. + */ + @JsonProperty(value = "tag", access = JsonProperty.Access.WRITE_ONLY) + private String tag; + + /* + * Returns the date and time the tag was added. + */ + @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timestamp; + + /* + * Returns the Object ID of the user who added the tag. + */ + @JsonProperty(value = "objectIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String objectIdentifier; + + /* + * Returns the Tenant ID that issued the token for the user who added the + * tag. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * Returns the User Principal Name of the user who added the tag. + */ + @JsonProperty(value = "upn", access = JsonProperty.Access.WRITE_ONLY) + private String upn; + + /** + * 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() { + } +} 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..7ace5416ac981 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UpdateHistoryProperty.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** An update history of the ImmutabilityPolicy of a blob container. */ +@Immutable +public final class UpdateHistoryProperty { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateHistoryProperty.class); + + /* + * The ImmutabilityPolicy update type of a blob container, possible values + * include: put, lock and extend. + */ + @JsonProperty(value = "update", access = JsonProperty.Access.WRITE_ONLY) + private ImmutabilityPolicyUpdateType update; + + /* + * The immutability period for the blobs in the container since the policy + * creation, in days. + */ + @JsonProperty(value = "immutabilityPeriodSinceCreationInDays", access = JsonProperty.Access.WRITE_ONLY) + private Integer immutabilityPeriodSinceCreationInDays; + + /* + * Returns the date and time the ImmutabilityPolicy was updated. + */ + @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timestamp; + + /* + * Returns the Object ID of the user who updated the ImmutabilityPolicy. + */ + @JsonProperty(value = "objectIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String objectIdentifier; + + /* + * Returns the Tenant ID that issued the token for the user who updated the + * ImmutabilityPolicy. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * Returns the User Principal Name of the user who updated the + * ImmutabilityPolicy. + */ + @JsonProperty(value = "upn", access = JsonProperty.Access.WRITE_ONLY) + private String upn; + + /** + * 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; + } + + /** + * 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/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..b1cc83b21b53e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Usage.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.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..3ee7d626c7245 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UsageListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.resourcemanager.storage.generated.fluent.models.UsageInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List Usages operation. */ +@Fluent +public final class UsageListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageListResult.class); + + /* + * Gets or sets the list of Storage Resource Usages. + */ + @JsonProperty(value = "value") + private List value; + + /** + * 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()); + } + } +} 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..f7d363ff203c8 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UsageName.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.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The usage names that can be used; currently limited to StorageAccount. */ +@Immutable +public final class UsageName { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageName.class); + + /* + * Gets a string describing the resource name. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /* + * Gets a localized string describing the resource name. + */ + @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) + private String localizedValue; + + /** + * 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() { + } +} 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..e8ad44934284e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UsageUnit.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for UsageUnit. */ +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. + */ + @JsonCreator + public static UsageUnit fromString(String value) { + UsageUnit[] items = UsageUnit.values(); + for (UsageUnit item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @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..a481224ac35e3 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/Usages.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.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. + */ + 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. + */ + 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..47c7ca372a92d --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/UserAssignedIdentity.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.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** UserAssignedIdentity for the resource. */ +@Immutable +public class UserAssignedIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserAssignedIdentity.class); + + /* + * The principal ID of the identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The client ID of the identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** + * 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() { + } +} 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..04cc5721011bb --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/VirtualNetworkRule.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Virtual Network rule. */ +@Fluent +public final class VirtualNetworkRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkRule.class); + + /* + * Resource ID of a subnet, for example: + * /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + */ + @JsonProperty(value = "id", required = true) + private String virtualNetworkResourceId; + + /* + * The action of virtual network rule. + */ + @JsonProperty(value = "action") + private Action action; + + /* + * Gets the state of virtual network rule. + */ + @JsonProperty(value = "state") + private State state; + + /** + * 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property virtualNetworkResourceId in model VirtualNetworkRule")); + } + } +} 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..dad9fc0c3748c --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/models/package-info.java @@ -0,0 +1,6 @@ +// 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..74a9d5d7feb33 --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/com/azure/resourcemanager/storage/generated/package-info.java @@ -0,0 +1,6 @@ +// 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..fc9cba352e14e --- /dev/null +++ b/sdk/storage/azure-resourcemanager-storage-generated/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// 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, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.storage.generated.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 23773f2951abe..9ef56e1931e08 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -76,6 +76,9 @@ extends: - name: azure-storage-queue groupId: com.azure safeName: azurestoragequeue + - name: azure-resourcemanager-storage-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerstoragegenerated AdditionalModules: - name: azure-storage-perf groupId: com.azure diff --git a/sdk/storage/pom.xml b/sdk/storage/pom.xml index 56d621d2dd859..d81ecd192c80c 100644 --- a/sdk/storage/pom.xml +++ b/sdk/storage/pom.xml @@ -104,17 +104,18 @@ true - azure-storage-common + 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-file-share + azure-storage-common azure-storage-file-datalake + azure-storage-file-share azure-storage-internal-avro - azure-storage-queue azure-storage-perf + azure-storage-queue microsoft-azure-storage-blob microsoft-azure-storage-perf