diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 7ba5bf3701b63..3b71f68bbeba8 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-storagepool;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/pom.xml b/pom.xml index ecd2255183748..a77e2ff99f2d9 100644 --- a/pom.xml +++ b/pom.xml @@ -810,6 +810,7 @@ sdk/storage sdk/storagecache sdk/storageimportexport + sdk/storagepool sdk/streamanalytics sdk/subscription sdk/support diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/CHANGELOG.md b/sdk/storagepool/azure-resourcemanager-storagepool/CHANGELOG.md new file mode 100644 index 0000000000000..e2396a4d497d8 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-06-23) + +- Azure Resource Manager StoragePool client library for Java. This package contains Microsoft Azure SDK for StoragePool Management SDK. Package tag package-2021-04-01-preview. 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/storagepool/azure-resourcemanager-storagepool/README.md b/sdk/storagepool/azure-resourcemanager-storagepool/README.md new file mode 100644 index 0000000000000..e4c0754e36830 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/README.md @@ -0,0 +1,101 @@ +# Azure Resource Manager StoragePool client library for Java + +Azure Resource Manager StoragePool client library for Java. + +This package contains Microsoft Azure SDK for StoragePool Management SDK. Package tag package-2021-04-01-preview. 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-storagepool;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-storagepool + 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(); +StoragePoolManager manager = StoragePoolManager + .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/storagepool/azure-resourcemanager-storagepool/pom.xml b/sdk/storagepool/azure-resourcemanager-storagepool/pom.xml new file mode 100644 index 0000000000000..4688b10d7e011 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/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-storagepool + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for StoragePool Management + This package contains Microsoft Azure SDK for StoragePool Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2021-04-01-preview. + 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.17.0 + + + com.azure + azure-core-management + 1.3.0 + + + + + + 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/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/StoragePoolManager.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/StoragePoolManager.java new file mode 100644 index 0000000000000..9f11cd93ebf72 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/StoragePoolManager.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagepool; + +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.storagepool.fluent.StoragePoolManagement; +import com.azure.resourcemanager.storagepool.implementation.DiskPoolZonesImpl; +import com.azure.resourcemanager.storagepool.implementation.DiskPoolsImpl; +import com.azure.resourcemanager.storagepool.implementation.IscsiTargetsImpl; +import com.azure.resourcemanager.storagepool.implementation.OperationsImpl; +import com.azure.resourcemanager.storagepool.implementation.StoragePoolManagementBuilder; +import com.azure.resourcemanager.storagepool.models.DiskPoolZones; +import com.azure.resourcemanager.storagepool.models.DiskPools; +import com.azure.resourcemanager.storagepool.models.IscsiTargets; +import com.azure.resourcemanager.storagepool.models.Operations; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to StoragePoolManager. */ +public final class StoragePoolManager { + private Operations operations; + + private DiskPools diskPools; + + private DiskPoolZones diskPoolZones; + + private IscsiTargets iscsiTargets; + + private final StoragePoolManagement clientObject; + + private StoragePoolManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new StoragePoolManagementBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of StoragePool service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the StoragePool service API instance. + */ + public static StoragePoolManager 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 StoragePoolManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new StoragePoolManager.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 StoragePool service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the StoragePool service API instance. + */ + public StoragePoolManager 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.storagepool") + .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 StoragePoolManager(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 DiskPools. */ + public DiskPools diskPools() { + if (this.diskPools == null) { + this.diskPools = new DiskPoolsImpl(clientObject.getDiskPools(), this); + } + return diskPools; + } + + /** @return Resource collection API of DiskPoolZones. */ + public DiskPoolZones diskPoolZones() { + if (this.diskPoolZones == null) { + this.diskPoolZones = new DiskPoolZonesImpl(clientObject.getDiskPoolZones(), this); + } + return diskPoolZones; + } + + /** @return Resource collection API of IscsiTargets. */ + public IscsiTargets iscsiTargets() { + if (this.iscsiTargets == null) { + this.iscsiTargets = new IscsiTargetsImpl(clientObject.getIscsiTargets(), this); + } + return iscsiTargets; + } + + /** + * @return Wrapped service client StoragePoolManagement providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + */ + public StoragePoolManagement serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/DiskPoolZonesClient.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/DiskPoolZonesClient.java new file mode 100644 index 0000000000000..d0f1218ac434a --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/DiskPoolZonesClient.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.storagepool.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.storagepool.fluent.models.DiskPoolZoneInfoInner; + +/** An instance of this class provides access to all the operations defined in DiskPoolZonesClient. */ +public interface DiskPoolZonesClient { + /** + * Lists available Disk Pool Skus in an Azure location. + * + * @param location The location of the 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 list Disk Pool skus operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * Lists available Disk Pool Skus in an Azure location. + * + * @param location The location of the 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 list Disk Pool skus operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, Context context); +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/DiskPoolsClient.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/DiskPoolsClient.java new file mode 100644 index 0000000000000..2f544b54b2afa --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/DiskPoolsClient.java @@ -0,0 +1,406 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagepool.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.storagepool.fluent.models.DiskPoolInner; +import com.azure.resourcemanager.storagepool.fluent.models.OutboundEnvironmentEndpointInner; +import com.azure.resourcemanager.storagepool.models.DiskPoolCreate; +import com.azure.resourcemanager.storagepool.models.DiskPoolUpdate; + +/** An instance of this class provides access to all the operations defined in DiskPoolsClient. */ +public interface DiskPoolsClient { + /** + * Gets a list of Disk Pools in a 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 a list of Disk Pools in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of Disk Pools in a 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 a list of Disk Pools in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets a list of DiskPools in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of DiskPools in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of DiskPools in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of DiskPools in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Create or Update Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolCreatePayload Request payload for Disk Pool create operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DiskPoolInner> beginCreateOrUpdate( + String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload); + + /** + * Create or Update Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolCreatePayload Request payload for Disk Pool create operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DiskPoolInner> beginCreateOrUpdate( + String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload, Context context); + + /** + * Create or Update Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolCreatePayload Request payload for Disk Pool create operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiskPoolInner createOrUpdate(String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload); + + /** + * Create or Update Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolCreatePayload Request payload for Disk Pool create operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiskPoolInner createOrUpdate( + String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload, Context context); + + /** + * Update a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolUpdatePayload Request payload for Disk Pool update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DiskPoolInner> beginUpdate( + String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload); + + /** + * Update a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolUpdatePayload Request payload for Disk Pool update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DiskPoolInner> beginUpdate( + String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload, Context context); + + /** + * Update a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolUpdatePayload Request payload for Disk Pool update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiskPoolInner update(String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload); + + /** + * Update a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolUpdatePayload Request payload for Disk Pool update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiskPoolInner update( + String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload, Context context); + + /** + * Delete a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginDelete(String resourceGroupName, String diskPoolName); + + /** + * Delete a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginDelete(String resourceGroupName, String diskPoolName, Context context); + + /** + * Delete a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 diskPoolName); + + /** + * Delete a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 diskPoolName, Context context); + + /** + * Get a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Disk pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DiskPoolInner getByResourceGroup(String resourceGroupName, String diskPoolName); + + /** + * Get a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Disk pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String diskPoolName, Context context); + + /** + * Gets the network endpoints of all outbound dependencies of a Disk Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network endpoints of all outbound dependencies of a Disk Pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listOutboundNetworkDependenciesEndpoints( + String resourceGroupName, String diskPoolName); + + /** + * Gets the network endpoints of all outbound dependencies of a Disk Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network endpoints of all outbound dependencies of a Disk Pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listOutboundNetworkDependenciesEndpoints( + String resourceGroupName, String diskPoolName, Context context); + + /** + * The operation to start a Disk Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginStart(String resourceGroupName, String diskPoolName); + + /** + * The operation to start a Disk Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginStart(String resourceGroupName, String diskPoolName, Context context); + + /** + * The operation to start a Disk Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 start(String resourceGroupName, String diskPoolName); + + /** + * The operation to start a Disk Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 start(String resourceGroupName, String diskPoolName, Context context); + + /** + * Shuts down the Disk Pool and releases the compute resources. You are not billed for the compute resources that + * this Disk Pool uses. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginDeallocate(String resourceGroupName, String diskPoolName); + + /** + * Shuts down the Disk Pool and releases the compute resources. You are not billed for the compute resources that + * this Disk Pool uses. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginDeallocate(String resourceGroupName, String diskPoolName, Context context); + + /** + * Shuts down the Disk Pool and releases the compute resources. You are not billed for the compute resources that + * this Disk Pool uses. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deallocate(String resourceGroupName, String diskPoolName); + + /** + * Shuts down the Disk Pool and releases the compute resources. You are not billed for the compute resources that + * this Disk Pool uses. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deallocate(String resourceGroupName, String diskPoolName, Context context); +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/IscsiTargetsClient.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/IscsiTargetsClient.java new file mode 100644 index 0000000000000..caba664bbfa2c --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/IscsiTargetsClient.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagepool.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.storagepool.fluent.models.IscsiTargetInner; +import com.azure.resourcemanager.storagepool.models.IscsiTargetCreate; +import com.azure.resourcemanager.storagepool.models.IscsiTargetUpdate; + +/** An instance of this class provides access to all the operations defined in IscsiTargetsClient. */ +public interface IscsiTargetsClient { + /** + * Get iSCSI Targets in a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return iSCSI Targets in a Disk pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDiskPool(String resourceGroupName, String diskPoolName); + + /** + * Get iSCSI Targets in a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return iSCSI Targets in a Disk pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDiskPool(String resourceGroupName, String diskPoolName, Context context); + + /** + * Create or Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetCreatePayload Request payload for iSCSI Target create operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, IscsiTargetInner> beginCreateOrUpdate( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetCreate iscsiTargetCreatePayload); + + /** + * Create or Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetCreatePayload Request payload for iSCSI Target create operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, IscsiTargetInner> beginCreateOrUpdate( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetCreate iscsiTargetCreatePayload, + Context context); + + /** + * Create or Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetCreatePayload Request payload for iSCSI Target create operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IscsiTargetInner createOrUpdate( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetCreate iscsiTargetCreatePayload); + + /** + * Create or Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetCreatePayload Request payload for iSCSI Target create operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IscsiTargetInner createOrUpdate( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetCreate iscsiTargetCreatePayload, + Context context); + + /** + * Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetUpdatePayload Request payload for iSCSI Target update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, IscsiTargetInner> beginUpdate( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetUpdate iscsiTargetUpdatePayload); + + /** + * Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetUpdatePayload Request payload for iSCSI Target update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, IscsiTargetInner> beginUpdate( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetUpdate iscsiTargetUpdatePayload, + Context context); + + /** + * Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetUpdatePayload Request payload for iSCSI Target update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IscsiTargetInner update( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetUpdate iscsiTargetUpdatePayload); + + /** + * Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetUpdatePayload Request payload for iSCSI Target update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IscsiTargetInner update( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetUpdate iscsiTargetUpdatePayload, + Context context); + + /** + * Delete an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginDelete( + String resourceGroupName, String diskPoolName, String iscsiTargetName); + + /** + * Delete an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginDelete( + String resourceGroupName, String diskPoolName, String iscsiTargetName, Context context); + + /** + * Delete an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 diskPoolName, String iscsiTargetName); + + /** + * Delete an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 diskPoolName, String iscsiTargetName, Context context); + + /** + * Get an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an iSCSI Target. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IscsiTargetInner get(String resourceGroupName, String diskPoolName, String iscsiTargetName); + + /** + * Get an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an iSCSI Target. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String diskPoolName, String iscsiTargetName, Context context); +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/OperationsClient.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/OperationsClient.java new file mode 100644 index 0000000000000..9a803ae5ad685 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/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.storagepool.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.storagepool.fluent.models.StoragePoolRPOperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Gets a list of StoragePool 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 a list of StoragePool operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of StoragePool 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 a list of StoragePool operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/StoragePoolManagement.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/StoragePoolManagement.java new file mode 100644 index 0000000000000..088441855d825 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/StoragePoolManagement.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.storagepool.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for StoragePoolManagement class. */ +public interface StoragePoolManagement { + /** + * 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 DiskPoolsClient object to access its operations. + * + * @return the DiskPoolsClient object. + */ + DiskPoolsClient getDiskPools(); + + /** + * Gets the DiskPoolZonesClient object to access its operations. + * + * @return the DiskPoolZonesClient object. + */ + DiskPoolZonesClient getDiskPoolZones(); + + /** + * Gets the IscsiTargetsClient object to access its operations. + * + * @return the IscsiTargetsClient object. + */ + IscsiTargetsClient getIscsiTargets(); +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/DiskPoolInner.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/DiskPoolInner.java new file mode 100644 index 0000000000000..c77c238caafad --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/DiskPoolInner.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagepool.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.storagepool.models.Disk; +import com.azure.resourcemanager.storagepool.models.OperationalStatus; +import com.azure.resourcemanager.storagepool.models.ProvisioningStates; +import com.azure.resourcemanager.storagepool.models.SystemMetadata; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Response for Disk Pool request. */ +@JsonFlatten +@Fluent +public class DiskPoolInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskPoolInner.class); + + /* + * Resource metadata required by ARM RPC + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemMetadata systemData; + + /* + * State of the operation on the resource. + */ + @JsonProperty(value = "properties.provisioningState", required = true, access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningStates provisioningState; + + /* + * Logical zone for Disk Pool resource; example: ["1"]. + */ + @JsonProperty(value = "properties.availabilityZones", required = true) + private List availabilityZones; + + /* + * Operational status of the Disk Pool. + */ + @JsonProperty(value = "properties.status", required = true) + private OperationalStatus status; + + /* + * List of Azure Managed Disks to attach to a Disk Pool. + */ + @JsonProperty(value = "properties.disks") + private List disks; + + /* + * Azure Resource ID of a Subnet for the Disk Pool. + */ + @JsonProperty(value = "properties.subnetId", required = true) + private String subnetId; + + /* + * List of additional capabilities for Disk Pool. + */ + @JsonProperty(value = "properties.additionalCapabilities") + private List additionalCapabilities; + + /* + * Sku name + */ + @JsonProperty(value = "sku.name") + private String nameSkuName; + + /* + * Sku tier + */ + @JsonProperty(value = "sku.tier") + private String tier; + + /** + * Get the systemData property: Resource metadata required by ARM RPC. + * + * @return the systemData value. + */ + public SystemMetadata systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: State of the operation on the resource. + * + * @return the provisioningState value. + */ + public ProvisioningStates provisioningState() { + return this.provisioningState; + } + + /** + * Get the availabilityZones property: Logical zone for Disk Pool resource; example: ["1"]. + * + * @return the availabilityZones value. + */ + public List availabilityZones() { + return this.availabilityZones; + } + + /** + * Set the availabilityZones property: Logical zone for Disk Pool resource; example: ["1"]. + * + * @param availabilityZones the availabilityZones value to set. + * @return the DiskPoolInner object itself. + */ + public DiskPoolInner withAvailabilityZones(List availabilityZones) { + this.availabilityZones = availabilityZones; + return this; + } + + /** + * Get the status property: Operational status of the Disk Pool. + * + * @return the status value. + */ + public OperationalStatus status() { + return this.status; + } + + /** + * Set the status property: Operational status of the Disk Pool. + * + * @param status the status value to set. + * @return the DiskPoolInner object itself. + */ + public DiskPoolInner withStatus(OperationalStatus status) { + this.status = status; + return this; + } + + /** + * Get the disks property: List of Azure Managed Disks to attach to a Disk Pool. + * + * @return the disks value. + */ + public List disks() { + return this.disks; + } + + /** + * Set the disks property: List of Azure Managed Disks to attach to a Disk Pool. + * + * @param disks the disks value to set. + * @return the DiskPoolInner object itself. + */ + public DiskPoolInner withDisks(List disks) { + this.disks = disks; + return this; + } + + /** + * Get the subnetId property: Azure Resource ID of a Subnet for the Disk Pool. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: Azure Resource ID of a Subnet for the Disk Pool. + * + * @param subnetId the subnetId value to set. + * @return the DiskPoolInner object itself. + */ + public DiskPoolInner withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the additionalCapabilities property: List of additional capabilities for Disk Pool. + * + * @return the additionalCapabilities value. + */ + public List additionalCapabilities() { + return this.additionalCapabilities; + } + + /** + * Set the additionalCapabilities property: List of additional capabilities for Disk Pool. + * + * @param additionalCapabilities the additionalCapabilities value to set. + * @return the DiskPoolInner object itself. + */ + public DiskPoolInner withAdditionalCapabilities(List additionalCapabilities) { + this.additionalCapabilities = additionalCapabilities; + return this; + } + + /** + * Get the nameSkuName property: Sku name. + * + * @return the nameSkuName value. + */ + public String nameSkuName() { + return this.nameSkuName; + } + + /** + * Set the nameSkuName property: Sku name. + * + * @param nameSkuName the nameSkuName value to set. + * @return the DiskPoolInner object itself. + */ + public DiskPoolInner withNameSkuName(String nameSkuName) { + this.nameSkuName = nameSkuName; + return this; + } + + /** + * Get the tier property: Sku tier. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: Sku tier. + * + * @param tier the tier value to set. + * @return the DiskPoolInner object itself. + */ + public DiskPoolInner withTier(String tier) { + this.tier = tier; + return this; + } + + /** {@inheritDoc} */ + @Override + public DiskPoolInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DiskPoolInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (systemData() != null) { + systemData().validate(); + } + if (availabilityZones() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property availabilityZones in model DiskPoolInner")); + } + if (status() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property status in model DiskPoolInner")); + } + if (disks() != null) { + disks().forEach(e -> e.validate()); + } + if (subnetId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property subnetId in model DiskPoolInner")); + } + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/DiskPoolZoneInfoInner.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/DiskPoolZoneInfoInner.java new file mode 100644 index 0000000000000..1e52e917d24f8 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/DiskPoolZoneInfoInner.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.storagepool.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagepool.models.Sku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Disk Pool Sku Details. */ +@Fluent +public final class DiskPoolZoneInfoInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskPoolZoneInfoInner.class); + + /* + * Logical zone for Disk Pool resource; example: ["1"]. + */ + @JsonProperty(value = "availabilityZones") + private List availabilityZones; + + /* + * List of additional capabilities for Disk Pool. + */ + @JsonProperty(value = "additionalCapabilities") + private List additionalCapabilities; + + /* + * Determines the SKU of VM deployed for Disk Pool + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the availabilityZones property: Logical zone for Disk Pool resource; example: ["1"]. + * + * @return the availabilityZones value. + */ + public List availabilityZones() { + return this.availabilityZones; + } + + /** + * Set the availabilityZones property: Logical zone for Disk Pool resource; example: ["1"]. + * + * @param availabilityZones the availabilityZones value to set. + * @return the DiskPoolZoneInfoInner object itself. + */ + public DiskPoolZoneInfoInner withAvailabilityZones(List availabilityZones) { + this.availabilityZones = availabilityZones; + return this; + } + + /** + * Get the additionalCapabilities property: List of additional capabilities for Disk Pool. + * + * @return the additionalCapabilities value. + */ + public List additionalCapabilities() { + return this.additionalCapabilities; + } + + /** + * Set the additionalCapabilities property: List of additional capabilities for Disk Pool. + * + * @param additionalCapabilities the additionalCapabilities value to set. + * @return the DiskPoolZoneInfoInner object itself. + */ + public DiskPoolZoneInfoInner withAdditionalCapabilities(List additionalCapabilities) { + this.additionalCapabilities = additionalCapabilities; + return this; + } + + /** + * Get the sku property: Determines the SKU of VM deployed for Disk Pool. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Determines the SKU of VM deployed for Disk Pool. + * + * @param sku the sku value to set. + * @return the DiskPoolZoneInfoInner object itself. + */ + public DiskPoolZoneInfoInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/IscsiTargetInner.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/IscsiTargetInner.java new file mode 100644 index 0000000000000..eb34089d40e2b --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/IscsiTargetInner.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagepool.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.storagepool.models.Acl; +import com.azure.resourcemanager.storagepool.models.IscsiLun; +import com.azure.resourcemanager.storagepool.models.IscsiTargetAclMode; +import com.azure.resourcemanager.storagepool.models.OperationalStatus; +import com.azure.resourcemanager.storagepool.models.ProvisioningStates; +import com.azure.resourcemanager.storagepool.models.SystemMetadata; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for iSCSI Target requests. */ +@JsonFlatten +@Fluent +public class IscsiTargetInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IscsiTargetInner.class); + + /* + * Resource metadata required by ARM RPC + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemMetadata systemData; + + /* + * Mode for Target connectivity. + */ + @JsonProperty(value = "properties.aclMode", required = true) + private IscsiTargetAclMode aclMode; + + /* + * Access Control List (ACL) for an iSCSI Target; defines LUN masking + * policy + */ + @JsonProperty(value = "properties.staticAcls") + private List staticAcls; + + /* + * List of LUNs to be exposed through iSCSI Target. + */ + @JsonProperty(value = "properties.luns") + private List luns; + + /* + * iSCSI Target IQN (iSCSI Qualified Name); example: + * "iqn.2005-03.org.iscsi:server". + */ + @JsonProperty(value = "properties.targetIqn", required = true) + private String targetIqn; + + /* + * State of the operation on the resource. + */ + @JsonProperty(value = "properties.provisioningState", required = true, access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningStates provisioningState; + + /* + * Operational status of the iSCSI Target. + */ + @JsonProperty(value = "properties.status", required = true) + private OperationalStatus status; + + /* + * List of private IPv4 addresses to connect to the iSCSI Target. + */ + @JsonProperty(value = "properties.endpoints") + private List endpoints; + + /* + * The port used by iSCSI Target portal group. + */ + @JsonProperty(value = "properties.port") + private Integer port; + + /** + * Get the systemData property: Resource metadata required by ARM RPC. + * + * @return the systemData value. + */ + public SystemMetadata systemData() { + return this.systemData; + } + + /** + * Get the aclMode property: Mode for Target connectivity. + * + * @return the aclMode value. + */ + public IscsiTargetAclMode aclMode() { + return this.aclMode; + } + + /** + * Set the aclMode property: Mode for Target connectivity. + * + * @param aclMode the aclMode value to set. + * @return the IscsiTargetInner object itself. + */ + public IscsiTargetInner withAclMode(IscsiTargetAclMode aclMode) { + this.aclMode = aclMode; + return this; + } + + /** + * Get the staticAcls property: Access Control List (ACL) for an iSCSI Target; defines LUN masking policy. + * + * @return the staticAcls value. + */ + public List staticAcls() { + return this.staticAcls; + } + + /** + * Set the staticAcls property: Access Control List (ACL) for an iSCSI Target; defines LUN masking policy. + * + * @param staticAcls the staticAcls value to set. + * @return the IscsiTargetInner object itself. + */ + public IscsiTargetInner withStaticAcls(List staticAcls) { + this.staticAcls = staticAcls; + return this; + } + + /** + * Get the luns property: List of LUNs to be exposed through iSCSI Target. + * + * @return the luns value. + */ + public List luns() { + return this.luns; + } + + /** + * Set the luns property: List of LUNs to be exposed through iSCSI Target. + * + * @param luns the luns value to set. + * @return the IscsiTargetInner object itself. + */ + public IscsiTargetInner withLuns(List luns) { + this.luns = luns; + return this; + } + + /** + * Get the targetIqn property: iSCSI Target IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:server". + * + * @return the targetIqn value. + */ + public String targetIqn() { + return this.targetIqn; + } + + /** + * Set the targetIqn property: iSCSI Target IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:server". + * + * @param targetIqn the targetIqn value to set. + * @return the IscsiTargetInner object itself. + */ + public IscsiTargetInner withTargetIqn(String targetIqn) { + this.targetIqn = targetIqn; + return this; + } + + /** + * Get the provisioningState property: State of the operation on the resource. + * + * @return the provisioningState value. + */ + public ProvisioningStates provisioningState() { + return this.provisioningState; + } + + /** + * Get the status property: Operational status of the iSCSI Target. + * + * @return the status value. + */ + public OperationalStatus status() { + return this.status; + } + + /** + * Set the status property: Operational status of the iSCSI Target. + * + * @param status the status value to set. + * @return the IscsiTargetInner object itself. + */ + public IscsiTargetInner withStatus(OperationalStatus status) { + this.status = status; + return this; + } + + /** + * Get the endpoints property: List of private IPv4 addresses to connect to the iSCSI Target. + * + * @return the endpoints value. + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints property: List of private IPv4 addresses to connect to the iSCSI Target. + * + * @param endpoints the endpoints value to set. + * @return the IscsiTargetInner object itself. + */ + public IscsiTargetInner withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get the port property: The port used by iSCSI Target portal group. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The port used by iSCSI Target portal group. + * + * @param port the port value to set. + * @return the IscsiTargetInner object itself. + */ + public IscsiTargetInner withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (systemData() != null) { + systemData().validate(); + } + if (aclMode() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property aclMode in model IscsiTargetInner")); + } + if (staticAcls() != null) { + staticAcls().forEach(e -> e.validate()); + } + if (luns() != null) { + luns().forEach(e -> e.validate()); + } + if (targetIqn() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property targetIqn in model IscsiTargetInner")); + } + if (status() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property status in model IscsiTargetInner")); + } + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/OutboundEnvironmentEndpointInner.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/OutboundEnvironmentEndpointInner.java new file mode 100644 index 0000000000000..3b7a62c19bc0c --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/OutboundEnvironmentEndpointInner.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.storagepool.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagepool.models.EndpointDependency; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Endpoints accessed for a common purpose that the App Service Environment requires outbound network access to. */ +@Fluent +public final class OutboundEnvironmentEndpointInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OutboundEnvironmentEndpointInner.class); + + /* + * The type of service accessed by the App Service Environment, e.g., Azure + * Storage, Azure SQL Database, and Azure Active Directory. + */ + @JsonProperty(value = "category") + private String category; + + /* + * The endpoints that the App Service Environment reaches the service at. + */ + @JsonProperty(value = "endpoints") + private List endpoints; + + /** + * Get the category property: The type of service accessed by the App Service Environment, e.g., Azure Storage, + * Azure SQL Database, and Azure Active Directory. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Set the category property: The type of service accessed by the App Service Environment, e.g., Azure Storage, + * Azure SQL Database, and Azure Active Directory. + * + * @param category the category value to set. + * @return the OutboundEnvironmentEndpointInner object itself. + */ + public OutboundEnvironmentEndpointInner withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get the endpoints property: The endpoints that the App Service Environment reaches the service at. + * + * @return the endpoints value. + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints property: The endpoints that the App Service Environment reaches the service at. + * + * @param endpoints the endpoints value to set. + * @return the OutboundEnvironmentEndpointInner object itself. + */ + public OutboundEnvironmentEndpointInner withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (endpoints() != null) { + endpoints().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/StoragePoolRPOperationInner.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/StoragePoolRPOperationInner.java new file mode 100644 index 0000000000000..f7cc7240298b3 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/StoragePoolRPOperationInner.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.storagepool.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagepool.models.StoragePoolOperationDisplay; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Description of a StoragePool RP Operation. */ +@Fluent +public final class StoragePoolRPOperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StoragePoolRPOperationInner.class); + + /* + * The name of the operation being performed on this particular object + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Indicates whether the operation applies to data-plane. + */ + @JsonProperty(value = "isDataAction", required = true) + private boolean isDataAction; + + /* + * Indicates the action type. + */ + @JsonProperty(value = "actionType") + private String actionType; + + /* + * Additional metadata about RP operation. + */ + @JsonProperty(value = "display", required = true) + private StoragePoolOperationDisplay display; + + /* + * The intended executor of the operation; governs the display of the + * operation in the RBAC UX and the audit logs UX. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Get the name property: The name of the operation being performed on this particular object. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the operation being performed on this particular object. + * + * @param name the name value to set. + * @return the StoragePoolRPOperationInner object itself. + */ + public StoragePoolRPOperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the isDataAction property: Indicates whether the operation applies to data-plane. + * + * @return the isDataAction value. + */ + public boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Indicates whether the operation applies to data-plane. + * + * @param isDataAction the isDataAction value to set. + * @return the StoragePoolRPOperationInner object itself. + */ + public StoragePoolRPOperationInner withIsDataAction(boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the actionType property: Indicates the action type. + * + * @return the actionType value. + */ + public String actionType() { + return this.actionType; + } + + /** + * Set the actionType property: Indicates the action type. + * + * @param actionType the actionType value to set. + * @return the StoragePoolRPOperationInner object itself. + */ + public StoragePoolRPOperationInner withActionType(String actionType) { + this.actionType = actionType; + return this; + } + + /** + * Get the display property: Additional metadata about RP operation. + * + * @return the display value. + */ + public StoragePoolOperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Additional metadata about RP operation. + * + * @param display the display value to set. + * @return the StoragePoolRPOperationInner object itself. + */ + public StoragePoolRPOperationInner withDisplay(StoragePoolOperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation; governs the display of the operation in the RBAC + * UX and the audit logs UX. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: The intended executor of the operation; governs the display of the operation in the RBAC + * UX and the audit logs UX. + * + * @param origin the origin value to set. + * @return the StoragePoolRPOperationInner object itself. + */ + public StoragePoolRPOperationInner withOrigin(String origin) { + this.origin = origin; + 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 StoragePoolRPOperationInner")); + } + if (display() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property display in model StoragePoolRPOperationInner")); + } else { + display().validate(); + } + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/package-info.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/package-info.java new file mode 100644 index 0000000000000..fef64fea33699 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/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 StoragePoolManagement. null. */ +package com.azure.resourcemanager.storagepool.fluent.models; diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/package-info.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/package-info.java new file mode 100644 index 0000000000000..af740edf24db4 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/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 StoragePoolManagement. null. */ +package com.azure.resourcemanager.storagepool.fluent; diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolImpl.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolImpl.java new file mode 100644 index 0000000000000..29ab635246a60 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolImpl.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagepool.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagepool.fluent.models.DiskPoolInner; +import com.azure.resourcemanager.storagepool.models.Disk; +import com.azure.resourcemanager.storagepool.models.DiskPool; +import com.azure.resourcemanager.storagepool.models.DiskPoolCreate; +import com.azure.resourcemanager.storagepool.models.DiskPoolUpdate; +import com.azure.resourcemanager.storagepool.models.OperationalStatus; +import com.azure.resourcemanager.storagepool.models.ProvisioningStates; +import com.azure.resourcemanager.storagepool.models.Sku; +import com.azure.resourcemanager.storagepool.models.SystemMetadata; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class DiskPoolImpl implements DiskPool, DiskPool.Definition, DiskPool.Update { + private DiskPoolInner innerObject; + + private final com.azure.resourcemanager.storagepool.StoragePoolManager 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 SystemMetadata systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningStates provisioningState() { + return this.innerModel().provisioningState(); + } + + public List availabilityZones() { + List inner = this.innerModel().availabilityZones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OperationalStatus status() { + return this.innerModel().status(); + } + + public List disks() { + List inner = this.innerModel().disks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String subnetId() { + return this.innerModel().subnetId(); + } + + public List additionalCapabilities() { + List inner = this.innerModel().additionalCapabilities(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nameSkuName() { + return this.innerModel().nameSkuName(); + } + + public String tier() { + return this.innerModel().tier(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public DiskPoolInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storagepool.StoragePoolManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String diskPoolName; + + private DiskPoolCreate createDiskPoolCreatePayload; + + private DiskPoolUpdate updateDiskPoolUpdatePayload; + + public DiskPoolImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public DiskPool create() { + this.innerObject = + serviceManager + .serviceClient() + .getDiskPools() + .createOrUpdate(resourceGroupName, diskPoolName, createDiskPoolCreatePayload, Context.NONE); + return this; + } + + public DiskPool create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDiskPools() + .createOrUpdate(resourceGroupName, diskPoolName, createDiskPoolCreatePayload, context); + return this; + } + + DiskPoolImpl(String name, com.azure.resourcemanager.storagepool.StoragePoolManager serviceManager) { + this.innerObject = new DiskPoolInner(); + this.serviceManager = serviceManager; + this.diskPoolName = name; + this.createDiskPoolCreatePayload = new DiskPoolCreate(); + } + + public DiskPoolImpl update() { + this.updateDiskPoolUpdatePayload = new DiskPoolUpdate(); + return this; + } + + public DiskPool apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDiskPools() + .update(resourceGroupName, diskPoolName, updateDiskPoolUpdatePayload, Context.NONE); + return this; + } + + public DiskPool apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDiskPools() + .update(resourceGroupName, diskPoolName, updateDiskPoolUpdatePayload, context); + return this; + } + + DiskPoolImpl(DiskPoolInner innerObject, com.azure.resourcemanager.storagepool.StoragePoolManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.diskPoolName = Utils.getValueFromIdByName(innerObject.id(), "diskPools"); + } + + public DiskPool refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDiskPools() + .getByResourceGroupWithResponse(resourceGroupName, diskPoolName, Context.NONE) + .getValue(); + return this; + } + + public DiskPool refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDiskPools() + .getByResourceGroupWithResponse(resourceGroupName, diskPoolName, context) + .getValue(); + return this; + } + + public void start() { + serviceManager.diskPools().start(resourceGroupName, diskPoolName); + } + + public void start(Context context) { + serviceManager.diskPools().start(resourceGroupName, diskPoolName, context); + } + + public void deallocate() { + serviceManager.diskPools().deallocate(resourceGroupName, diskPoolName); + } + + public void deallocate(Context context) { + serviceManager.diskPools().deallocate(resourceGroupName, diskPoolName, context); + } + + public DiskPoolImpl withRegion(Region location) { + this.createDiskPoolCreatePayload.withLocation(location.toString()); + return this; + } + + public DiskPoolImpl withRegion(String location) { + this.createDiskPoolCreatePayload.withLocation(location); + return this; + } + + public DiskPoolImpl withSku(Sku sku) { + this.createDiskPoolCreatePayload.withSku(sku); + return this; + } + + public DiskPoolImpl withSubnetId(String subnetId) { + this.createDiskPoolCreatePayload.withSubnetId(subnetId); + return this; + } + + public DiskPoolImpl withTags(Map tags) { + if (isInCreateMode()) { + this.createDiskPoolCreatePayload.withTags(tags); + return this; + } else { + this.updateDiskPoolUpdatePayload.withTags(tags); + return this; + } + } + + public DiskPoolImpl withAvailabilityZones(List availabilityZones) { + this.createDiskPoolCreatePayload.withAvailabilityZones(availabilityZones); + return this; + } + + public DiskPoolImpl withDisks(List disks) { + if (isInCreateMode()) { + this.createDiskPoolCreatePayload.withDisks(disks); + return this; + } else { + this.updateDiskPoolUpdatePayload.withDisks(disks); + return this; + } + } + + public DiskPoolImpl withAdditionalCapabilities(List additionalCapabilities) { + this.createDiskPoolCreatePayload.withAdditionalCapabilities(additionalCapabilities); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolZoneInfoImpl.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolZoneInfoImpl.java new file mode 100644 index 0000000000000..f2450215106e5 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolZoneInfoImpl.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.storagepool.implementation; + +import com.azure.resourcemanager.storagepool.fluent.models.DiskPoolZoneInfoInner; +import com.azure.resourcemanager.storagepool.models.DiskPoolZoneInfo; +import com.azure.resourcemanager.storagepool.models.Sku; +import java.util.Collections; +import java.util.List; + +public final class DiskPoolZoneInfoImpl implements DiskPoolZoneInfo { + private DiskPoolZoneInfoInner innerObject; + + private final com.azure.resourcemanager.storagepool.StoragePoolManager serviceManager; + + DiskPoolZoneInfoImpl( + DiskPoolZoneInfoInner innerObject, com.azure.resourcemanager.storagepool.StoragePoolManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List availabilityZones() { + List inner = this.innerModel().availabilityZones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List additionalCapabilities() { + List inner = this.innerModel().additionalCapabilities(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public DiskPoolZoneInfoInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storagepool.StoragePoolManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolZonesClientImpl.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolZonesClientImpl.java new file mode 100644 index 0000000000000..d38bbc1dad51f --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolZonesClientImpl.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagepool.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.storagepool.fluent.DiskPoolZonesClient; +import com.azure.resourcemanager.storagepool.fluent.models.DiskPoolZoneInfoInner; +import com.azure.resourcemanager.storagepool.models.DiskPoolZoneListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DiskPoolZonesClient. */ +public final class DiskPoolZonesClientImpl implements DiskPoolZonesClient { + private final ClientLogger logger = new ClientLogger(DiskPoolZonesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DiskPoolZonesService service; + + /** The service client containing this operation class. */ + private final StoragePoolManagementImpl client; + + /** + * Initializes an instance of DiskPoolZonesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DiskPoolZonesClientImpl(StoragePoolManagementImpl client) { + this.service = + RestProxy.create(DiskPoolZonesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StoragePoolManagementDiskPoolZones to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StoragePoolManagemen") + private interface DiskPoolZonesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.StoragePool/locations/{location}/diskPoolZones") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @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 available Disk Pool Skus in an Azure location. + * + * @param location The location of the 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 list Disk Pool skus operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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 + .list( + 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(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists available Disk Pool Skus in an Azure location. + * + * @param location The location of the 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 list Disk Pool skus operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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 + .list( + 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(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists available Disk Pool Skus in an Azure location. + * + * @param location The location of the 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 list Disk Pool skus operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists available Disk Pool Skus in an Azure location. + * + * @param location The location of the 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 list Disk Pool skus operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists available Disk Pool Skus in an Azure location. + * + * @param location The location of the 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 list Disk Pool skus operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(listAsync(location)); + } + + /** + * Lists available Disk Pool Skus in an Azure location. + * + * @param location The location of the 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 list Disk Pool skus operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(listAsync(location, 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 Disk Pool skus operation response. + */ + @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 Disk Pool skus operation response. + */ + @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/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolZonesImpl.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolZonesImpl.java new file mode 100644 index 0000000000000..c17c1e48a53b7 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolZonesImpl.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.storagepool.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.storagepool.fluent.DiskPoolZonesClient; +import com.azure.resourcemanager.storagepool.fluent.models.DiskPoolZoneInfoInner; +import com.azure.resourcemanager.storagepool.models.DiskPoolZoneInfo; +import com.azure.resourcemanager.storagepool.models.DiskPoolZones; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DiskPoolZonesImpl implements DiskPoolZones { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskPoolZonesImpl.class); + + private final DiskPoolZonesClient innerClient; + + private final com.azure.resourcemanager.storagepool.StoragePoolManager serviceManager; + + public DiskPoolZonesImpl( + DiskPoolZonesClient innerClient, com.azure.resourcemanager.storagepool.StoragePoolManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return Utils.mapPage(inner, inner1 -> new DiskPoolZoneInfoImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return Utils.mapPage(inner, inner1 -> new DiskPoolZoneInfoImpl(inner1, this.manager())); + } + + private DiskPoolZonesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storagepool.StoragePoolManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolsClientImpl.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolsClientImpl.java new file mode 100644 index 0000000000000..4e6a907aaa88e --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolsClientImpl.java @@ -0,0 +1,2318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagepool.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.storagepool.fluent.DiskPoolsClient; +import com.azure.resourcemanager.storagepool.fluent.models.DiskPoolInner; +import com.azure.resourcemanager.storagepool.fluent.models.OutboundEnvironmentEndpointInner; +import com.azure.resourcemanager.storagepool.models.DiskPoolCreate; +import com.azure.resourcemanager.storagepool.models.DiskPoolListResult; +import com.azure.resourcemanager.storagepool.models.DiskPoolUpdate; +import com.azure.resourcemanager.storagepool.models.OutboundEnvironmentEndpointList; +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 DiskPoolsClient. */ +public final class DiskPoolsClientImpl implements DiskPoolsClient { + private final ClientLogger logger = new ClientLogger(DiskPoolsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DiskPoolsService service; + + /** The service client containing this operation class. */ + private final StoragePoolManagementImpl client; + + /** + * Initializes an instance of DiskPoolsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DiskPoolsClientImpl(StoragePoolManagementImpl client) { + this.service = + RestProxy.create(DiskPoolsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StoragePoolManagementDiskPools to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StoragePoolManagemen") + private interface DiskPoolsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.StoragePool/diskPools") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool" + + "/diskPools") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool" + + "/diskPools/{diskPoolName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskPoolName") String diskPoolName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DiskPoolCreate diskPoolCreatePayload, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool" + + "/diskPools/{diskPoolName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskPoolName") String diskPoolName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DiskPoolUpdate diskPoolUpdatePayload, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool" + + "/diskPools/{diskPoolName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskPoolName") String diskPoolName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool" + + "/diskPools/{diskPoolName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskPoolName") String diskPoolName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool" + + "/diskPools/{diskPoolName}/outboundNetworkDependenciesEndpoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listOutboundNetworkDependenciesEndpoints( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskPoolName") String diskPoolName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool" + + "/diskPools/{diskPoolName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskPoolName") String diskPoolName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool" + + "/diskPools/{diskPoolName}/deallocate") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deallocate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskPoolName") String diskPoolName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$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); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listOutboundNetworkDependenciesEndpointsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of Disk Pools in a 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 a list of Disk Pools in a subscription. + */ + @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.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of Disk Pools in a 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 a list of Disk Pools in a subscription. + */ + @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.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of Disk Pools in a 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 a list of Disk Pools in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of Disk Pools in a 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 a list of Disk Pools in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of Disk Pools in a 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 a list of Disk Pools in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of Disk Pools in a 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 a list of Disk Pools in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets a list of DiskPools in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of DiskPools in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of DiskPools in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of DiskPools in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of DiskPools in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of DiskPools in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of DiskPools in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of DiskPools in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of DiskPools in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of DiskPools in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets a list of DiskPools in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of DiskPools in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Create or Update Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolCreatePayload Request payload for Disk Pool create operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null.")); + } + if (diskPoolCreatePayload == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskPoolCreatePayload is required and cannot be null.")); + } else { + diskPoolCreatePayload.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskPoolName, + this.client.getApiVersion(), + diskPoolCreatePayload, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or Update Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolCreatePayload Request payload for Disk Pool create operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null.")); + } + if (diskPoolCreatePayload == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskPoolCreatePayload is required and cannot be null.")); + } else { + diskPoolCreatePayload.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskPoolName, + this.client.getApiVersion(), + diskPoolCreatePayload, + accept, + context); + } + + /** + * Create or Update Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolCreatePayload Request payload for Disk Pool create operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DiskPoolInner> beginCreateOrUpdateAsync( + String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, diskPoolName, diskPoolCreatePayload); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DiskPoolInner.class, DiskPoolInner.class, Context.NONE); + } + + /** + * Create or Update Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolCreatePayload Request payload for Disk Pool create operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DiskPoolInner> beginCreateOrUpdateAsync( + String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, diskPoolName, diskPoolCreatePayload, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DiskPoolInner.class, DiskPoolInner.class, context); + } + + /** + * Create or Update Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolCreatePayload Request payload for Disk Pool create operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DiskPoolInner> beginCreateOrUpdate( + String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload) { + return beginCreateOrUpdateAsync(resourceGroupName, diskPoolName, diskPoolCreatePayload).getSyncPoller(); + } + + /** + * Create or Update Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolCreatePayload Request payload for Disk Pool create operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DiskPoolInner> beginCreateOrUpdate( + String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, diskPoolName, diskPoolCreatePayload, context) + .getSyncPoller(); + } + + /** + * Create or Update Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolCreatePayload Request payload for Disk Pool create operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload) { + return beginCreateOrUpdateAsync(resourceGroupName, diskPoolName, diskPoolCreatePayload) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolCreatePayload Request payload for Disk Pool create operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, diskPoolName, diskPoolCreatePayload, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolCreatePayload Request payload for Disk Pool create operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskPoolInner createOrUpdate( + String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload) { + return createOrUpdateAsync(resourceGroupName, diskPoolName, diskPoolCreatePayload).block(); + } + + /** + * Create or Update Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolCreatePayload Request payload for Disk Pool create operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskPoolInner createOrUpdate( + String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload, Context context) { + return createOrUpdateAsync(resourceGroupName, diskPoolName, diskPoolCreatePayload, context).block(); + } + + /** + * Update a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolUpdatePayload Request payload for Disk Pool update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null.")); + } + if (diskPoolUpdatePayload == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskPoolUpdatePayload is required and cannot be null.")); + } else { + diskPoolUpdatePayload.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskPoolName, + this.client.getApiVersion(), + diskPoolUpdatePayload, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolUpdatePayload Request payload for Disk Pool update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null.")); + } + if (diskPoolUpdatePayload == null) { + return Mono + .error(new IllegalArgumentException("Parameter diskPoolUpdatePayload is required and cannot be null.")); + } else { + diskPoolUpdatePayload.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskPoolName, + this.client.getApiVersion(), + diskPoolUpdatePayload, + accept, + context); + } + + /** + * Update a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolUpdatePayload Request payload for Disk Pool update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DiskPoolInner> beginUpdateAsync( + String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, diskPoolName, diskPoolUpdatePayload); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DiskPoolInner.class, DiskPoolInner.class, Context.NONE); + } + + /** + * Update a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolUpdatePayload Request payload for Disk Pool update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DiskPoolInner> beginUpdateAsync( + String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, diskPoolName, diskPoolUpdatePayload, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DiskPoolInner.class, DiskPoolInner.class, context); + } + + /** + * Update a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolUpdatePayload Request payload for Disk Pool update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DiskPoolInner> beginUpdate( + String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload) { + return beginUpdateAsync(resourceGroupName, diskPoolName, diskPoolUpdatePayload).getSyncPoller(); + } + + /** + * Update a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolUpdatePayload Request payload for Disk Pool update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DiskPoolInner> beginUpdate( + String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload, Context context) { + return beginUpdateAsync(resourceGroupName, diskPoolName, diskPoolUpdatePayload, context).getSyncPoller(); + } + + /** + * Update a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolUpdatePayload Request payload for Disk Pool update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload) { + return beginUpdateAsync(resourceGroupName, diskPoolName, diskPoolUpdatePayload) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolUpdatePayload Request payload for Disk Pool update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload, Context context) { + return beginUpdateAsync(resourceGroupName, diskPoolName, diskPoolUpdatePayload, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolUpdatePayload Request payload for Disk Pool update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskPoolInner update(String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload) { + return updateAsync(resourceGroupName, diskPoolName, diskPoolUpdatePayload).block(); + } + + /** + * Update a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param diskPoolUpdatePayload Request payload for Disk Pool update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for Disk Pool request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskPoolInner update( + String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload, Context context) { + return updateAsync(resourceGroupName, diskPoolName, diskPoolUpdatePayload, context).block(); + } + + /** + * Delete a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 diskPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskPoolName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 diskPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskPoolName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDeleteAsync(String resourceGroupName, String diskPoolName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, diskPoolName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDeleteAsync( + String resourceGroupName, String diskPoolName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, diskPoolName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDelete(String resourceGroupName, String diskPoolName) { + return beginDeleteAsync(resourceGroupName, diskPoolName).getSyncPoller(); + } + + /** + * Delete a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDelete( + String resourceGroupName, String diskPoolName, Context context) { + return beginDeleteAsync(resourceGroupName, diskPoolName, context).getSyncPoller(); + } + + /** + * Delete a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 diskPoolName) { + return beginDeleteAsync(resourceGroupName, diskPoolName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 diskPoolName, Context context) { + return beginDeleteAsync(resourceGroupName, diskPoolName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 diskPoolName) { + deleteAsync(resourceGroupName, diskPoolName).block(); + } + + /** + * Delete a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 diskPoolName, Context context) { + deleteAsync(resourceGroupName, diskPoolName, context).block(); + } + + /** + * Get a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Disk pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String diskPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskPoolName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Disk pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String diskPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskPoolName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Disk pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String diskPoolName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, diskPoolName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Disk pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DiskPoolInner getByResourceGroup(String resourceGroupName, String diskPoolName) { + return getByResourceGroupAsync(resourceGroupName, diskPoolName).block(); + } + + /** + * Get a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Disk pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String diskPoolName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, diskPoolName, context).block(); + } + + /** + * Gets the network endpoints of all outbound dependencies of a Disk Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network endpoints of all outbound dependencies of a Disk Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listOutboundNetworkDependenciesEndpointsSinglePageAsync(String resourceGroupName, String diskPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listOutboundNetworkDependenciesEndpoints( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskPoolName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the network endpoints of all outbound dependencies of a Disk Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network endpoints of all outbound dependencies of a Disk Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listOutboundNetworkDependenciesEndpointsSinglePageAsync( + String resourceGroupName, String diskPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listOutboundNetworkDependenciesEndpoints( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskPoolName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the network endpoints of all outbound dependencies of a Disk Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network endpoints of all outbound dependencies of a Disk Pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listOutboundNetworkDependenciesEndpointsAsync( + String resourceGroupName, String diskPoolName) { + return new PagedFlux<>( + () -> listOutboundNetworkDependenciesEndpointsSinglePageAsync(resourceGroupName, diskPoolName), + nextLink -> listOutboundNetworkDependenciesEndpointsNextSinglePageAsync(nextLink)); + } + + /** + * Gets the network endpoints of all outbound dependencies of a Disk Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network endpoints of all outbound dependencies of a Disk Pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listOutboundNetworkDependenciesEndpointsAsync( + String resourceGroupName, String diskPoolName, Context context) { + return new PagedFlux<>( + () -> listOutboundNetworkDependenciesEndpointsSinglePageAsync(resourceGroupName, diskPoolName, context), + nextLink -> listOutboundNetworkDependenciesEndpointsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the network endpoints of all outbound dependencies of a Disk Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network endpoints of all outbound dependencies of a Disk Pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOutboundNetworkDependenciesEndpoints( + String resourceGroupName, String diskPoolName) { + return new PagedIterable<>(listOutboundNetworkDependenciesEndpointsAsync(resourceGroupName, diskPoolName)); + } + + /** + * Gets the network endpoints of all outbound dependencies of a Disk Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network endpoints of all outbound dependencies of a Disk Pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOutboundNetworkDependenciesEndpoints( + String resourceGroupName, String diskPoolName, Context context) { + return new PagedIterable<>( + listOutboundNetworkDependenciesEndpointsAsync(resourceGroupName, diskPoolName, context)); + } + + /** + * The operation to start a Disk Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> startWithResponseAsync(String resourceGroupName, String diskPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskPoolName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to start a Disk Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> startWithResponseAsync( + String resourceGroupName, String diskPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskPoolName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * The operation to start a Disk Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginStartAsync(String resourceGroupName, String diskPoolName) { + Mono>> mono = startWithResponseAsync(resourceGroupName, diskPoolName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * The operation to start a Disk Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginStartAsync( + String resourceGroupName, String diskPoolName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = startWithResponseAsync(resourceGroupName, diskPoolName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to start a Disk Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginStart(String resourceGroupName, String diskPoolName) { + return beginStartAsync(resourceGroupName, diskPoolName).getSyncPoller(); + } + + /** + * The operation to start a Disk Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginStart( + String resourceGroupName, String diskPoolName, Context context) { + return beginStartAsync(resourceGroupName, diskPoolName, context).getSyncPoller(); + } + + /** + * The operation to start a Disk Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 startAsync(String resourceGroupName, String diskPoolName) { + return beginStartAsync(resourceGroupName, diskPoolName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to start a Disk Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 startAsync(String resourceGroupName, String diskPoolName, Context context) { + return beginStartAsync(resourceGroupName, diskPoolName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to start a Disk Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 start(String resourceGroupName, String diskPoolName) { + startAsync(resourceGroupName, diskPoolName).block(); + } + + /** + * The operation to start a Disk Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 start(String resourceGroupName, String diskPoolName, Context context) { + startAsync(resourceGroupName, diskPoolName, context).block(); + } + + /** + * Shuts down the Disk Pool and releases the compute resources. You are not billed for the compute resources that + * this Disk Pool uses. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> deallocateWithResponseAsync( + String resourceGroupName, String diskPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deallocate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskPoolName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Shuts down the Disk Pool and releases the compute resources. You are not billed for the compute resources that + * this Disk Pool uses. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> deallocateWithResponseAsync( + String resourceGroupName, String diskPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deallocate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskPoolName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Shuts down the Disk Pool and releases the compute resources. You are not billed for the compute resources that + * this Disk Pool uses. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDeallocateAsync(String resourceGroupName, String diskPoolName) { + Mono>> mono = deallocateWithResponseAsync(resourceGroupName, diskPoolName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Shuts down the Disk Pool and releases the compute resources. You are not billed for the compute resources that + * this Disk Pool uses. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDeallocateAsync( + String resourceGroupName, String diskPoolName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deallocateWithResponseAsync(resourceGroupName, diskPoolName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Shuts down the Disk Pool and releases the compute resources. You are not billed for the compute resources that + * this Disk Pool uses. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDeallocate(String resourceGroupName, String diskPoolName) { + return beginDeallocateAsync(resourceGroupName, diskPoolName).getSyncPoller(); + } + + /** + * Shuts down the Disk Pool and releases the compute resources. You are not billed for the compute resources that + * this Disk Pool uses. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDeallocate( + String resourceGroupName, String diskPoolName, Context context) { + return beginDeallocateAsync(resourceGroupName, diskPoolName, context).getSyncPoller(); + } + + /** + * Shuts down the Disk Pool and releases the compute resources. You are not billed for the compute resources that + * this Disk Pool uses. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deallocateAsync(String resourceGroupName, String diskPoolName) { + return beginDeallocateAsync(resourceGroupName, diskPoolName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Shuts down the Disk Pool and releases the compute resources. You are not billed for the compute resources that + * this Disk Pool uses. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deallocateAsync(String resourceGroupName, String diskPoolName, Context context) { + return beginDeallocateAsync(resourceGroupName, diskPoolName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Shuts down the Disk Pool and releases the compute resources. You are not billed for the compute resources that + * this Disk Pool uses. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deallocate(String resourceGroupName, String diskPoolName) { + deallocateAsync(resourceGroupName, diskPoolName).block(); + } + + /** + * Shuts down the Disk Pool and releases the compute resources. You are not billed for the compute resources that + * this Disk Pool uses. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deallocate(String resourceGroupName, String diskPoolName, Context context) { + deallocateAsync(resourceGroupName, diskPoolName, 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 list of Disk Pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 Disk Pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 Disk Pools. + */ + @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 list of Disk Pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 collection of Outbound Environment Endpoints. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listOutboundNetworkDependenciesEndpointsNextSinglePageAsync(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 + .listOutboundNetworkDependenciesEndpointsNext( + 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 collection of Outbound Environment Endpoints. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listOutboundNetworkDependenciesEndpointsNextSinglePageAsync(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 + .listOutboundNetworkDependenciesEndpointsNext(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/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolsImpl.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolsImpl.java new file mode 100644 index 0000000000000..31895fb9e93f2 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolsImpl.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagepool.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.storagepool.fluent.DiskPoolsClient; +import com.azure.resourcemanager.storagepool.fluent.models.DiskPoolInner; +import com.azure.resourcemanager.storagepool.fluent.models.OutboundEnvironmentEndpointInner; +import com.azure.resourcemanager.storagepool.models.DiskPool; +import com.azure.resourcemanager.storagepool.models.DiskPools; +import com.azure.resourcemanager.storagepool.models.OutboundEnvironmentEndpoint; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DiskPoolsImpl implements DiskPools { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskPoolsImpl.class); + + private final DiskPoolsClient innerClient; + + private final com.azure.resourcemanager.storagepool.StoragePoolManager serviceManager; + + public DiskPoolsImpl( + DiskPoolsClient innerClient, com.azure.resourcemanager.storagepool.StoragePoolManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new DiskPoolImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new DiskPoolImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new DiskPoolImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new DiskPoolImpl(inner1, this.manager())); + } + + public void deleteByResourceGroup(String resourceGroupName, String diskPoolName) { + this.serviceClient().delete(resourceGroupName, diskPoolName); + } + + public void delete(String resourceGroupName, String diskPoolName, Context context) { + this.serviceClient().delete(resourceGroupName, diskPoolName, context); + } + + public DiskPool getByResourceGroup(String resourceGroupName, String diskPoolName) { + DiskPoolInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, diskPoolName); + if (inner != null) { + return new DiskPoolImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String diskPoolName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, diskPoolName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DiskPoolImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listOutboundNetworkDependenciesEndpoints( + String resourceGroupName, String diskPoolName) { + PagedIterable inner = + this.serviceClient().listOutboundNetworkDependenciesEndpoints(resourceGroupName, diskPoolName); + return Utils.mapPage(inner, inner1 -> new OutboundEnvironmentEndpointImpl(inner1, this.manager())); + } + + public PagedIterable listOutboundNetworkDependenciesEndpoints( + String resourceGroupName, String diskPoolName, Context context) { + PagedIterable inner = + this.serviceClient().listOutboundNetworkDependenciesEndpoints(resourceGroupName, diskPoolName, context); + return Utils.mapPage(inner, inner1 -> new OutboundEnvironmentEndpointImpl(inner1, this.manager())); + } + + public void start(String resourceGroupName, String diskPoolName) { + this.serviceClient().start(resourceGroupName, diskPoolName); + } + + public void start(String resourceGroupName, String diskPoolName, Context context) { + this.serviceClient().start(resourceGroupName, diskPoolName, context); + } + + public void deallocate(String resourceGroupName, String diskPoolName) { + this.serviceClient().deallocate(resourceGroupName, diskPoolName); + } + + public void deallocate(String resourceGroupName, String diskPoolName, Context context) { + this.serviceClient().deallocate(resourceGroupName, diskPoolName, context); + } + + public DiskPool 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 diskPoolName = Utils.getValueFromIdByName(id, "diskPools"); + if (diskPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'diskPools'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, diskPoolName, 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 diskPoolName = Utils.getValueFromIdByName(id, "diskPools"); + if (diskPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'diskPools'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, diskPoolName, 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 diskPoolName = Utils.getValueFromIdByName(id, "diskPools"); + if (diskPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'diskPools'.", id))); + } + this.delete(resourceGroupName, diskPoolName, Context.NONE); + } + + public void 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 diskPoolName = Utils.getValueFromIdByName(id, "diskPools"); + if (diskPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'diskPools'.", id))); + } + this.delete(resourceGroupName, diskPoolName, context); + } + + private DiskPoolsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storagepool.StoragePoolManager manager() { + return this.serviceManager; + } + + public DiskPoolImpl define(String name) { + return new DiskPoolImpl(name, this.manager()); + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/IscsiTargetImpl.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/IscsiTargetImpl.java new file mode 100644 index 0000000000000..2598428a40601 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/IscsiTargetImpl.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagepool.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagepool.fluent.models.IscsiTargetInner; +import com.azure.resourcemanager.storagepool.models.Acl; +import com.azure.resourcemanager.storagepool.models.IscsiLun; +import com.azure.resourcemanager.storagepool.models.IscsiTarget; +import com.azure.resourcemanager.storagepool.models.IscsiTargetAclMode; +import com.azure.resourcemanager.storagepool.models.IscsiTargetCreate; +import com.azure.resourcemanager.storagepool.models.IscsiTargetUpdate; +import com.azure.resourcemanager.storagepool.models.OperationalStatus; +import com.azure.resourcemanager.storagepool.models.ProvisioningStates; +import com.azure.resourcemanager.storagepool.models.SystemMetadata; +import java.util.Collections; +import java.util.List; + +public final class IscsiTargetImpl implements IscsiTarget, IscsiTarget.Definition, IscsiTarget.Update { + private IscsiTargetInner innerObject; + + private final com.azure.resourcemanager.storagepool.StoragePoolManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemMetadata systemData() { + return this.innerModel().systemData(); + } + + public IscsiTargetAclMode aclMode() { + return this.innerModel().aclMode(); + } + + public List staticAcls() { + List inner = this.innerModel().staticAcls(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List luns() { + List inner = this.innerModel().luns(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String targetIqn() { + return this.innerModel().targetIqn(); + } + + public ProvisioningStates provisioningState() { + return this.innerModel().provisioningState(); + } + + public OperationalStatus status() { + return this.innerModel().status(); + } + + public List endpoints() { + List inner = this.innerModel().endpoints(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Integer port() { + return this.innerModel().port(); + } + + public IscsiTargetInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storagepool.StoragePoolManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String diskPoolName; + + private String iscsiTargetName; + + private IscsiTargetCreate createIscsiTargetCreatePayload; + + private IscsiTargetUpdate updateIscsiTargetUpdatePayload; + + public IscsiTargetImpl withExistingDiskPool(String resourceGroupName, String diskPoolName) { + this.resourceGroupName = resourceGroupName; + this.diskPoolName = diskPoolName; + return this; + } + + public IscsiTarget create() { + this.innerObject = + serviceManager + .serviceClient() + .getIscsiTargets() + .createOrUpdate( + resourceGroupName, diskPoolName, iscsiTargetName, createIscsiTargetCreatePayload, Context.NONE); + return this; + } + + public IscsiTarget create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIscsiTargets() + .createOrUpdate( + resourceGroupName, diskPoolName, iscsiTargetName, createIscsiTargetCreatePayload, context); + return this; + } + + IscsiTargetImpl(String name, com.azure.resourcemanager.storagepool.StoragePoolManager serviceManager) { + this.innerObject = new IscsiTargetInner(); + this.serviceManager = serviceManager; + this.iscsiTargetName = name; + this.createIscsiTargetCreatePayload = new IscsiTargetCreate(); + } + + public IscsiTargetImpl update() { + this.updateIscsiTargetUpdatePayload = new IscsiTargetUpdate(); + return this; + } + + public IscsiTarget apply() { + this.innerObject = + serviceManager + .serviceClient() + .getIscsiTargets() + .update(resourceGroupName, diskPoolName, iscsiTargetName, updateIscsiTargetUpdatePayload, Context.NONE); + return this; + } + + public IscsiTarget apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIscsiTargets() + .update(resourceGroupName, diskPoolName, iscsiTargetName, updateIscsiTargetUpdatePayload, context); + return this; + } + + IscsiTargetImpl( + IscsiTargetInner innerObject, com.azure.resourcemanager.storagepool.StoragePoolManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.diskPoolName = Utils.getValueFromIdByName(innerObject.id(), "diskPools"); + this.iscsiTargetName = Utils.getValueFromIdByName(innerObject.id(), "iscsiTargets"); + } + + public IscsiTarget refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getIscsiTargets() + .getWithResponse(resourceGroupName, diskPoolName, iscsiTargetName, Context.NONE) + .getValue(); + return this; + } + + public IscsiTarget refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIscsiTargets() + .getWithResponse(resourceGroupName, diskPoolName, iscsiTargetName, context) + .getValue(); + return this; + } + + public IscsiTargetImpl withAclMode(IscsiTargetAclMode aclMode) { + this.createIscsiTargetCreatePayload.withAclMode(aclMode); + return this; + } + + public IscsiTargetImpl withTargetIqn(String targetIqn) { + this.createIscsiTargetCreatePayload.withTargetIqn(targetIqn); + return this; + } + + public IscsiTargetImpl withStaticAcls(List staticAcls) { + if (isInCreateMode()) { + this.createIscsiTargetCreatePayload.withStaticAcls(staticAcls); + return this; + } else { + this.updateIscsiTargetUpdatePayload.withStaticAcls(staticAcls); + return this; + } + } + + public IscsiTargetImpl withLuns(List luns) { + if (isInCreateMode()) { + this.createIscsiTargetCreatePayload.withLuns(luns); + return this; + } else { + this.updateIscsiTargetUpdatePayload.withLuns(luns); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/IscsiTargetsClientImpl.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/IscsiTargetsClientImpl.java new file mode 100644 index 0000000000000..c19621693d3bc --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/IscsiTargetsClientImpl.java @@ -0,0 +1,1486 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagepool.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.storagepool.fluent.IscsiTargetsClient; +import com.azure.resourcemanager.storagepool.fluent.models.IscsiTargetInner; +import com.azure.resourcemanager.storagepool.models.IscsiTargetCreate; +import com.azure.resourcemanager.storagepool.models.IscsiTargetList; +import com.azure.resourcemanager.storagepool.models.IscsiTargetUpdate; +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 IscsiTargetsClient. */ +public final class IscsiTargetsClientImpl implements IscsiTargetsClient { + private final ClientLogger logger = new ClientLogger(IscsiTargetsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final IscsiTargetsService service; + + /** The service client containing this operation class. */ + private final StoragePoolManagementImpl client; + + /** + * Initializes an instance of IscsiTargetsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IscsiTargetsClientImpl(StoragePoolManagementImpl client) { + this.service = + RestProxy.create(IscsiTargetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StoragePoolManagementIscsiTargets to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StoragePoolManagemen") + private interface IscsiTargetsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool" + + "/diskPools/{diskPoolName}/iscsiTargets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDiskPool( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskPoolName") String diskPoolName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool" + + "/diskPools/{diskPoolName}/iscsiTargets/{iscsiTargetName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskPoolName") String diskPoolName, + @PathParam("iscsiTargetName") String iscsiTargetName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") IscsiTargetCreate iscsiTargetCreatePayload, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool" + + "/diskPools/{diskPoolName}/iscsiTargets/{iscsiTargetName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskPoolName") String diskPoolName, + @PathParam("iscsiTargetName") String iscsiTargetName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") IscsiTargetUpdate iscsiTargetUpdatePayload, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool" + + "/diskPools/{diskPoolName}/iscsiTargets/{iscsiTargetName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskPoolName") String diskPoolName, + @PathParam("iscsiTargetName") String iscsiTargetName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool" + + "/diskPools/{diskPoolName}/iscsiTargets/{iscsiTargetName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("diskPoolName") String diskPoolName, + @PathParam("iscsiTargetName") String iscsiTargetName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDiskPoolNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get iSCSI Targets in a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return iSCSI Targets in a Disk pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDiskPoolSinglePageAsync( + String resourceGroupName, String diskPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByDiskPool( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskPoolName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get iSCSI Targets in a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return iSCSI Targets in a Disk pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDiskPoolSinglePageAsync( + String resourceGroupName, String diskPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByDiskPool( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskPoolName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get iSCSI Targets in a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return iSCSI Targets in a Disk pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDiskPoolAsync(String resourceGroupName, String diskPoolName) { + return new PagedFlux<>( + () -> listByDiskPoolSinglePageAsync(resourceGroupName, diskPoolName), + nextLink -> listByDiskPoolNextSinglePageAsync(nextLink)); + } + + /** + * Get iSCSI Targets in a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return iSCSI Targets in a Disk pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDiskPoolAsync( + String resourceGroupName, String diskPoolName, Context context) { + return new PagedFlux<>( + () -> listByDiskPoolSinglePageAsync(resourceGroupName, diskPoolName, context), + nextLink -> listByDiskPoolNextSinglePageAsync(nextLink, context)); + } + + /** + * Get iSCSI Targets in a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return iSCSI Targets in a Disk pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDiskPool(String resourceGroupName, String diskPoolName) { + return new PagedIterable<>(listByDiskPoolAsync(resourceGroupName, diskPoolName)); + } + + /** + * Get iSCSI Targets in a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return iSCSI Targets in a Disk pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDiskPool( + String resourceGroupName, String diskPoolName, Context context) { + return new PagedIterable<>(listByDiskPoolAsync(resourceGroupName, diskPoolName, context)); + } + + /** + * Create or Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetCreatePayload Request payload for iSCSI Target create operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetCreate iscsiTargetCreatePayload) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null.")); + } + if (iscsiTargetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter iscsiTargetName is required and cannot be null.")); + } + if (iscsiTargetCreatePayload == null) { + return Mono + .error( + new IllegalArgumentException("Parameter iscsiTargetCreatePayload is required and cannot be null.")); + } else { + iscsiTargetCreatePayload.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskPoolName, + iscsiTargetName, + this.client.getApiVersion(), + iscsiTargetCreatePayload, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetCreatePayload Request payload for iSCSI Target create operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetCreate iscsiTargetCreatePayload, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null.")); + } + if (iscsiTargetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter iscsiTargetName is required and cannot be null.")); + } + if (iscsiTargetCreatePayload == null) { + return Mono + .error( + new IllegalArgumentException("Parameter iscsiTargetCreatePayload is required and cannot be null.")); + } else { + iscsiTargetCreatePayload.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskPoolName, + iscsiTargetName, + this.client.getApiVersion(), + iscsiTargetCreatePayload, + accept, + context); + } + + /** + * Create or Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetCreatePayload Request payload for iSCSI Target create operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, IscsiTargetInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetCreate iscsiTargetCreatePayload) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetCreatePayload); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), IscsiTargetInner.class, IscsiTargetInner.class, Context.NONE); + } + + /** + * Create or Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetCreatePayload Request payload for iSCSI Target create operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, IscsiTargetInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetCreate iscsiTargetCreatePayload, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetCreatePayload, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), IscsiTargetInner.class, IscsiTargetInner.class, context); + } + + /** + * Create or Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetCreatePayload Request payload for iSCSI Target create operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, IscsiTargetInner> beginCreateOrUpdate( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetCreate iscsiTargetCreatePayload) { + return beginCreateOrUpdateAsync(resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetCreatePayload) + .getSyncPoller(); + } + + /** + * Create or Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetCreatePayload Request payload for iSCSI Target create operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, IscsiTargetInner> beginCreateOrUpdate( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetCreate iscsiTargetCreatePayload, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetCreatePayload, context) + .getSyncPoller(); + } + + /** + * Create or Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetCreatePayload Request payload for iSCSI Target create operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetCreate iscsiTargetCreatePayload) { + return beginCreateOrUpdateAsync(resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetCreatePayload) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetCreatePayload Request payload for iSCSI Target create operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetCreate iscsiTargetCreatePayload, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetCreatePayload, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetCreatePayload Request payload for iSCSI Target create operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IscsiTargetInner createOrUpdate( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetCreate iscsiTargetCreatePayload) { + return createOrUpdateAsync(resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetCreatePayload).block(); + } + + /** + * Create or Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetCreatePayload Request payload for iSCSI Target create operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IscsiTargetInner createOrUpdate( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetCreate iscsiTargetCreatePayload, + Context context) { + return createOrUpdateAsync(resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetCreatePayload, context) + .block(); + } + + /** + * Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetUpdatePayload Request payload for iSCSI Target update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetUpdate iscsiTargetUpdatePayload) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null.")); + } + if (iscsiTargetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter iscsiTargetName is required and cannot be null.")); + } + if (iscsiTargetUpdatePayload == null) { + return Mono + .error( + new IllegalArgumentException("Parameter iscsiTargetUpdatePayload is required and cannot be null.")); + } else { + iscsiTargetUpdatePayload.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskPoolName, + iscsiTargetName, + this.client.getApiVersion(), + iscsiTargetUpdatePayload, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetUpdatePayload Request payload for iSCSI Target update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetUpdate iscsiTargetUpdatePayload, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null.")); + } + if (iscsiTargetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter iscsiTargetName is required and cannot be null.")); + } + if (iscsiTargetUpdatePayload == null) { + return Mono + .error( + new IllegalArgumentException("Parameter iscsiTargetUpdatePayload is required and cannot be null.")); + } else { + iscsiTargetUpdatePayload.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskPoolName, + iscsiTargetName, + this.client.getApiVersion(), + iscsiTargetUpdatePayload, + accept, + context); + } + + /** + * Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetUpdatePayload Request payload for iSCSI Target update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, IscsiTargetInner> beginUpdateAsync( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetUpdate iscsiTargetUpdatePayload) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetUpdatePayload); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), IscsiTargetInner.class, IscsiTargetInner.class, Context.NONE); + } + + /** + * Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetUpdatePayload Request payload for iSCSI Target update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, IscsiTargetInner> beginUpdateAsync( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetUpdate iscsiTargetUpdatePayload, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetUpdatePayload, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), IscsiTargetInner.class, IscsiTargetInner.class, context); + } + + /** + * Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetUpdatePayload Request payload for iSCSI Target update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, IscsiTargetInner> beginUpdate( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetUpdate iscsiTargetUpdatePayload) { + return beginUpdateAsync(resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetUpdatePayload) + .getSyncPoller(); + } + + /** + * Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetUpdatePayload Request payload for iSCSI Target update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, IscsiTargetInner> beginUpdate( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetUpdate iscsiTargetUpdatePayload, + Context context) { + return beginUpdateAsync(resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetUpdatePayload, context) + .getSyncPoller(); + } + + /** + * Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetUpdatePayload Request payload for iSCSI Target update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetUpdate iscsiTargetUpdatePayload) { + return beginUpdateAsync(resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetUpdatePayload) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetUpdatePayload Request payload for iSCSI Target update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetUpdate iscsiTargetUpdatePayload, + Context context) { + return beginUpdateAsync(resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetUpdatePayload, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetUpdatePayload Request payload for iSCSI Target update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IscsiTargetInner update( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetUpdate iscsiTargetUpdatePayload) { + return updateAsync(resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetUpdatePayload).block(); + } + + /** + * Update an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param iscsiTargetUpdatePayload Request payload for iSCSI Target update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 for iSCSI Target requests. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IscsiTargetInner update( + String resourceGroupName, + String diskPoolName, + String iscsiTargetName, + IscsiTargetUpdate iscsiTargetUpdatePayload, + Context context) { + return updateAsync(resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetUpdatePayload, context).block(); + } + + /** + * Delete an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 diskPoolName, String iscsiTargetName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null.")); + } + if (iscsiTargetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter iscsiTargetName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskPoolName, + iscsiTargetName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 diskPoolName, String iscsiTargetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null.")); + } + if (iscsiTargetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter iscsiTargetName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskPoolName, + iscsiTargetName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDeleteAsync( + String resourceGroupName, String diskPoolName, String iscsiTargetName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, diskPoolName, iscsiTargetName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDeleteAsync( + String resourceGroupName, String diskPoolName, String iscsiTargetName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, diskPoolName, iscsiTargetName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDelete( + String resourceGroupName, String diskPoolName, String iscsiTargetName) { + return beginDeleteAsync(resourceGroupName, diskPoolName, iscsiTargetName).getSyncPoller(); + } + + /** + * Delete an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDelete( + String resourceGroupName, String diskPoolName, String iscsiTargetName, Context context) { + return beginDeleteAsync(resourceGroupName, diskPoolName, iscsiTargetName, context).getSyncPoller(); + } + + /** + * Delete an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 diskPoolName, String iscsiTargetName) { + return beginDeleteAsync(resourceGroupName, diskPoolName, iscsiTargetName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 diskPoolName, String iscsiTargetName, Context context) { + return beginDeleteAsync(resourceGroupName, diskPoolName, iscsiTargetName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 diskPoolName, String iscsiTargetName) { + deleteAsync(resourceGroupName, diskPoolName, iscsiTargetName).block(); + } + + /** + * Delete an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 diskPoolName, String iscsiTargetName, Context context) { + deleteAsync(resourceGroupName, diskPoolName, iscsiTargetName, context).block(); + } + + /** + * Get an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an iSCSI Target. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String diskPoolName, String iscsiTargetName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null.")); + } + if (iscsiTargetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter iscsiTargetName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskPoolName, + iscsiTargetName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an iSCSI Target. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String diskPoolName, String iscsiTargetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (diskPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null.")); + } + if (iscsiTargetName == null) { + return Mono + .error(new IllegalArgumentException("Parameter iscsiTargetName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + diskPoolName, + iscsiTargetName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an iSCSI Target. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String diskPoolName, String iscsiTargetName) { + return getWithResponseAsync(resourceGroupName, diskPoolName, iscsiTargetName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an iSCSI Target. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IscsiTargetInner get(String resourceGroupName, String diskPoolName, String iscsiTargetName) { + return getAsync(resourceGroupName, diskPoolName, iscsiTargetName).block(); + } + + /** + * Get an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an iSCSI Target. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String diskPoolName, String iscsiTargetName, Context context) { + return getWithResponseAsync(resourceGroupName, diskPoolName, iscsiTargetName, 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 list of iSCSI Targets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDiskPoolNextSinglePageAsync(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.listByDiskPoolNext(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 iSCSI Targets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDiskPoolNextSinglePageAsync(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 + .listByDiskPoolNext(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/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/IscsiTargetsImpl.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/IscsiTargetsImpl.java new file mode 100644 index 0000000000000..fd07f3f89fcd7 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/IscsiTargetsImpl.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagepool.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.storagepool.fluent.IscsiTargetsClient; +import com.azure.resourcemanager.storagepool.fluent.models.IscsiTargetInner; +import com.azure.resourcemanager.storagepool.models.IscsiTarget; +import com.azure.resourcemanager.storagepool.models.IscsiTargets; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class IscsiTargetsImpl implements IscsiTargets { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IscsiTargetsImpl.class); + + private final IscsiTargetsClient innerClient; + + private final com.azure.resourcemanager.storagepool.StoragePoolManager serviceManager; + + public IscsiTargetsImpl( + IscsiTargetsClient innerClient, com.azure.resourcemanager.storagepool.StoragePoolManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByDiskPool(String resourceGroupName, String diskPoolName) { + PagedIterable inner = this.serviceClient().listByDiskPool(resourceGroupName, diskPoolName); + return Utils.mapPage(inner, inner1 -> new IscsiTargetImpl(inner1, this.manager())); + } + + public PagedIterable listByDiskPool(String resourceGroupName, String diskPoolName, Context context) { + PagedIterable inner = + this.serviceClient().listByDiskPool(resourceGroupName, diskPoolName, context); + return Utils.mapPage(inner, inner1 -> new IscsiTargetImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String diskPoolName, String iscsiTargetName) { + this.serviceClient().delete(resourceGroupName, diskPoolName, iscsiTargetName); + } + + public void delete(String resourceGroupName, String diskPoolName, String iscsiTargetName, Context context) { + this.serviceClient().delete(resourceGroupName, diskPoolName, iscsiTargetName, context); + } + + public IscsiTarget get(String resourceGroupName, String diskPoolName, String iscsiTargetName) { + IscsiTargetInner inner = this.serviceClient().get(resourceGroupName, diskPoolName, iscsiTargetName); + if (inner != null) { + return new IscsiTargetImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String diskPoolName, String iscsiTargetName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, diskPoolName, iscsiTargetName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IscsiTargetImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public IscsiTarget 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 diskPoolName = Utils.getValueFromIdByName(id, "diskPools"); + if (diskPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'diskPools'.", id))); + } + String iscsiTargetName = Utils.getValueFromIdByName(id, "iscsiTargets"); + if (iscsiTargetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iscsiTargets'.", id))); + } + return this.getWithResponse(resourceGroupName, diskPoolName, iscsiTargetName, 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 diskPoolName = Utils.getValueFromIdByName(id, "diskPools"); + if (diskPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'diskPools'.", id))); + } + String iscsiTargetName = Utils.getValueFromIdByName(id, "iscsiTargets"); + if (iscsiTargetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iscsiTargets'.", id))); + } + return this.getWithResponse(resourceGroupName, diskPoolName, iscsiTargetName, 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 diskPoolName = Utils.getValueFromIdByName(id, "diskPools"); + if (diskPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'diskPools'.", id))); + } + String iscsiTargetName = Utils.getValueFromIdByName(id, "iscsiTargets"); + if (iscsiTargetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iscsiTargets'.", id))); + } + this.delete(resourceGroupName, diskPoolName, iscsiTargetName, Context.NONE); + } + + public void 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 diskPoolName = Utils.getValueFromIdByName(id, "diskPools"); + if (diskPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'diskPools'.", id))); + } + String iscsiTargetName = Utils.getValueFromIdByName(id, "iscsiTargets"); + if (iscsiTargetName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iscsiTargets'.", id))); + } + this.delete(resourceGroupName, diskPoolName, iscsiTargetName, context); + } + + private IscsiTargetsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storagepool.StoragePoolManager manager() { + return this.serviceManager; + } + + public IscsiTargetImpl define(String name) { + return new IscsiTargetImpl(name, this.manager()); + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/OperationsClientImpl.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..b99f6e14fda96 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/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.storagepool.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.storagepool.fluent.OperationsClient; +import com.azure.resourcemanager.storagepool.fluent.models.StoragePoolRPOperationInner; +import com.azure.resourcemanager.storagepool.models.StoragePoolOperationListResult; +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 StoragePoolManagementImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(StoragePoolManagementImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StoragePoolManagementOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StoragePoolManagemen") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.StoragePool/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of StoragePool 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 a list of StoragePool 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())); + } + + /** + * Gets a list of StoragePool 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 a list of StoragePool 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)); + } + + /** + * Gets a list of StoragePool 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 a list of StoragePool operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync()); + } + + /** + * Gets a list of StoragePool 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 a list of StoragePool operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context)); + } + + /** + * Gets a list of StoragePool 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 a list of StoragePool operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of StoragePool 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 a list of StoragePool operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/OperationsImpl.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..5b43336d5f82b --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/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.storagepool.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.storagepool.fluent.OperationsClient; +import com.azure.resourcemanager.storagepool.fluent.models.StoragePoolRPOperationInner; +import com.azure.resourcemanager.storagepool.models.Operations; +import com.azure.resourcemanager.storagepool.models.StoragePoolRPOperation; +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.storagepool.StoragePoolManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.storagepool.StoragePoolManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new StoragePoolRPOperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new StoragePoolRPOperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storagepool.StoragePoolManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/OutboundEnvironmentEndpointImpl.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/OutboundEnvironmentEndpointImpl.java new file mode 100644 index 0000000000000..a115f9ca8709a --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/OutboundEnvironmentEndpointImpl.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.storagepool.implementation; + +import com.azure.resourcemanager.storagepool.fluent.models.OutboundEnvironmentEndpointInner; +import com.azure.resourcemanager.storagepool.models.EndpointDependency; +import com.azure.resourcemanager.storagepool.models.OutboundEnvironmentEndpoint; +import java.util.Collections; +import java.util.List; + +public final class OutboundEnvironmentEndpointImpl implements OutboundEnvironmentEndpoint { + private OutboundEnvironmentEndpointInner innerObject; + + private final com.azure.resourcemanager.storagepool.StoragePoolManager serviceManager; + + OutboundEnvironmentEndpointImpl( + OutboundEnvironmentEndpointInner innerObject, + com.azure.resourcemanager.storagepool.StoragePoolManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String category() { + return this.innerModel().category(); + } + + public List endpoints() { + List inner = this.innerModel().endpoints(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OutboundEnvironmentEndpointInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storagepool.StoragePoolManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/StoragePoolManagementBuilder.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/StoragePoolManagementBuilder.java new file mode 100644 index 0000000000000..3b68aad879b0d --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/StoragePoolManagementBuilder.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.storagepool.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 StoragePoolManagementImpl type. */ +@ServiceClientBuilder(serviceClients = {StoragePoolManagementImpl.class}) +public final class StoragePoolManagementBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the StoragePoolManagementBuilder. + */ + public StoragePoolManagementBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the StoragePoolManagementBuilder. + */ + public StoragePoolManagementBuilder 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 StoragePoolManagementBuilder. + */ + public StoragePoolManagementBuilder 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 StoragePoolManagementBuilder. + */ + public StoragePoolManagementBuilder 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 StoragePoolManagementBuilder. + */ + public StoragePoolManagementBuilder 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 StoragePoolManagementBuilder. + */ + public StoragePoolManagementBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of StoragePoolManagementImpl with the provided parameters. + * + * @return an instance of StoragePoolManagementImpl. + */ + public StoragePoolManagementImpl 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(); + } + StoragePoolManagementImpl client = + new StoragePoolManagementImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/StoragePoolManagementImpl.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/StoragePoolManagementImpl.java new file mode 100644 index 0000000000000..15b1ae65af656 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/StoragePoolManagementImpl.java @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagepool.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.storagepool.fluent.DiskPoolZonesClient; +import com.azure.resourcemanager.storagepool.fluent.DiskPoolsClient; +import com.azure.resourcemanager.storagepool.fluent.IscsiTargetsClient; +import com.azure.resourcemanager.storagepool.fluent.OperationsClient; +import com.azure.resourcemanager.storagepool.fluent.StoragePoolManagement; +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 StoragePoolManagementImpl type. */ +@ServiceClient(builder = StoragePoolManagementBuilder.class) +public final class StoragePoolManagementImpl implements StoragePoolManagement { + private final ClientLogger logger = new ClientLogger(StoragePoolManagementImpl.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 DiskPoolsClient object to access its operations. */ + private final DiskPoolsClient diskPools; + + /** + * Gets the DiskPoolsClient object to access its operations. + * + * @return the DiskPoolsClient object. + */ + public DiskPoolsClient getDiskPools() { + return this.diskPools; + } + + /** The DiskPoolZonesClient object to access its operations. */ + private final DiskPoolZonesClient diskPoolZones; + + /** + * Gets the DiskPoolZonesClient object to access its operations. + * + * @return the DiskPoolZonesClient object. + */ + public DiskPoolZonesClient getDiskPoolZones() { + return this.diskPoolZones; + } + + /** The IscsiTargetsClient object to access its operations. */ + private final IscsiTargetsClient iscsiTargets; + + /** + * Gets the IscsiTargetsClient object to access its operations. + * + * @return the IscsiTargetsClient object. + */ + public IscsiTargetsClient getIscsiTargets() { + return this.iscsiTargets; + } + + /** + * Initializes an instance of StoragePoolManagement 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. + */ + StoragePoolManagementImpl( + 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-preview"; + this.operations = new OperationsClientImpl(this); + this.diskPools = new DiskPoolsClientImpl(this); + this.diskPoolZones = new DiskPoolZonesClientImpl(this); + this.iscsiTargets = new IscsiTargetsClientImpl(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/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/StoragePoolRPOperationImpl.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/StoragePoolRPOperationImpl.java new file mode 100644 index 0000000000000..b63b7f355972b --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/StoragePoolRPOperationImpl.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.storagepool.implementation; + +import com.azure.resourcemanager.storagepool.fluent.models.StoragePoolRPOperationInner; +import com.azure.resourcemanager.storagepool.models.StoragePoolOperationDisplay; +import com.azure.resourcemanager.storagepool.models.StoragePoolRPOperation; + +public final class StoragePoolRPOperationImpl implements StoragePoolRPOperation { + private StoragePoolRPOperationInner innerObject; + + private final com.azure.resourcemanager.storagepool.StoragePoolManager serviceManager; + + StoragePoolRPOperationImpl( + StoragePoolRPOperationInner innerObject, + com.azure.resourcemanager.storagepool.StoragePoolManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public String actionType() { + return this.innerModel().actionType(); + } + + public StoragePoolOperationDisplay display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public StoragePoolRPOperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storagepool.StoragePoolManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/Utils.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/Utils.java new file mode 100644 index 0000000000000..875f775d10b97 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/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.storagepool.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/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/package-info.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/package-info.java new file mode 100644 index 0000000000000..214155b3ebe8a --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/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 StoragePoolManagement. null. */ +package com.azure.resourcemanager.storagepool.implementation; diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/Acl.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/Acl.java new file mode 100644 index 0000000000000..68af804952173 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/Acl.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.storagepool.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; + +/** Access Control List (ACL) for an iSCSI Target; defines LUN masking policy. */ +@Fluent +public final class Acl { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Acl.class); + + /* + * iSCSI initiator IQN (iSCSI Qualified Name); example: + * "iqn.2005-03.org.iscsi:client". + */ + @JsonProperty(value = "initiatorIqn", required = true) + private String initiatorIqn; + + /* + * List of LUN names mapped to the ACL. + */ + @JsonProperty(value = "mappedLuns", required = true) + private List mappedLuns; + + /** + * Get the initiatorIqn property: iSCSI initiator IQN (iSCSI Qualified Name); example: + * "iqn.2005-03.org.iscsi:client". + * + * @return the initiatorIqn value. + */ + public String initiatorIqn() { + return this.initiatorIqn; + } + + /** + * Set the initiatorIqn property: iSCSI initiator IQN (iSCSI Qualified Name); example: + * "iqn.2005-03.org.iscsi:client". + * + * @param initiatorIqn the initiatorIqn value to set. + * @return the Acl object itself. + */ + public Acl withInitiatorIqn(String initiatorIqn) { + this.initiatorIqn = initiatorIqn; + return this; + } + + /** + * Get the mappedLuns property: List of LUN names mapped to the ACL. + * + * @return the mappedLuns value. + */ + public List mappedLuns() { + return this.mappedLuns; + } + + /** + * Set the mappedLuns property: List of LUN names mapped to the ACL. + * + * @param mappedLuns the mappedLuns value to set. + * @return the Acl object itself. + */ + public Acl withMappedLuns(List mappedLuns) { + this.mappedLuns = mappedLuns; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (initiatorIqn() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property initiatorIqn in model Acl")); + } + if (mappedLuns() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property mappedLuns in model Acl")); + } + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/CreatedByType.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/CreatedByType.java new file mode 100644 index 0000000000000..99f44e16e1911 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/CreatedByType.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.storagepool.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CreatedByType. */ +public final class CreatedByType extends ExpandableStringEnum { + /** Static value User for CreatedByType. */ + public static final CreatedByType USER = fromString("User"); + + /** Static value Application for CreatedByType. */ + public static final CreatedByType APPLICATION = fromString("Application"); + + /** Static value ManagedIdentity for CreatedByType. */ + public static final CreatedByType MANAGED_IDENTITY = fromString("ManagedIdentity"); + + /** Static value Key for CreatedByType. */ + public static final CreatedByType KEY = fromString("Key"); + + /** + * Creates or finds a CreatedByType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CreatedByType. + */ + @JsonCreator + public static CreatedByType fromString(String name) { + return fromString(name, CreatedByType.class); + } + + /** @return known CreatedByType values. */ + public static Collection values() { + return values(CreatedByType.class); + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/Disk.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/Disk.java new file mode 100644 index 0000000000000..457339e308d46 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/Disk.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.storagepool.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; + +/** Azure Managed Disk to attach to the Disk Pool. */ +@Fluent +public final class Disk { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Disk.class); + + /* + * Unique Azure Resource ID of the Managed Disk. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get the id property: Unique Azure Resource ID of the Managed Disk. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Unique Azure Resource ID of the Managed Disk. + * + * @param id the id value to set. + * @return the Disk object itself. + */ + public Disk withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property id in model Disk")); + } + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/DiskPool.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/DiskPool.java new file mode 100644 index 0000000000000..902df3610c89c --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/DiskPool.java @@ -0,0 +1,360 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagepool.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagepool.fluent.models.DiskPoolInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of DiskPool. */ +public interface DiskPool { + /** + * 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 systemData property: Resource metadata required by ARM RPC. + * + * @return the systemData value. + */ + SystemMetadata systemData(); + + /** + * Gets the provisioningState property: State of the operation on the resource. + * + * @return the provisioningState value. + */ + ProvisioningStates provisioningState(); + + /** + * Gets the availabilityZones property: Logical zone for Disk Pool resource; example: ["1"]. + * + * @return the availabilityZones value. + */ + List availabilityZones(); + + /** + * Gets the status property: Operational status of the Disk Pool. + * + * @return the status value. + */ + OperationalStatus status(); + + /** + * Gets the disks property: List of Azure Managed Disks to attach to a Disk Pool. + * + * @return the disks value. + */ + List disks(); + + /** + * Gets the subnetId property: Azure Resource ID of a Subnet for the Disk Pool. + * + * @return the subnetId value. + */ + String subnetId(); + + /** + * Gets the additionalCapabilities property: List of additional capabilities for Disk Pool. + * + * @return the additionalCapabilities value. + */ + List additionalCapabilities(); + + /** + * Gets the nameSkuName property: Sku name. + * + * @return the nameSkuName value. + */ + String nameSkuName(); + + /** + * Gets the tier property: Sku tier. + * + * @return the tier value. + */ + String tier(); + + /** + * 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.storagepool.fluent.models.DiskPoolInner object. + * + * @return the inner object. + */ + DiskPoolInner innerModel(); + + /** The entirety of the DiskPool definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithSku, + DefinitionStages.WithSubnetId, + DefinitionStages.WithCreate { + } + /** The DiskPool definition stages. */ + interface DefinitionStages { + /** The first stage of the DiskPool definition. */ + interface Blank extends WithLocation { + } + /** The stage of the DiskPool definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the DiskPool definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithSku withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the DiskPool definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Determines the SKU of the Disk Pool. + * + * @param sku Determines the SKU of the Disk Pool. + * @return the next definition stage. + */ + WithSubnetId withSku(Sku sku); + } + /** The stage of the DiskPool definition allowing to specify subnetId. */ + interface WithSubnetId { + /** + * Specifies the subnetId property: Azure Resource ID of a Subnet for the Disk Pool.. + * + * @param subnetId Azure Resource ID of a Subnet for the Disk Pool. + * @return the next definition stage. + */ + WithCreate withSubnetId(String subnetId); + } + /** + * The stage of the DiskPool 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.WithAvailabilityZones, + DefinitionStages.WithDisks, + DefinitionStages.WithAdditionalCapabilities { + /** + * Executes the create request. + * + * @return the created resource. + */ + DiskPool create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DiskPool create(Context context); + } + /** The stage of the DiskPool definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the DiskPool definition allowing to specify availabilityZones. */ + interface WithAvailabilityZones { + /** + * Specifies the availabilityZones property: Logical zone for Disk Pool resource; example: ["1"].. + * + * @param availabilityZones Logical zone for Disk Pool resource; example: ["1"]. + * @return the next definition stage. + */ + WithCreate withAvailabilityZones(List availabilityZones); + } + /** The stage of the DiskPool definition allowing to specify disks. */ + interface WithDisks { + /** + * Specifies the disks property: List of Azure Managed Disks to attach to a Disk Pool.. + * + * @param disks List of Azure Managed Disks to attach to a Disk Pool. + * @return the next definition stage. + */ + WithCreate withDisks(List disks); + } + /** The stage of the DiskPool definition allowing to specify additionalCapabilities. */ + interface WithAdditionalCapabilities { + /** + * Specifies the additionalCapabilities property: List of additional capabilities for a Disk Pool.. + * + * @param additionalCapabilities List of additional capabilities for a Disk Pool. + * @return the next definition stage. + */ + WithCreate withAdditionalCapabilities(List additionalCapabilities); + } + } + /** + * Begins update for the DiskPool resource. + * + * @return the stage of resource update. + */ + DiskPool.Update update(); + + /** The template for DiskPool update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithDisks { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DiskPool apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DiskPool apply(Context context); + } + /** The DiskPool update stages. */ + interface UpdateStages { + /** The stage of the DiskPool update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the DiskPool update allowing to specify disks. */ + interface WithDisks { + /** + * Specifies the disks property: List of Azure Managed Disks to attach to a Disk Pool.. + * + * @param disks List of Azure Managed Disks to attach to a Disk Pool. + * @return the next definition stage. + */ + Update withDisks(List disks); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DiskPool refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DiskPool refresh(Context context); + + /** + * The operation to start a Disk Pool. + * + * @throws com.azure.core.management.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 start(); + + /** + * The operation to start a Disk Pool. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 start(Context context); + + /** + * Shuts down the Disk Pool and releases the compute resources. You are not billed for the compute resources that + * this Disk Pool uses. + * + * @throws com.azure.core.management.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 deallocate(); + + /** + * Shuts down the Disk Pool and releases the compute resources. You are not billed for the compute resources that + * this Disk Pool uses. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deallocate(Context context); +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/DiskPoolCreate.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/DiskPoolCreate.java new file mode 100644 index 0000000000000..bde0d691b8592 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/DiskPoolCreate.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.storagepool.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.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Request payload for create or update Disk Pool request. */ +@JsonFlatten +@Fluent +public class DiskPoolCreate extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskPoolCreate.class); + + /* + * Determines the SKU of the Disk Pool + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /* + * Logical zone for Disk Pool resource; example: ["1"]. + */ + @JsonProperty(value = "properties.availabilityZones") + private List availabilityZones; + + /* + * List of Azure Managed Disks to attach to a Disk Pool. + */ + @JsonProperty(value = "properties.disks") + private List disks; + + /* + * Azure Resource ID of a Subnet for the Disk Pool. + */ + @JsonProperty(value = "properties.subnetId", required = true) + private String subnetId; + + /* + * List of additional capabilities for a Disk Pool. + */ + @JsonProperty(value = "properties.additionalCapabilities") + private List additionalCapabilities; + + /** + * Get the sku property: Determines the SKU of the Disk Pool. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Determines the SKU of the Disk Pool. + * + * @param sku the sku value to set. + * @return the DiskPoolCreate object itself. + */ + public DiskPoolCreate withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the availabilityZones property: Logical zone for Disk Pool resource; example: ["1"]. + * + * @return the availabilityZones value. + */ + public List availabilityZones() { + return this.availabilityZones; + } + + /** + * Set the availabilityZones property: Logical zone for Disk Pool resource; example: ["1"]. + * + * @param availabilityZones the availabilityZones value to set. + * @return the DiskPoolCreate object itself. + */ + public DiskPoolCreate withAvailabilityZones(List availabilityZones) { + this.availabilityZones = availabilityZones; + return this; + } + + /** + * Get the disks property: List of Azure Managed Disks to attach to a Disk Pool. + * + * @return the disks value. + */ + public List disks() { + return this.disks; + } + + /** + * Set the disks property: List of Azure Managed Disks to attach to a Disk Pool. + * + * @param disks the disks value to set. + * @return the DiskPoolCreate object itself. + */ + public DiskPoolCreate withDisks(List disks) { + this.disks = disks; + return this; + } + + /** + * Get the subnetId property: Azure Resource ID of a Subnet for the Disk Pool. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: Azure Resource ID of a Subnet for the Disk Pool. + * + * @param subnetId the subnetId value to set. + * @return the DiskPoolCreate object itself. + */ + public DiskPoolCreate withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the additionalCapabilities property: List of additional capabilities for a Disk Pool. + * + * @return the additionalCapabilities value. + */ + public List additionalCapabilities() { + return this.additionalCapabilities; + } + + /** + * Set the additionalCapabilities property: List of additional capabilities for a Disk Pool. + * + * @param additionalCapabilities the additionalCapabilities value to set. + * @return the DiskPoolCreate object itself. + */ + public DiskPoolCreate withAdditionalCapabilities(List additionalCapabilities) { + this.additionalCapabilities = additionalCapabilities; + return this; + } + + /** {@inheritDoc} */ + @Override + public DiskPoolCreate withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DiskPoolCreate 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) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property sku in model DiskPoolCreate")); + } else { + sku().validate(); + } + if (disks() != null) { + disks().forEach(e -> e.validate()); + } + if (subnetId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property subnetId in model DiskPoolCreate")); + } + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/DiskPoolListResult.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/DiskPoolListResult.java new file mode 100644 index 0000000000000..08ac103a7daa3 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/DiskPoolListResult.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.storagepool.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagepool.fluent.models.DiskPoolInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Disk Pools. */ +@Fluent +public final class DiskPoolListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskPoolListResult.class); + + /* + * An array of Disk pool objects. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * URI to fetch the next section of the paginated response. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: An array of Disk pool objects. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of Disk pool objects. + * + * @param value the value value to set. + * @return the DiskPoolListResult object itself. + */ + public DiskPoolListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URI to fetch the next section of the paginated response. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model DiskPoolListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/DiskPoolUpdate.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/DiskPoolUpdate.java new file mode 100644 index 0000000000000..a0883e37135f9 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/DiskPoolUpdate.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagepool.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; +import java.util.Map; + +/** Request payload for Update Disk Pool request. */ +@JsonFlatten +@Fluent +public class DiskPoolUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskPoolUpdate.class); + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * List of Azure Managed Disks to attach to a Disk Pool. + */ + @JsonProperty(value = "properties.disks") + private List disks; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the DiskPoolUpdate object itself. + */ + public DiskPoolUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the disks property: List of Azure Managed Disks to attach to a Disk Pool. + * + * @return the disks value. + */ + public List disks() { + return this.disks; + } + + /** + * Set the disks property: List of Azure Managed Disks to attach to a Disk Pool. + * + * @param disks the disks value to set. + * @return the DiskPoolUpdate object itself. + */ + public DiskPoolUpdate withDisks(List disks) { + this.disks = disks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (disks() != null) { + disks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/DiskPoolZoneInfo.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/DiskPoolZoneInfo.java new file mode 100644 index 0000000000000..e59ec35adaa6b --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/DiskPoolZoneInfo.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.storagepool.models; + +import com.azure.resourcemanager.storagepool.fluent.models.DiskPoolZoneInfoInner; +import java.util.List; + +/** An immutable client-side representation of DiskPoolZoneInfo. */ +public interface DiskPoolZoneInfo { + /** + * Gets the availabilityZones property: Logical zone for Disk Pool resource; example: ["1"]. + * + * @return the availabilityZones value. + */ + List availabilityZones(); + + /** + * Gets the additionalCapabilities property: List of additional capabilities for Disk Pool. + * + * @return the additionalCapabilities value. + */ + List additionalCapabilities(); + + /** + * Gets the sku property: Determines the SKU of VM deployed for Disk Pool. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the inner com.azure.resourcemanager.storagepool.fluent.models.DiskPoolZoneInfoInner object. + * + * @return the inner object. + */ + DiskPoolZoneInfoInner innerModel(); +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/DiskPoolZoneListResult.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/DiskPoolZoneListResult.java new file mode 100644 index 0000000000000..604db6373256e --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/DiskPoolZoneListResult.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.storagepool.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagepool.fluent.models.DiskPoolZoneInfoInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List Disk Pool skus operation response. */ +@Fluent +public final class DiskPoolZoneListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskPoolZoneListResult.class); + + /* + * The list of Disk Pool Skus. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URI to fetch the next section of the paginated response. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of Disk Pool Skus. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Disk Pool Skus. + * + * @param value the value value to set. + * @return the DiskPoolZoneListResult object itself. + */ + public DiskPoolZoneListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URI to fetch the next section of the paginated response. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URI to fetch the next section of the paginated response. + * + * @param nextLink the nextLink value to set. + * @return the DiskPoolZoneListResult object itself. + */ + public DiskPoolZoneListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/DiskPoolZones.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/DiskPoolZones.java new file mode 100644 index 0000000000000..07ac319f6a4e8 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/DiskPoolZones.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.storagepool.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of DiskPoolZones. */ +public interface DiskPoolZones { + /** + * Lists available Disk Pool Skus in an Azure location. + * + * @param location The location of the 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 list Disk Pool skus operation response. + */ + PagedIterable list(String location); + + /** + * Lists available Disk Pool Skus in an Azure location. + * + * @param location The location of the 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 list Disk Pool skus operation response. + */ + PagedIterable list(String location, Context context); +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/DiskPools.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/DiskPools.java new file mode 100644 index 0000000000000..3dd11d9f50391 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/DiskPools.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagepool.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 DiskPools. */ +public interface DiskPools { + /** + * Gets a list of Disk Pools in a 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 a list of Disk Pools in a subscription. + */ + PagedIterable list(); + + /** + * Gets a list of Disk Pools in a 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 a list of Disk Pools in a subscription. + */ + PagedIterable list(Context context); + + /** + * Gets a list of DiskPools in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of DiskPools in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of DiskPools in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of DiskPools in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Delete a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 diskPoolName); + + /** + * Delete a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 diskPoolName, Context context); + + /** + * Get a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Disk pool. + */ + DiskPool getByResourceGroup(String resourceGroupName, String diskPoolName); + + /** + * Get a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Disk pool. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String diskPoolName, Context context); + + /** + * Gets the network endpoints of all outbound dependencies of a Disk Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network endpoints of all outbound dependencies of a Disk Pool. + */ + PagedIterable listOutboundNetworkDependenciesEndpoints( + String resourceGroupName, String diskPoolName); + + /** + * Gets the network endpoints of all outbound dependencies of a Disk Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network endpoints of all outbound dependencies of a Disk Pool. + */ + PagedIterable listOutboundNetworkDependenciesEndpoints( + String resourceGroupName, String diskPoolName, Context context); + + /** + * The operation to start a Disk Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 start(String resourceGroupName, String diskPoolName); + + /** + * The operation to start a Disk Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 start(String resourceGroupName, String diskPoolName, Context context); + + /** + * Shuts down the Disk Pool and releases the compute resources. You are not billed for the compute resources that + * this Disk Pool uses. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deallocate(String resourceGroupName, String diskPoolName); + + /** + * Shuts down the Disk Pool and releases the compute resources. You are not billed for the compute resources that + * this Disk Pool uses. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deallocate(String resourceGroupName, String diskPoolName, Context context); + + /** + * Get a Disk pool. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Disk pool. + */ + DiskPool getById(String id); + + /** + * Get a Disk pool. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Disk pool. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Disk pool. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Disk pool. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DiskPool resource. + * + * @param name resource name. + * @return the first stage of the new DiskPool definition. + */ + DiskPool.DefinitionStages.Blank define(String name); +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/EndpointDependency.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/EndpointDependency.java new file mode 100644 index 0000000000000..484ae6a262ee0 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/EndpointDependency.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagepool.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; + +/** A domain name that a service is reached at, including details of the current connection status. */ +@Fluent +public final class EndpointDependency { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EndpointDependency.class); + + /* + * The domain name of the dependency. + */ + @JsonProperty(value = "domainName") + private String domainName; + + /* + * The IP Addresses and Ports used when connecting to DomainName. + */ + @JsonProperty(value = "endpointDetails") + private List endpointDetails; + + /** + * Get the domainName property: The domain name of the dependency. + * + * @return the domainName value. + */ + public String domainName() { + return this.domainName; + } + + /** + * Set the domainName property: The domain name of the dependency. + * + * @param domainName the domainName value to set. + * @return the EndpointDependency object itself. + */ + public EndpointDependency withDomainName(String domainName) { + this.domainName = domainName; + return this; + } + + /** + * Get the endpointDetails property: The IP Addresses and Ports used when connecting to DomainName. + * + * @return the endpointDetails value. + */ + public List endpointDetails() { + return this.endpointDetails; + } + + /** + * Set the endpointDetails property: The IP Addresses and Ports used when connecting to DomainName. + * + * @param endpointDetails the endpointDetails value to set. + * @return the EndpointDependency object itself. + */ + public EndpointDependency withEndpointDetails(List endpointDetails) { + this.endpointDetails = endpointDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (endpointDetails() != null) { + endpointDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/EndpointDetail.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/EndpointDetail.java new file mode 100644 index 0000000000000..970d3b39134e7 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/EndpointDetail.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.storagepool.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; + +/** Current TCP connectivity information from the App Service Environment to a single endpoint. */ +@Fluent +public final class EndpointDetail { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EndpointDetail.class); + + /* + * An IP Address that Domain Name currently resolves to. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /* + * The port an endpoint is connected to. + */ + @JsonProperty(value = "port") + private Integer port; + + /* + * The time in milliseconds it takes for a TCP connection to be created + * from the App Service Environment to this IpAddress at this Port. + */ + @JsonProperty(value = "latency") + private Double latency; + + /* + * Whether it is possible to create a TCP connection from the App Service + * Environment to this IpAddress at this Port. + */ + @JsonProperty(value = "isAccessible") + private Boolean isAccessible; + + /** + * Get the ipAddress property: An IP Address that Domain Name currently resolves to. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: An IP Address that Domain Name currently resolves to. + * + * @param ipAddress the ipAddress value to set. + * @return the EndpointDetail object itself. + */ + public EndpointDetail withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the port property: The port an endpoint is connected to. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The port an endpoint is connected to. + * + * @param port the port value to set. + * @return the EndpointDetail object itself. + */ + public EndpointDetail withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the latency property: The time in milliseconds it takes for a TCP connection to be created from the App + * Service Environment to this IpAddress at this Port. + * + * @return the latency value. + */ + public Double latency() { + return this.latency; + } + + /** + * Set the latency property: The time in milliseconds it takes for a TCP connection to be created from the App + * Service Environment to this IpAddress at this Port. + * + * @param latency the latency value to set. + * @return the EndpointDetail object itself. + */ + public EndpointDetail withLatency(Double latency) { + this.latency = latency; + return this; + } + + /** + * Get the isAccessible property: Whether it is possible to create a TCP connection from the App Service Environment + * to this IpAddress at this Port. + * + * @return the isAccessible value. + */ + public Boolean isAccessible() { + return this.isAccessible; + } + + /** + * Set the isAccessible property: Whether it is possible to create a TCP connection from the App Service Environment + * to this IpAddress at this Port. + * + * @param isAccessible the isAccessible value to set. + * @return the EndpointDetail object itself. + */ + public EndpointDetail withIsAccessible(Boolean isAccessible) { + this.isAccessible = isAccessible; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/IscsiLun.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/IscsiLun.java new file mode 100644 index 0000000000000..07ba50d935439 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/IscsiLun.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.storagepool.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; + +/** LUN to expose the Azure Managed Disk. */ +@Fluent +public final class IscsiLun { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IscsiLun.class); + + /* + * User defined name for iSCSI LUN; example: "lun0" + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Azure Resource ID of the Managed Disk. + */ + @JsonProperty(value = "managedDiskAzureResourceId", required = true) + private String managedDiskAzureResourceId; + + /* + * Specifies the Logical Unit Number of the iSCSI LUN. + */ + @JsonProperty(value = "lun", access = JsonProperty.Access.WRITE_ONLY) + private Integer lun; + + /** + * Get the name property: User defined name for iSCSI LUN; example: "lun0". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: User defined name for iSCSI LUN; example: "lun0". + * + * @param name the name value to set. + * @return the IscsiLun object itself. + */ + public IscsiLun withName(String name) { + this.name = name; + return this; + } + + /** + * Get the managedDiskAzureResourceId property: Azure Resource ID of the Managed Disk. + * + * @return the managedDiskAzureResourceId value. + */ + public String managedDiskAzureResourceId() { + return this.managedDiskAzureResourceId; + } + + /** + * Set the managedDiskAzureResourceId property: Azure Resource ID of the Managed Disk. + * + * @param managedDiskAzureResourceId the managedDiskAzureResourceId value to set. + * @return the IscsiLun object itself. + */ + public IscsiLun withManagedDiskAzureResourceId(String managedDiskAzureResourceId) { + this.managedDiskAzureResourceId = managedDiskAzureResourceId; + return this; + } + + /** + * Get the lun property: Specifies the Logical Unit Number of the iSCSI LUN. + * + * @return the lun value. + */ + public Integer lun() { + return this.lun; + } + + /** + * 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 IscsiLun")); + } + if (managedDiskAzureResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property managedDiskAzureResourceId in model IscsiLun")); + } + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/IscsiTarget.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/IscsiTarget.java new file mode 100644 index 0000000000000..e6bcb86bf0a67 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/IscsiTarget.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagepool.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagepool.fluent.models.IscsiTargetInner; +import java.util.List; + +/** An immutable client-side representation of IscsiTarget. */ +public interface IscsiTarget { + /** + * 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: Resource metadata required by ARM RPC. + * + * @return the systemData value. + */ + SystemMetadata systemData(); + + /** + * Gets the aclMode property: Mode for Target connectivity. + * + * @return the aclMode value. + */ + IscsiTargetAclMode aclMode(); + + /** + * Gets the staticAcls property: Access Control List (ACL) for an iSCSI Target; defines LUN masking policy. + * + * @return the staticAcls value. + */ + List staticAcls(); + + /** + * Gets the luns property: List of LUNs to be exposed through iSCSI Target. + * + * @return the luns value. + */ + List luns(); + + /** + * Gets the targetIqn property: iSCSI Target IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:server". + * + * @return the targetIqn value. + */ + String targetIqn(); + + /** + * Gets the provisioningState property: State of the operation on the resource. + * + * @return the provisioningState value. + */ + ProvisioningStates provisioningState(); + + /** + * Gets the status property: Operational status of the iSCSI Target. + * + * @return the status value. + */ + OperationalStatus status(); + + /** + * Gets the endpoints property: List of private IPv4 addresses to connect to the iSCSI Target. + * + * @return the endpoints value. + */ + List endpoints(); + + /** + * Gets the port property: The port used by iSCSI Target portal group. + * + * @return the port value. + */ + Integer port(); + + /** + * Gets the inner com.azure.resourcemanager.storagepool.fluent.models.IscsiTargetInner object. + * + * @return the inner object. + */ + IscsiTargetInner innerModel(); + + /** The entirety of the IscsiTarget definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithAclMode, + DefinitionStages.WithCreate { + } + /** The IscsiTarget definition stages. */ + interface DefinitionStages { + /** The first stage of the IscsiTarget definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the IscsiTarget definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, diskPoolName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @return the next definition stage. + */ + WithAclMode withExistingDiskPool(String resourceGroupName, String diskPoolName); + } + /** The stage of the IscsiTarget definition allowing to specify aclMode. */ + interface WithAclMode { + /** + * Specifies the aclMode property: Mode for Target connectivity.. + * + * @param aclMode Mode for Target connectivity. + * @return the next definition stage. + */ + WithCreate withAclMode(IscsiTargetAclMode aclMode); + } + /** + * The stage of the IscsiTarget 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.WithTargetIqn, DefinitionStages.WithStaticAcls, DefinitionStages.WithLuns { + /** + * Executes the create request. + * + * @return the created resource. + */ + IscsiTarget create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IscsiTarget create(Context context); + } + /** The stage of the IscsiTarget definition allowing to specify targetIqn. */ + interface WithTargetIqn { + /** + * Specifies the targetIqn property: iSCSI Target IQN (iSCSI Qualified Name); example: + * "iqn.2005-03.org.iscsi:server".. + * + * @param targetIqn iSCSI Target IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:server". + * @return the next definition stage. + */ + WithCreate withTargetIqn(String targetIqn); + } + /** The stage of the IscsiTarget definition allowing to specify staticAcls. */ + interface WithStaticAcls { + /** + * Specifies the staticAcls property: Access Control List (ACL) for an iSCSI Target; defines LUN masking + * policy. + * + * @param staticAcls Access Control List (ACL) for an iSCSI Target; defines LUN masking policy. + * @return the next definition stage. + */ + WithCreate withStaticAcls(List staticAcls); + } + /** The stage of the IscsiTarget definition allowing to specify luns. */ + interface WithLuns { + /** + * Specifies the luns property: List of LUNs to be exposed through iSCSI Target.. + * + * @param luns List of LUNs to be exposed through iSCSI Target. + * @return the next definition stage. + */ + WithCreate withLuns(List luns); + } + } + /** + * Begins update for the IscsiTarget resource. + * + * @return the stage of resource update. + */ + IscsiTarget.Update update(); + + /** The template for IscsiTarget update. */ + interface Update extends UpdateStages.WithStaticAcls, UpdateStages.WithLuns { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IscsiTarget apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IscsiTarget apply(Context context); + } + /** The IscsiTarget update stages. */ + interface UpdateStages { + /** The stage of the IscsiTarget update allowing to specify staticAcls. */ + interface WithStaticAcls { + /** + * Specifies the staticAcls property: Access Control List (ACL) for an iSCSI Target; defines LUN masking + * policy. + * + * @param staticAcls Access Control List (ACL) for an iSCSI Target; defines LUN masking policy. + * @return the next definition stage. + */ + Update withStaticAcls(List staticAcls); + } + /** The stage of the IscsiTarget update allowing to specify luns. */ + interface WithLuns { + /** + * Specifies the luns property: List of LUNs to be exposed through iSCSI Target.. + * + * @param luns List of LUNs to be exposed through iSCSI Target. + * @return the next definition stage. + */ + Update withLuns(List luns); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IscsiTarget refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IscsiTarget refresh(Context context); +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/IscsiTargetAclMode.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/IscsiTargetAclMode.java new file mode 100644 index 0000000000000..6aa05bf784298 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/IscsiTargetAclMode.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.storagepool.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IscsiTargetAclMode. */ +public final class IscsiTargetAclMode extends ExpandableStringEnum { + /** Static value Dynamic for IscsiTargetAclMode. */ + public static final IscsiTargetAclMode DYNAMIC = fromString("Dynamic"); + + /** Static value Static for IscsiTargetAclMode. */ + public static final IscsiTargetAclMode STATIC = fromString("Static"); + + /** + * Creates or finds a IscsiTargetAclMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding IscsiTargetAclMode. + */ + @JsonCreator + public static IscsiTargetAclMode fromString(String name) { + return fromString(name, IscsiTargetAclMode.class); + } + + /** @return known IscsiTargetAclMode values. */ + public static Collection values() { + return values(IscsiTargetAclMode.class); + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/IscsiTargetCreate.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/IscsiTargetCreate.java new file mode 100644 index 0000000000000..aa3a8ae6fb12f --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/IscsiTargetCreate.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.storagepool.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; + +/** Payload for iSCSI Target create or update requests. */ +@JsonFlatten +@Fluent +public class IscsiTargetCreate extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IscsiTargetCreate.class); + + /* + * Mode for Target connectivity. + */ + @JsonProperty(value = "properties.aclMode", required = true) + private IscsiTargetAclMode aclMode; + + /* + * iSCSI Target IQN (iSCSI Qualified Name); example: + * "iqn.2005-03.org.iscsi:server". + */ + @JsonProperty(value = "properties.targetIqn") + private String targetIqn; + + /* + * Access Control List (ACL) for an iSCSI Target; defines LUN masking + * policy + */ + @JsonProperty(value = "properties.staticAcls") + private List staticAcls; + + /* + * List of LUNs to be exposed through iSCSI Target. + */ + @JsonProperty(value = "properties.luns") + private List luns; + + /** + * Get the aclMode property: Mode for Target connectivity. + * + * @return the aclMode value. + */ + public IscsiTargetAclMode aclMode() { + return this.aclMode; + } + + /** + * Set the aclMode property: Mode for Target connectivity. + * + * @param aclMode the aclMode value to set. + * @return the IscsiTargetCreate object itself. + */ + public IscsiTargetCreate withAclMode(IscsiTargetAclMode aclMode) { + this.aclMode = aclMode; + return this; + } + + /** + * Get the targetIqn property: iSCSI Target IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:server". + * + * @return the targetIqn value. + */ + public String targetIqn() { + return this.targetIqn; + } + + /** + * Set the targetIqn property: iSCSI Target IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:server". + * + * @param targetIqn the targetIqn value to set. + * @return the IscsiTargetCreate object itself. + */ + public IscsiTargetCreate withTargetIqn(String targetIqn) { + this.targetIqn = targetIqn; + return this; + } + + /** + * Get the staticAcls property: Access Control List (ACL) for an iSCSI Target; defines LUN masking policy. + * + * @return the staticAcls value. + */ + public List staticAcls() { + return this.staticAcls; + } + + /** + * Set the staticAcls property: Access Control List (ACL) for an iSCSI Target; defines LUN masking policy. + * + * @param staticAcls the staticAcls value to set. + * @return the IscsiTargetCreate object itself. + */ + public IscsiTargetCreate withStaticAcls(List staticAcls) { + this.staticAcls = staticAcls; + return this; + } + + /** + * Get the luns property: List of LUNs to be exposed through iSCSI Target. + * + * @return the luns value. + */ + public List luns() { + return this.luns; + } + + /** + * Set the luns property: List of LUNs to be exposed through iSCSI Target. + * + * @param luns the luns value to set. + * @return the IscsiTargetCreate object itself. + */ + public IscsiTargetCreate withLuns(List luns) { + this.luns = luns; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (aclMode() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property aclMode in model IscsiTargetCreate")); + } + if (staticAcls() != null) { + staticAcls().forEach(e -> e.validate()); + } + if (luns() != null) { + luns().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/IscsiTargetList.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/IscsiTargetList.java new file mode 100644 index 0000000000000..9eafd75eaccf5 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/IscsiTargetList.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.storagepool.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagepool.fluent.models.IscsiTargetInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of iSCSI Targets. */ +@Fluent +public final class IscsiTargetList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IscsiTargetList.class); + + /* + * An array of iSCSI Targets in a Disk Pool. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * URI to fetch the next section of the paginated response. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: An array of iSCSI Targets in a Disk Pool. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of iSCSI Targets in a Disk Pool. + * + * @param value the value value to set. + * @return the IscsiTargetList object itself. + */ + public IscsiTargetList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URI to fetch the next section of the paginated response. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model IscsiTargetList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/IscsiTargetUpdate.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/IscsiTargetUpdate.java new file mode 100644 index 0000000000000..3ef2ce25aaf18 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/IscsiTargetUpdate.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.storagepool.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; + +/** Payload for iSCSI Target update requests. */ +@JsonFlatten +@Fluent +public class IscsiTargetUpdate extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IscsiTargetUpdate.class); + + /* + * Access Control List (ACL) for an iSCSI Target; defines LUN masking + * policy + */ + @JsonProperty(value = "properties.staticAcls") + private List staticAcls; + + /* + * List of LUNs to be exposed through iSCSI Target. + */ + @JsonProperty(value = "properties.luns") + private List luns; + + /** + * Get the staticAcls property: Access Control List (ACL) for an iSCSI Target; defines LUN masking policy. + * + * @return the staticAcls value. + */ + public List staticAcls() { + return this.staticAcls; + } + + /** + * Set the staticAcls property: Access Control List (ACL) for an iSCSI Target; defines LUN masking policy. + * + * @param staticAcls the staticAcls value to set. + * @return the IscsiTargetUpdate object itself. + */ + public IscsiTargetUpdate withStaticAcls(List staticAcls) { + this.staticAcls = staticAcls; + return this; + } + + /** + * Get the luns property: List of LUNs to be exposed through iSCSI Target. + * + * @return the luns value. + */ + public List luns() { + return this.luns; + } + + /** + * Set the luns property: List of LUNs to be exposed through iSCSI Target. + * + * @param luns the luns value to set. + * @return the IscsiTargetUpdate object itself. + */ + public IscsiTargetUpdate withLuns(List luns) { + this.luns = luns; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (staticAcls() != null) { + staticAcls().forEach(e -> e.validate()); + } + if (luns() != null) { + luns().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/IscsiTargets.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/IscsiTargets.java new file mode 100644 index 0000000000000..2441e5849dc1e --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/IscsiTargets.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagepool.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 IscsiTargets. */ +public interface IscsiTargets { + /** + * Get iSCSI Targets in a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return iSCSI Targets in a Disk pool. + */ + PagedIterable listByDiskPool(String resourceGroupName, String diskPoolName); + + /** + * Get iSCSI Targets in a Disk pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return iSCSI Targets in a Disk pool. + */ + PagedIterable listByDiskPool(String resourceGroupName, String diskPoolName, Context context); + + /** + * Delete an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 diskPoolName, String iscsiTargetName); + + /** + * Delete an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 diskPoolName, String iscsiTargetName, Context context); + + /** + * Get an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an iSCSI Target. + */ + IscsiTarget get(String resourceGroupName, String diskPoolName, String iscsiTargetName); + + /** + * Get an iSCSI Target. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param diskPoolName The name of the Disk Pool. + * @param iscsiTargetName The name of the iSCSI Target. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an iSCSI Target. + */ + Response getWithResponse( + String resourceGroupName, String diskPoolName, String iscsiTargetName, Context context); + + /** + * Get an iSCSI Target. + * + * @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 an iSCSI Target. + */ + IscsiTarget getById(String id); + + /** + * Get an iSCSI Target. + * + * @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 an iSCSI Target. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete an iSCSI Target. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete an iSCSI Target. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new IscsiTarget resource. + * + * @param name resource name. + * @return the first stage of the new IscsiTarget definition. + */ + IscsiTarget.DefinitionStages.Blank define(String name); +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/OperationalStatus.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/OperationalStatus.java new file mode 100644 index 0000000000000..3ed5ae719afab --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/OperationalStatus.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.storagepool.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OperationalStatus. */ +public final class OperationalStatus extends ExpandableStringEnum { + /** Static value Invalid for OperationalStatus. */ + public static final OperationalStatus INVALID = fromString("Invalid"); + + /** Static value Unknown for OperationalStatus. */ + public static final OperationalStatus UNKNOWN = fromString("Unknown"); + + /** Static value Healthy for OperationalStatus. */ + public static final OperationalStatus HEALTHY = fromString("Healthy"); + + /** Static value Unhealthy for OperationalStatus. */ + public static final OperationalStatus UNHEALTHY = fromString("Unhealthy"); + + /** Static value Updating for OperationalStatus. */ + public static final OperationalStatus UPDATING = fromString("Updating"); + + /** Static value Running for OperationalStatus. */ + public static final OperationalStatus RUNNING = fromString("Running"); + + /** Static value Stopped for OperationalStatus. */ + public static final OperationalStatus STOPPED = fromString("Stopped"); + + /** Static value Stopped (deallocated) for OperationalStatus. */ + public static final OperationalStatus STOPPED_DEALLOCATED = fromString("Stopped (deallocated)"); + + /** + * Creates or finds a OperationalStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationalStatus. + */ + @JsonCreator + public static OperationalStatus fromString(String name) { + return fromString(name, OperationalStatus.class); + } + + /** @return known OperationalStatus values. */ + public static Collection values() { + return values(OperationalStatus.class); + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/Operations.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/Operations.java new file mode 100644 index 0000000000000..4daf2761c9724 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/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.storagepool.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Gets a list of StoragePool 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 a list of StoragePool operations. + */ + PagedIterable list(); + + /** + * Gets a list of StoragePool 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 a list of StoragePool operations. + */ + PagedIterable list(Context context); +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/OutboundEnvironmentEndpoint.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/OutboundEnvironmentEndpoint.java new file mode 100644 index 0000000000000..9a7af29c47a91 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/OutboundEnvironmentEndpoint.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.storagepool.models; + +import com.azure.resourcemanager.storagepool.fluent.models.OutboundEnvironmentEndpointInner; +import java.util.List; + +/** An immutable client-side representation of OutboundEnvironmentEndpoint. */ +public interface OutboundEnvironmentEndpoint { + /** + * Gets the category property: The type of service accessed by the App Service Environment, e.g., Azure Storage, + * Azure SQL Database, and Azure Active Directory. + * + * @return the category value. + */ + String category(); + + /** + * Gets the endpoints property: The endpoints that the App Service Environment reaches the service at. + * + * @return the endpoints value. + */ + List endpoints(); + + /** + * Gets the inner com.azure.resourcemanager.storagepool.fluent.models.OutboundEnvironmentEndpointInner object. + * + * @return the inner object. + */ + OutboundEnvironmentEndpointInner innerModel(); +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/OutboundEnvironmentEndpointList.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/OutboundEnvironmentEndpointList.java new file mode 100644 index 0000000000000..e320e9900503a --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/OutboundEnvironmentEndpointList.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.storagepool.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagepool.fluent.models.OutboundEnvironmentEndpointInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of Outbound Environment Endpoints. */ +@Fluent +public final class OutboundEnvironmentEndpointList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OutboundEnvironmentEndpointList.class); + + /* + * Collection of resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * Link to next page of resources. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Collection of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resources. + * + * @param value the value value to set. + * @return the OutboundEnvironmentEndpointList object itself. + */ + public OutboundEnvironmentEndpointList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model OutboundEnvironmentEndpointList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/ProvisioningStates.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/ProvisioningStates.java new file mode 100644 index 0000000000000..d40ef5e1cb6ba --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/ProvisioningStates.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.storagepool.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProvisioningStates. */ +public final class ProvisioningStates extends ExpandableStringEnum { + /** Static value Invalid for ProvisioningStates. */ + public static final ProvisioningStates INVALID = fromString("Invalid"); + + /** Static value Succeeded for ProvisioningStates. */ + public static final ProvisioningStates SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningStates. */ + public static final ProvisioningStates FAILED = fromString("Failed"); + + /** Static value Canceled for ProvisioningStates. */ + public static final ProvisioningStates CANCELED = fromString("Canceled"); + + /** Static value Pending for ProvisioningStates. */ + public static final ProvisioningStates PENDING = fromString("Pending"); + + /** Static value Creating for ProvisioningStates. */ + public static final ProvisioningStates CREATING = fromString("Creating"); + + /** Static value Updating for ProvisioningStates. */ + public static final ProvisioningStates UPDATING = fromString("Updating"); + + /** Static value Deleting for ProvisioningStates. */ + public static final ProvisioningStates DELETING = fromString("Deleting"); + + /** + * Creates or finds a ProvisioningStates from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningStates. + */ + @JsonCreator + public static ProvisioningStates fromString(String name) { + return fromString(name, ProvisioningStates.class); + } + + /** @return known ProvisioningStates values. */ + public static Collection values() { + return values(ProvisioningStates.class); + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/Sku.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/Sku.java new file mode 100644 index 0000000000000..99d600d65a0ff --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/Sku.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagepool.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; + +/** Sku for ARM resource. */ +@Fluent +public final class Sku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); + + /* + * Sku name + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Sku tier + */ + @JsonProperty(value = "tier") + private String tier; + + /** + * Get the name property: Sku name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Sku name. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: Sku tier. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: Sku tier. + * + * @param tier the tier value to set. + * @return the Sku object itself. + */ + public Sku withTier(String tier) { + this.tier = tier; + 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 Sku")); + } + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/StoragePoolOperationDisplay.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/StoragePoolOperationDisplay.java new file mode 100644 index 0000000000000..25fa26296052f --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/StoragePoolOperationDisplay.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagepool.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; + +/** Metadata about an operation. */ +@Fluent +public final class StoragePoolOperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StoragePoolOperationDisplay.class); + + /* + * Localized friendly form of the resource provider name. + */ + @JsonProperty(value = "provider", required = true) + private String provider; + + /* + * Localized friendly form of the resource type related to this + * action/operation. + */ + @JsonProperty(value = "resource", required = true) + private String resource; + + /* + * Localized friendly name for the operation, as it should be shown to the + * user. + */ + @JsonProperty(value = "operation", required = true) + private String operation; + + /* + * Localized friendly description for the operation, as it should be shown + * to the user. + */ + @JsonProperty(value = "description", required = true) + private String description; + + /** + * Get the provider property: Localized friendly form of the resource provider name. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Localized friendly form of the resource provider name. + * + * @param provider the provider value to set. + * @return the StoragePoolOperationDisplay object itself. + */ + public StoragePoolOperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: Localized friendly form of the resource type related to this action/operation. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Localized friendly form of the resource type related to this action/operation. + * + * @param resource the resource value to set. + * @return the StoragePoolOperationDisplay object itself. + */ + public StoragePoolOperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: Localized friendly name for the operation, as it should be shown to the user. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Localized friendly name for the operation, as it should be shown to the user. + * + * @param operation the operation value to set. + * @return the StoragePoolOperationDisplay object itself. + */ + public StoragePoolOperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: Localized friendly description for the operation, as it should be shown to the + * user. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Localized friendly description for the operation, as it should be shown to the + * user. + * + * @param description the description value to set. + * @return the StoragePoolOperationDisplay object itself. + */ + public StoragePoolOperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (provider() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property provider in model StoragePoolOperationDisplay")); + } + if (resource() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property resource in model StoragePoolOperationDisplay")); + } + if (operation() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property operation in model StoragePoolOperationDisplay")); + } + if (description() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property description in model StoragePoolOperationDisplay")); + } + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/StoragePoolOperationListResult.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/StoragePoolOperationListResult.java new file mode 100644 index 0000000000000..866b73a8237c1 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/StoragePoolOperationListResult.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.storagepool.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagepool.fluent.models.StoragePoolRPOperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of operations supported by the RP. */ +@Fluent +public final class StoragePoolOperationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StoragePoolOperationListResult.class); + + /* + * An array of operations supported by the StoragePool RP. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * URI to fetch the next section of the paginated response. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: An array of operations supported by the StoragePool RP. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of operations supported by the StoragePool RP. + * + * @param value the value value to set. + * @return the StoragePoolOperationListResult object itself. + */ + public StoragePoolOperationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URI to fetch the next section of the paginated response. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URI to fetch the next section of the paginated response. + * + * @param nextLink the nextLink value to set. + * @return the StoragePoolOperationListResult object itself. + */ + public StoragePoolOperationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model StoragePoolOperationListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/StoragePoolRPOperation.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/StoragePoolRPOperation.java new file mode 100644 index 0000000000000..7b15db8f97ed4 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/StoragePoolRPOperation.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.storagepool.models; + +import com.azure.resourcemanager.storagepool.fluent.models.StoragePoolRPOperationInner; + +/** An immutable client-side representation of StoragePoolRPOperation. */ +public interface StoragePoolRPOperation { + /** + * Gets the name property: The name of the operation being performed on this particular object. + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Indicates whether the operation applies to data-plane. + * + * @return the isDataAction value. + */ + boolean isDataAction(); + + /** + * Gets the actionType property: Indicates the action type. + * + * @return the actionType value. + */ + String actionType(); + + /** + * Gets the display property: Additional metadata about RP operation. + * + * @return the display value. + */ + StoragePoolOperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; governs the display of the operation in the + * RBAC UX and the audit logs UX. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the inner com.azure.resourcemanager.storagepool.fluent.models.StoragePoolRPOperationInner object. + * + * @return the inner object. + */ + StoragePoolRPOperationInner innerModel(); +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/SystemMetadata.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/SystemMetadata.java new file mode 100644 index 0000000000000..f8eb3a2837a74 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/SystemMetadata.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagepool.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; + +/** Metadata pertaining to creation and last modification of the resource. */ +@Fluent +public final class SystemMetadata { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SystemMetadata.class); + + /* + * The identity that created the resource. + */ + @JsonProperty(value = "createdBy") + private String createdBy; + + /* + * The type of identity that created the resource. + */ + @JsonProperty(value = "createdByType") + private CreatedByType createdByType; + + /* + * The timestamp of resource creation (UTC). + */ + @JsonProperty(value = "createdAt") + private OffsetDateTime createdAt; + + /* + * The identity that last modified the resource. + */ + @JsonProperty(value = "lastModifiedBy") + private String lastModifiedBy; + + /* + * The type of identity that last modified the resource. + */ + @JsonProperty(value = "lastModifiedByType") + private CreatedByType lastModifiedByType; + + /* + * The type of identity that last modified the resource. + */ + @JsonProperty(value = "lastModifiedAt") + private OffsetDateTime lastModifiedAt; + + /** + * Get the createdBy property: The identity that created the resource. + * + * @return the createdBy value. + */ + public String createdBy() { + return this.createdBy; + } + + /** + * Set the createdBy property: The identity that created the resource. + * + * @param createdBy the createdBy value to set. + * @return the SystemMetadata object itself. + */ + public SystemMetadata withCreatedBy(String createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Get the createdByType property: The type of identity that created the resource. + * + * @return the createdByType value. + */ + public CreatedByType createdByType() { + return this.createdByType; + } + + /** + * Set the createdByType property: The type of identity that created the resource. + * + * @param createdByType the createdByType value to set. + * @return the SystemMetadata object itself. + */ + public SystemMetadata withCreatedByType(CreatedByType createdByType) { + this.createdByType = createdByType; + return this; + } + + /** + * Get the createdAt property: The timestamp of resource creation (UTC). + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Set the createdAt property: The timestamp of resource creation (UTC). + * + * @param createdAt the createdAt value to set. + * @return the SystemMetadata object itself. + */ + public SystemMetadata withCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get the lastModifiedBy property: The identity that last modified the resource. + * + * @return the lastModifiedBy value. + */ + public String lastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * Set the lastModifiedBy property: The identity that last modified the resource. + * + * @param lastModifiedBy the lastModifiedBy value to set. + * @return the SystemMetadata object itself. + */ + public SystemMetadata withLastModifiedBy(String lastModifiedBy) { + this.lastModifiedBy = lastModifiedBy; + return this; + } + + /** + * Get the lastModifiedByType property: The type of identity that last modified the resource. + * + * @return the lastModifiedByType value. + */ + public CreatedByType lastModifiedByType() { + return this.lastModifiedByType; + } + + /** + * Set the lastModifiedByType property: The type of identity that last modified the resource. + * + * @param lastModifiedByType the lastModifiedByType value to set. + * @return the SystemMetadata object itself. + */ + public SystemMetadata withLastModifiedByType(CreatedByType lastModifiedByType) { + this.lastModifiedByType = lastModifiedByType; + return this; + } + + /** + * Get the lastModifiedAt property: The type of identity that last modified the resource. + * + * @return the lastModifiedAt value. + */ + public OffsetDateTime lastModifiedAt() { + return this.lastModifiedAt; + } + + /** + * Set the lastModifiedAt property: The type of identity that last modified the resource. + * + * @param lastModifiedAt the lastModifiedAt value to set. + * @return the SystemMetadata object itself. + */ + public SystemMetadata withLastModifiedAt(OffsetDateTime lastModifiedAt) { + this.lastModifiedAt = lastModifiedAt; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/package-info.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/models/package-info.java new file mode 100644 index 0000000000000..aab6bf5d6cdd1 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/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 StoragePoolManagement. null. */ +package com.azure.resourcemanager.storagepool.models; diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/package-info.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/package-info.java new file mode 100644 index 0000000000000..ec28d9efac769 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/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 StoragePoolManagement. null. */ +package com.azure.resourcemanager.storagepool; diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/module-info.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/module-info.java new file mode 100644 index 0000000000000..7abdada97b314 --- /dev/null +++ b/sdk/storagepool/azure-resourcemanager-storagepool/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.storagepool { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.storagepool; + exports com.azure.resourcemanager.storagepool.fluent; + exports com.azure.resourcemanager.storagepool.fluent.models; + exports com.azure.resourcemanager.storagepool.models; + + opens com.azure.resourcemanager.storagepool.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.storagepool.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/storagepool/ci.yml b/sdk/storagepool/ci.yml new file mode 100644 index 0000000000000..233cdf5af9b00 --- /dev/null +++ b/sdk/storagepool/ci.yml @@ -0,0 +1,33 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - master + - main + - hotfix/* + - release/* + paths: + include: + - sdk/storagepool/ + +pr: + branches: + include: + - master + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagepool/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: storagepool + Artifacts: + - name: azure-resourcemanager-storagepool + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerstoragepool diff --git a/sdk/storagepool/pom.xml b/sdk/storagepool/pom.xml new file mode 100644 index 0000000000000..bec7e527cb0e4 --- /dev/null +++ b/sdk/storagepool/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-storagepool-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-storagepool + + + +