diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 162b0b666abe..a93e733ce8d6 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -202,6 +202,7 @@ com.azure.resourcemanager:azure-resourcemanager-healthbot;1.0.0-beta.1;1.0.0-bet com.azure.resourcemanager:azure-resourcemanager-confluent;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-digitaltwins;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-netapp;1.0.0-beta.1;1.0.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-datalakeanalytics;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 4c02855979a4..5ea1a5f56036 100644 --- a/pom.xml +++ b/pom.xml @@ -579,6 +579,7 @@ sdk/core sdk/cosmos sdk/costmanagement + sdk/datalakeanalytics sdk/digitaltwins sdk/eventgrid sdk/eventhubs diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/CHANGELOG.md b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/CHANGELOG.md new file mode 100644 index 000000000000..68520d8ea6ef --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-02-21) + +- Azure Resource Manager DataLakeAnalytics client library for Java. This package contains Microsoft Azure SDK for DataLakeAnalytics Management SDK. Creates an Azure Data Lake Analytics account management client. Package tag package-2016-11. 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/datalakeanalytics/azure-resourcemanager-datalakeanalytics/README.md b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/README.md new file mode 100644 index 000000000000..e65c25b21166 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/README.md @@ -0,0 +1,99 @@ +# Azure Resource Manager DataLakeAnalytics client library for Java + +Azure Resource Manager DataLakeAnalytics client library for Java. + +This package contains Microsoft Azure SDK for DataLakeAnalytics Management SDK. Creates an Azure Data Lake Analytics account management client. Package tag package-2016-11. 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-datalakeanalytics;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-datalakeanalytics + 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(); +DataLakeAnalyticsManager manager = DataLakeAnalyticsManager + .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/datalakeanalytics/azure-resourcemanager-datalakeanalytics/pom.xml b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/pom.xml new file mode 100644 index 000000000000..f4627fc5016b --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/pom.xml @@ -0,0 +1,67 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-datalakeanalytics + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for DataLakeAnalytics Management + This package contains Microsoft Azure SDK for DataLakeAnalytics Management SDK. Creates an Azure Data Lake Analytics account management client. Package tag package-2016-11. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt + 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.13.0 + + + com.azure + azure-core-management + 1.1.1 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + + diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/DataLakeAnalyticsManager.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/DataLakeAnalyticsManager.java new file mode 100644 index 000000000000..6762feba4d8d --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/DataLakeAnalyticsManager.java @@ -0,0 +1,286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics; + +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.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datalakeanalytics.fluent.DataLakeAnalyticsAccountManagementClient; +import com.azure.resourcemanager.datalakeanalytics.implementation.AccountsImpl; +import com.azure.resourcemanager.datalakeanalytics.implementation.ComputePoliciesImpl; +import com.azure.resourcemanager.datalakeanalytics.implementation.DataLakeAnalyticsAccountManagementClientBuilder; +import com.azure.resourcemanager.datalakeanalytics.implementation.DataLakeStoreAccountsImpl; +import com.azure.resourcemanager.datalakeanalytics.implementation.FirewallRulesImpl; +import com.azure.resourcemanager.datalakeanalytics.implementation.LocationsImpl; +import com.azure.resourcemanager.datalakeanalytics.implementation.OperationsImpl; +import com.azure.resourcemanager.datalakeanalytics.implementation.StorageAccountsImpl; +import com.azure.resourcemanager.datalakeanalytics.models.Accounts; +import com.azure.resourcemanager.datalakeanalytics.models.ComputePolicies; +import com.azure.resourcemanager.datalakeanalytics.models.DataLakeStoreAccounts; +import com.azure.resourcemanager.datalakeanalytics.models.FirewallRules; +import com.azure.resourcemanager.datalakeanalytics.models.Locations; +import com.azure.resourcemanager.datalakeanalytics.models.Operations; +import com.azure.resourcemanager.datalakeanalytics.models.StorageAccounts; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to DataLakeAnalyticsManager. Creates an Azure Data Lake Analytics account management client. */ +public final class DataLakeAnalyticsManager { + private Accounts accounts; + + private DataLakeStoreAccounts dataLakeStoreAccounts; + + private StorageAccounts storageAccounts; + + private ComputePolicies computePolicies; + + private FirewallRules firewallRules; + + private Operations operations; + + private Locations locations; + + private final DataLakeAnalyticsAccountManagementClient clientObject; + + private DataLakeAnalyticsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new DataLakeAnalyticsAccountManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of DataLakeAnalytics service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the DataLakeAnalytics service API instance. + */ + public static DataLakeAnalyticsManager 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 DataLakeAnalyticsManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new DataLakeAnalyticsManager.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 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; + } + + /** + * 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 DataLakeAnalytics service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the DataLakeAnalytics service API instance. + */ + public DataLakeAnalyticsManager 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.datalakeanalytics") + .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 (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 BearerTokenAuthenticationPolicy( + credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new DataLakeAnalyticsManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of Accounts. */ + public Accounts accounts() { + if (this.accounts == null) { + this.accounts = new AccountsImpl(clientObject.getAccounts(), this); + } + return accounts; + } + + /** @return Resource collection API of DataLakeStoreAccounts. */ + public DataLakeStoreAccounts dataLakeStoreAccounts() { + if (this.dataLakeStoreAccounts == null) { + this.dataLakeStoreAccounts = new DataLakeStoreAccountsImpl(clientObject.getDataLakeStoreAccounts(), this); + } + return dataLakeStoreAccounts; + } + + /** @return Resource collection API of StorageAccounts. */ + public StorageAccounts storageAccounts() { + if (this.storageAccounts == null) { + this.storageAccounts = new StorageAccountsImpl(clientObject.getStorageAccounts(), this); + } + return storageAccounts; + } + + /** @return Resource collection API of ComputePolicies. */ + public ComputePolicies computePolicies() { + if (this.computePolicies == null) { + this.computePolicies = new ComputePoliciesImpl(clientObject.getComputePolicies(), this); + } + return computePolicies; + } + + /** @return Resource collection API of FirewallRules. */ + public FirewallRules firewallRules() { + if (this.firewallRules == null) { + this.firewallRules = new FirewallRulesImpl(clientObject.getFirewallRules(), this); + } + return firewallRules; + } + + /** @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 Locations. */ + public Locations locations() { + if (this.locations == null) { + this.locations = new LocationsImpl(clientObject.getLocations(), this); + } + return locations; + } + + /** + * @return Wrapped service client DataLakeAnalyticsAccountManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public DataLakeAnalyticsAccountManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/AccountsClient.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/AccountsClient.java new file mode 100644 index 000000000000..cd23fbc6154b --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/AccountsClient.java @@ -0,0 +1,377 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.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.datalakeanalytics.fluent.models.DataLakeAnalyticsAccountBasicInner; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.DataLakeAnalyticsAccountInner; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.NameAvailabilityInformationInner; +import com.azure.resourcemanager.datalakeanalytics.models.CheckNameAvailabilityParameters; +import com.azure.resourcemanager.datalakeanalytics.models.CreateDataLakeAnalyticsAccountParameters; +import com.azure.resourcemanager.datalakeanalytics.models.UpdateDataLakeAnalyticsAccountParameters; + +/** An instance of this class provides access to all the operations defined in AccountsClient. */ +public interface AccountsClient { + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a + * link to the next page, if any. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Analytics accounts, if any, within the current subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a + * link to the next page, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Analytics accounts, if any, within the current subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String filter, Integer top, Integer skip, String select, String orderby, Boolean count, Context context); + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a + * link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Analytics accounts, if any, within a specific resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a + * link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Analytics accounts, if any, within a specific resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String resourceGroupName, + String filter, + Integer top, + Integer skip, + String select, + String orderby, + Boolean count, + Context context); + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake + * Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to create a new Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataLakeAnalyticsAccountInner> beginCreate( + String resourceGroupName, String accountName, CreateDataLakeAnalyticsAccountParameters parameters); + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake + * Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to create a new Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataLakeAnalyticsAccountInner> beginCreate( + String resourceGroupName, + String accountName, + CreateDataLakeAnalyticsAccountParameters parameters, + Context context); + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake + * Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to create a new Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataLakeAnalyticsAccountInner create( + String resourceGroupName, String accountName, CreateDataLakeAnalyticsAccountParameters parameters); + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake + * Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to create a new Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataLakeAnalyticsAccountInner create( + String resourceGroupName, + String accountName, + CreateDataLakeAnalyticsAccountParameters parameters, + Context context); + + /** + * Gets details of the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataLakeAnalyticsAccountInner getByResourceGroup(String resourceGroupName, String accountName); + + /** + * Gets details of the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, Context context); + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account + * object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataLakeAnalyticsAccountInner> beginUpdate( + String resourceGroupName, String accountName, UpdateDataLakeAnalyticsAccountParameters parameters); + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account + * object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to the update Data Lake Analytics account 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 a Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataLakeAnalyticsAccountInner> beginUpdate( + String resourceGroupName, + String accountName, + UpdateDataLakeAnalyticsAccountParameters parameters, + Context context); + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account + * object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataLakeAnalyticsAccountInner update( + String resourceGroupName, String accountName, UpdateDataLakeAnalyticsAccountParameters parameters); + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account + * object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataLakeAnalyticsAccountInner update(String resourceGroupName, String accountName); + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account + * object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to the update Data Lake Analytics account 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 a Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataLakeAnalyticsAccountInner update( + String resourceGroupName, + String accountName, + UpdateDataLakeAnalyticsAccountParameters parameters, + Context context); + + /** + * Begins the delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName); + + /** + * Begins the delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, Context context); + + /** + * Begins the delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName); + + /** + * Begins the delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, Context context); + + /** + * Checks whether the specified account name is available or taken. + * + * @param location The resource location without whitespace. + * @param parameters Parameters supplied to check the Data Lake Analytics account name availability. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics account name availability result information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NameAvailabilityInformationInner checkNameAvailability(String location, CheckNameAvailabilityParameters parameters); + + /** + * Checks whether the specified account name is available or taken. + * + * @param location The resource location without whitespace. + * @param parameters Parameters supplied to check the Data Lake Analytics account name availability. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics account name availability result information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String location, CheckNameAvailabilityParameters parameters, Context context); +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/ComputePoliciesClient.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/ComputePoliciesClient.java new file mode 100644 index 000000000000..eefc03eda57b --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/ComputePoliciesClient.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.ComputePolicyInner; +import com.azure.resourcemanager.datalakeanalytics.models.CreateOrUpdateComputePolicyParameters; +import com.azure.resourcemanager.datalakeanalytics.models.UpdateComputePolicyParameters; + +/** An instance of this class provides access to all the operations defined in ComputePoliciesClient. */ +public interface ComputePoliciesClient { + /** + * Lists the Data Lake Analytics compute policies within the specified Data Lake Analytics account. An account + * supports, at most, 50 policies. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of compute policies in the account. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByAccount(String resourceGroupName, String accountName); + + /** + * Lists the Data Lake Analytics compute policies within the specified Data Lake Analytics account. An account + * supports, at most, 50 policies. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of compute policies in the account. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByAccount(String resourceGroupName, String accountName, Context context); + + /** + * Creates or updates the specified compute policy. During update, the compute policy with the specified name will + * be replaced with this new compute policy. An account supports, at most, 50 policies. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to create or update. + * @param parameters Parameters supplied to create or update the compute policy. The max degree of parallelism per + * job property, min priority per job property, or both must be present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics compute policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ComputePolicyInner createOrUpdate( + String resourceGroupName, + String accountName, + String computePolicyName, + CreateOrUpdateComputePolicyParameters parameters); + + /** + * Creates or updates the specified compute policy. During update, the compute policy with the specified name will + * be replaced with this new compute policy. An account supports, at most, 50 policies. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to create or update. + * @param parameters Parameters supplied to create or update the compute policy. The max degree of parallelism per + * job property, min priority per job property, or both must be present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics compute policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + String computePolicyName, + CreateOrUpdateComputePolicyParameters parameters, + Context context); + + /** + * Gets the specified Data Lake Analytics compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Analytics compute policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ComputePolicyInner get(String resourceGroupName, String accountName, String computePolicyName); + + /** + * Gets the specified Data Lake Analytics compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Analytics compute policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String computePolicyName, Context context); + + /** + * Updates the specified compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics compute policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ComputePolicyInner update(String resourceGroupName, String accountName, String computePolicyName); + + /** + * Updates the specified compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to update. + * @param parameters Parameters supplied to update the compute policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics compute policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String accountName, + String computePolicyName, + UpdateComputePolicyParameters parameters, + Context context); + + /** + * Deletes the specified compute policy from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String computePolicyName); + + /** + * Deletes the specified compute policy from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String accountName, String computePolicyName, Context context); +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/DataLakeAnalyticsAccountManagementClient.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/DataLakeAnalyticsAccountManagementClient.java new file mode 100644 index 000000000000..a57cc71fe069 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/DataLakeAnalyticsAccountManagementClient.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for DataLakeAnalyticsAccountManagementClient class. */ +public interface DataLakeAnalyticsAccountManagementClient { + /** + * Gets Get subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @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 AccountsClient object to access its operations. + * + * @return the AccountsClient object. + */ + AccountsClient getAccounts(); + + /** + * Gets the DataLakeStoreAccountsClient object to access its operations. + * + * @return the DataLakeStoreAccountsClient object. + */ + DataLakeStoreAccountsClient getDataLakeStoreAccounts(); + + /** + * Gets the StorageAccountsClient object to access its operations. + * + * @return the StorageAccountsClient object. + */ + StorageAccountsClient getStorageAccounts(); + + /** + * Gets the ComputePoliciesClient object to access its operations. + * + * @return the ComputePoliciesClient object. + */ + ComputePoliciesClient getComputePolicies(); + + /** + * Gets the FirewallRulesClient object to access its operations. + * + * @return the FirewallRulesClient object. + */ + FirewallRulesClient getFirewallRules(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the LocationsClient object to access its operations. + * + * @return the LocationsClient object. + */ + LocationsClient getLocations(); +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/DataLakeStoreAccountsClient.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/DataLakeStoreAccountsClient.java new file mode 100644 index 000000000000..bd8c5cffa5b3 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/DataLakeStoreAccountsClient.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.DataLakeStoreAccountInformationInner; +import com.azure.resourcemanager.datalakeanalytics.models.AddDataLakeStoreParameters; + +/** An instance of this class provides access to all the operations defined in DataLakeStoreAccountsClient. */ +public interface DataLakeStoreAccountsClient { + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response + * includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByAccount(String resourceGroupName, String accountName); + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response + * includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByAccount( + String resourceGroupName, + String accountName, + String filter, + Integer top, + Integer skip, + String select, + String orderby, + Boolean count, + Context context); + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 add(String resourceGroupName, String accountName, String dataLakeStoreAccountName); + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @param parameters The details of the Data Lake Store account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response addWithResponse( + String resourceGroupName, + String accountName, + String dataLakeStoreAccountName, + AddDataLakeStoreParameters parameters, + Context context); + + /** + * Gets the specified Data Lake Store account details in the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Store account details in the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataLakeStoreAccountInformationInner get( + String resourceGroupName, String accountName, String dataLakeStoreAccountName); + + /** + * Gets the specified Data Lake Store account details in the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Store account details in the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String dataLakeStoreAccountName, Context context); + + /** + * Updates the Data Lake Analytics account specified to remove the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String dataLakeStoreAccountName); + + /** + * Updates the Data Lake Analytics account specified to remove the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String accountName, String dataLakeStoreAccountName, Context context); +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/FirewallRulesClient.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/FirewallRulesClient.java new file mode 100644 index 000000000000..6d51824b9901 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/FirewallRulesClient.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.FirewallRuleInner; +import com.azure.resourcemanager.datalakeanalytics.models.CreateOrUpdateFirewallRuleParameters; +import com.azure.resourcemanager.datalakeanalytics.models.UpdateFirewallRuleParameters; + +/** An instance of this class provides access to all the operations defined in FirewallRulesClient. */ +public interface FirewallRulesClient { + /** + * Lists the Data Lake Analytics firewall rules within the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics firewall rule list information. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByAccount(String resourceGroupName, String accountName); + + /** + * Lists the Data Lake Analytics firewall rules within the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics firewall rule list information. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByAccount(String resourceGroupName, String accountName, Context context); + + /** + * Creates or updates the specified firewall rule. During update, the firewall rule with the specified name will be + * replaced with this new firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to create or update. + * @param parameters Parameters supplied to create or update the firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics firewall rule information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FirewallRuleInner createOrUpdate( + String resourceGroupName, + String accountName, + String firewallRuleName, + CreateOrUpdateFirewallRuleParameters parameters); + + /** + * Creates or updates the specified firewall rule. During update, the firewall rule with the specified name will be + * replaced with this new firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to create or update. + * @param parameters Parameters supplied to create or update the firewall rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics firewall rule information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + String firewallRuleName, + CreateOrUpdateFirewallRuleParameters parameters, + Context context); + + /** + * Gets the specified Data Lake Analytics firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Analytics firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FirewallRuleInner get(String resourceGroupName, String accountName, String firewallRuleName); + + /** + * Gets the specified Data Lake Analytics firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Analytics firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String firewallRuleName, Context context); + + /** + * Updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics firewall rule information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FirewallRuleInner update(String resourceGroupName, String accountName, String firewallRuleName); + + /** + * Updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to update. + * @param parameters Parameters supplied to update the firewall rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics firewall rule information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String accountName, + String firewallRuleName, + UpdateFirewallRuleParameters parameters, + Context context); + + /** + * Deletes the specified firewall rule from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String firewallRuleName); + + /** + * Deletes the specified firewall rule from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String accountName, String firewallRuleName, Context context); +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/LocationsClient.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/LocationsClient.java new file mode 100644 index 000000000000..5a3bd9ba1e02 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/LocationsClient.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.datalakeanalytics.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.CapabilityInformationInner; + +/** An instance of this class provides access to all the operations defined in LocationsClient. */ +public interface LocationsClient { + /** + * Gets subscription-level properties and limits for Data Lake Analytics specified by resource location. + * + * @param location The resource location without whitespace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription-level properties and limits for Data Lake Analytics specified by resource location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapabilityInformationInner getCapability(String location); + + /** + * Gets subscription-level properties and limits for Data Lake Analytics specified by resource location. + * + * @param location The resource location without whitespace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription-level properties and limits for Data Lake Analytics specified by resource location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getCapabilityWithResponse(String location, Context context); +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/OperationsClient.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/OperationsClient.java new file mode 100644 index 000000000000..1e94ae172304 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/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.datalakeanalytics.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.OperationListResultInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available Data Lake Analytics REST API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available operations for Data Lake Analytics. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationListResultInner list(); + + /** + * Lists all of the available Data Lake Analytics REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available operations for Data Lake Analytics. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(Context context); +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/StorageAccountsClient.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/StorageAccountsClient.java new file mode 100644 index 000000000000..26952fd73e87 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/StorageAccountsClient.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.SasTokenInformationInner; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.StorageAccountInformationInner; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.StorageContainerInner; +import com.azure.resourcemanager.datalakeanalytics.models.AddStorageAccountParameters; +import com.azure.resourcemanager.datalakeanalytics.models.UpdateStorageAccountParameters; + +/** An instance of this class provides access to all the operations defined in StorageAccountsClient. */ +public interface StorageAccountsClient { + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The + * response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByAccount(String resourceGroupName, String accountName); + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The + * response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param filter The OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByAccount( + String resourceGroupName, + String accountName, + String filter, + Integer top, + Integer skip, + String select, + String orderby, + Boolean count, + Context context); + + /** + * Updates the specified Data Lake Analytics account to add an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to add. + * @param parameters The parameters containing the access key and optional suffix for the Azure Storage Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void add( + String resourceGroupName, + String accountName, + String storageAccountName, + AddStorageAccountParameters parameters); + + /** + * Updates the specified Data Lake Analytics account to add an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to add. + * @param parameters The parameters containing the access key and optional suffix for the Azure Storage Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response addWithResponse( + String resourceGroupName, + String accountName, + String storageAccountName, + AddStorageAccountParameters parameters, + Context context); + + /** + * Gets the specified Azure Storage account linked to the given Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account for which to retrieve the details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Storage account linked to the given Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageAccountInformationInner get(String resourceGroupName, String accountName, String storageAccountName); + + /** + * Gets the specified Azure Storage account linked to the given Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account for which to retrieve the details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Storage account linked to the given Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String accountName, String storageAccountName, Context context); + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key + * and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The Azure Storage account to modify. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 update(String resourceGroupName, String accountName, String storageAccountName); + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key + * and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The Azure Storage account to modify. + * @param parameters The parameters containing the access key and suffix to update the storage account with, if any. + * Passing nothing results in no change. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String accountName, + String storageAccountName, + UpdateStorageAccountParameters parameters, + Context context); + + /** + * Updates the specified Data Lake Analytics account to remove an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String storageAccountName); + + /** + * Updates the specified Data Lake Analytics account to remove an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String accountName, String storageAccountName, Context context); + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage + * account combination. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to list blob containers. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of blob containers associated with the storage account attached to the Data Lake Analytics + * account. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listStorageContainers( + String resourceGroupName, String accountName, String storageAccountName); + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage + * account combination. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to list blob containers. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of blob containers associated with the storage account attached to the Data Lake Analytics + * account. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listStorageContainers( + String resourceGroupName, String accountName, String storageAccountName, Context context); + + /** + * Gets the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage + * accounts. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to retrieve the blob container. + * @param containerName The name of the Azure storage container to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage + * accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageContainerInner getStorageContainer( + String resourceGroupName, String accountName, String storageAccountName, String containerName); + + /** + * Gets the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage + * accounts. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to retrieve the blob container. + * @param containerName The name of the Azure storage container to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage + * accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getStorageContainerWithResponse( + String resourceGroupName, String accountName, String storageAccountName, String containerName, Context context); + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container + * combination. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account for which the SAS token is being requested. + * @param containerName The name of the Azure storage container for which the SAS token is being requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container + * combination. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSasTokens( + String resourceGroupName, String accountName, String storageAccountName, String containerName); + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container + * combination. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account for which the SAS token is being requested. + * @param containerName The name of the Azure storage container for which the SAS token is being requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container + * combination. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSasTokens( + String resourceGroupName, String accountName, String storageAccountName, String containerName, Context context); +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/CapabilityInformationInner.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/CapabilityInformationInner.java new file mode 100644 index 000000000000..e09e2427a088 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/CapabilityInformationInner.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.datalakeanalytics.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datalakeanalytics.models.SubscriptionState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** Subscription-level properties and limits for Data Lake Analytics. */ +@Immutable +public final class CapabilityInformationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CapabilityInformationInner.class); + + /* + * The subscription credentials that uniquely identifies the subscription. + */ + @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) + private UUID subscriptionId; + + /* + * The subscription state. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private SubscriptionState state; + + /* + * The maximum supported number of accounts under this subscription. + */ + @JsonProperty(value = "maxAccountCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer maxAccountCount; + + /* + * The current number of accounts under this subscription. + */ + @JsonProperty(value = "accountCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer accountCount; + + /* + * The Boolean value of true or false to indicate the maintenance state. + */ + @JsonProperty(value = "migrationState", access = JsonProperty.Access.WRITE_ONLY) + private Boolean migrationState; + + /** + * Get the subscriptionId property: The subscription credentials that uniquely identifies the subscription. + * + * @return the subscriptionId value. + */ + public UUID subscriptionId() { + return this.subscriptionId; + } + + /** + * Get the state property: The subscription state. + * + * @return the state value. + */ + public SubscriptionState state() { + return this.state; + } + + /** + * Get the maxAccountCount property: The maximum supported number of accounts under this subscription. + * + * @return the maxAccountCount value. + */ + public Integer maxAccountCount() { + return this.maxAccountCount; + } + + /** + * Get the accountCount property: The current number of accounts under this subscription. + * + * @return the accountCount value. + */ + public Integer accountCount() { + return this.accountCount; + } + + /** + * Get the migrationState property: The Boolean value of true or false to indicate the maintenance state. + * + * @return the migrationState value. + */ + public Boolean migrationState() { + return this.migrationState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/ComputePolicyInner.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/ComputePolicyInner.java new file mode 100644 index 000000000000..7964d5f972b5 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/ComputePolicyInner.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datalakeanalytics.models.AadObjectType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** Data Lake Analytics compute policy information. */ +@JsonFlatten +@Immutable +public class ComputePolicyInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ComputePolicyInner.class); + + /* + * The AAD object identifier for the entity to create a policy for. + */ + @JsonProperty(value = "properties.objectId", access = JsonProperty.Access.WRITE_ONLY) + private UUID objectId; + + /* + * The type of AAD object the object identifier refers to. + */ + @JsonProperty(value = "properties.objectType", access = JsonProperty.Access.WRITE_ONLY) + private AadObjectType objectType; + + /* + * The maximum degree of parallelism per job this user can use to submit + * jobs. + */ + @JsonProperty(value = "properties.maxDegreeOfParallelismPerJob", access = JsonProperty.Access.WRITE_ONLY) + private Integer maxDegreeOfParallelismPerJob; + + /* + * The minimum priority per job this user can use to submit jobs. + */ + @JsonProperty(value = "properties.minPriorityPerJob", access = JsonProperty.Access.WRITE_ONLY) + private Integer minPriorityPerJob; + + /* + * The resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the objectId property: The AAD object identifier for the entity to create a policy for. + * + * @return the objectId value. + */ + public UUID objectId() { + return this.objectId; + } + + /** + * Get the objectType property: The type of AAD object the object identifier refers to. + * + * @return the objectType value. + */ + public AadObjectType objectType() { + return this.objectType; + } + + /** + * Get the maxDegreeOfParallelismPerJob property: The maximum degree of parallelism per job this user can use to + * submit jobs. + * + * @return the maxDegreeOfParallelismPerJob value. + */ + public Integer maxDegreeOfParallelismPerJob() { + return this.maxDegreeOfParallelismPerJob; + } + + /** + * Get the minPriorityPerJob property: The minimum priority per job this user can use to submit jobs. + * + * @return the minPriorityPerJob value. + */ + public Integer minPriorityPerJob() { + return this.minPriorityPerJob; + } + + /** + * Get the name property: The resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** {@inheritDoc} */ + @Override + public ComputePolicyInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/DataLakeAnalyticsAccountBasicInner.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/DataLakeAnalyticsAccountBasicInner.java new file mode 100644 index 000000000000..9d3b0ae18438 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/DataLakeAnalyticsAccountBasicInner.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datalakeanalytics.models.DataLakeAnalyticsAccountState; +import com.azure.resourcemanager.datalakeanalytics.models.DataLakeAnalyticsAccountStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; +import java.util.UUID; + +/** + * A Data Lake Analytics account object, containing all information associated with the named Data Lake Analytics + * account. + */ +@JsonFlatten +@Immutable +public class DataLakeAnalyticsAccountBasicInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataLakeAnalyticsAccountBasicInner.class); + + /* + * The unique identifier associated with this Data Lake Analytics account. + */ + @JsonProperty(value = "properties.accountId", access = JsonProperty.Access.WRITE_ONLY) + private UUID accountId; + + /* + * The provisioning status of the Data Lake Analytics account. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private DataLakeAnalyticsAccountStatus provisioningState; + + /* + * The state of the Data Lake Analytics account. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private DataLakeAnalyticsAccountState state; + + /* + * The account creation time. + */ + @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationTime; + + /* + * The account last modified time. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTime; + + /* + * The full CName endpoint for this account. + */ + @JsonProperty(value = "properties.endpoint", access = JsonProperty.Access.WRITE_ONLY) + private String endpoint; + + /** + * Get the accountId property: The unique identifier associated with this Data Lake Analytics account. + * + * @return the accountId value. + */ + public UUID accountId() { + return this.accountId; + } + + /** + * Get the provisioningState property: The provisioning status of the Data Lake Analytics account. + * + * @return the provisioningState value. + */ + public DataLakeAnalyticsAccountStatus provisioningState() { + return this.provisioningState; + } + + /** + * Get the state property: The state of the Data Lake Analytics account. + * + * @return the state value. + */ + public DataLakeAnalyticsAccountState state() { + return this.state; + } + + /** + * Get the creationTime property: The account creation time. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Get the lastModifiedTime property: The account last modified time. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the endpoint property: The full CName endpoint for this account. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** {@inheritDoc} */ + @Override + public DataLakeAnalyticsAccountBasicInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataLakeAnalyticsAccountBasicInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/DataLakeAnalyticsAccountInner.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/DataLakeAnalyticsAccountInner.java new file mode 100644 index 000000000000..639eb629a068 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/DataLakeAnalyticsAccountInner.java @@ -0,0 +1,568 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.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.datalakeanalytics.models.DataLakeAnalyticsAccountState; +import com.azure.resourcemanager.datalakeanalytics.models.DataLakeAnalyticsAccountStatus; +import com.azure.resourcemanager.datalakeanalytics.models.DebugDataAccessLevel; +import com.azure.resourcemanager.datalakeanalytics.models.FirewallAllowAzureIpsState; +import com.azure.resourcemanager.datalakeanalytics.models.FirewallState; +import com.azure.resourcemanager.datalakeanalytics.models.HiveMetastore; +import com.azure.resourcemanager.datalakeanalytics.models.TierType; +import com.azure.resourcemanager.datalakeanalytics.models.VirtualNetworkRule; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +/** + * A Data Lake Analytics account object, containing all information associated with the named Data Lake Analytics + * account. + */ +@JsonFlatten +@Fluent +public class DataLakeAnalyticsAccountInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataLakeAnalyticsAccountInner.class); + + /* + * The unique identifier associated with this Data Lake Analytics account. + */ + @JsonProperty(value = "properties.accountId", access = JsonProperty.Access.WRITE_ONLY) + private UUID accountId; + + /* + * The provisioning status of the Data Lake Analytics account. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private DataLakeAnalyticsAccountStatus provisioningState; + + /* + * The state of the Data Lake Analytics account. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private DataLakeAnalyticsAccountState state; + + /* + * The account creation time. + */ + @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationTime; + + /* + * The account last modified time. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTime; + + /* + * The full CName endpoint for this account. + */ + @JsonProperty(value = "properties.endpoint", access = JsonProperty.Access.WRITE_ONLY) + private String endpoint; + + /* + * The default Data Lake Store account associated with this account. + */ + @JsonProperty(value = "properties.defaultDataLakeStoreAccount", access = JsonProperty.Access.WRITE_ONLY) + private String defaultDataLakeStoreAccount; + + /* + * The list of Data Lake Store accounts associated with this account. + */ + @JsonProperty(value = "properties.dataLakeStoreAccounts", access = JsonProperty.Access.WRITE_ONLY) + private List dataLakeStoreAccounts; + + /* + * The list of Data Lake Store accounts associated with this account. + */ + @JsonProperty(value = "properties.publicDataLakeStoreAccounts") + private List publicDataLakeStoreAccounts; + + /* + * The list of Azure Blob Storage accounts associated with this account. + */ + @JsonProperty(value = "properties.storageAccounts", access = JsonProperty.Access.WRITE_ONLY) + private List storageAccounts; + + /* + * The list of compute policies associated with this account. + */ + @JsonProperty(value = "properties.computePolicies", access = JsonProperty.Access.WRITE_ONLY) + private List computePolicies; + + /* + * The list of hiveMetastores associated with this account. + */ + @JsonProperty(value = "properties.hiveMetastores", access = JsonProperty.Access.WRITE_ONLY) + private List hiveMetastores; + + /* + * The list of virtualNetwork rules associated with this account. + */ + @JsonProperty(value = "properties.virtualNetworkRules", access = JsonProperty.Access.WRITE_ONLY) + private List virtualNetworkRules; + + /* + * The list of firewall rules associated with this account. + */ + @JsonProperty(value = "properties.firewallRules", access = JsonProperty.Access.WRITE_ONLY) + private List firewallRules; + + /* + * The current state of the IP address firewall for this account. + */ + @JsonProperty(value = "properties.firewallState") + private FirewallState firewallState; + + /* + * The current state of allowing or disallowing IPs originating within + * Azure through the firewall. If the firewall is disabled, this is not + * enforced. + */ + @JsonProperty(value = "properties.firewallAllowAzureIps") + private FirewallAllowAzureIpsState firewallAllowAzureIps; + + /* + * The commitment tier for the next month. + */ + @JsonProperty(value = "properties.newTier") + private TierType newTier; + + /* + * The commitment tier in use for the current month. + */ + @JsonProperty(value = "properties.currentTier", access = JsonProperty.Access.WRITE_ONLY) + private TierType currentTier; + + /* + * The maximum supported jobs running under the account at the same time. + */ + @JsonProperty(value = "properties.maxJobCount") + private Integer maxJobCount; + + /* + * The system defined maximum supported jobs running under the account at + * the same time, which restricts the maximum number of running jobs the + * user can set for the account. + */ + @JsonProperty(value = "properties.systemMaxJobCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer systemMaxJobCount; + + /* + * The maximum supported degree of parallelism for this account. + */ + @JsonProperty(value = "properties.maxDegreeOfParallelism") + private Integer maxDegreeOfParallelism; + + /* + * The system defined maximum supported degree of parallelism for this + * account, which restricts the maximum value of parallelism the user can + * set for the account. + */ + @JsonProperty(value = "properties.systemMaxDegreeOfParallelism", access = JsonProperty.Access.WRITE_ONLY) + private Integer systemMaxDegreeOfParallelism; + + /* + * The maximum supported degree of parallelism per job for this account. + */ + @JsonProperty(value = "properties.maxDegreeOfParallelismPerJob") + private Integer maxDegreeOfParallelismPerJob; + + /* + * The minimum supported priority per job for this account. + */ + @JsonProperty(value = "properties.minPriorityPerJob", access = JsonProperty.Access.WRITE_ONLY) + private Integer minPriorityPerJob; + + /* + * The number of days that job metadata is retained. + */ + @JsonProperty(value = "properties.queryStoreRetention") + private Integer queryStoreRetention; + + /* + * The current state of the DebugDataAccessLevel for this account. + */ + @JsonProperty(value = "properties.debugDataAccessLevel", access = JsonProperty.Access.WRITE_ONLY) + private DebugDataAccessLevel debugDataAccessLevel; + + /** + * Get the accountId property: The unique identifier associated with this Data Lake Analytics account. + * + * @return the accountId value. + */ + public UUID accountId() { + return this.accountId; + } + + /** + * Get the provisioningState property: The provisioning status of the Data Lake Analytics account. + * + * @return the provisioningState value. + */ + public DataLakeAnalyticsAccountStatus provisioningState() { + return this.provisioningState; + } + + /** + * Get the state property: The state of the Data Lake Analytics account. + * + * @return the state value. + */ + public DataLakeAnalyticsAccountState state() { + return this.state; + } + + /** + * Get the creationTime property: The account creation time. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Get the lastModifiedTime property: The account last modified time. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the endpoint property: The full CName endpoint for this account. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Get the defaultDataLakeStoreAccount property: The default Data Lake Store account associated with this account. + * + * @return the defaultDataLakeStoreAccount value. + */ + public String defaultDataLakeStoreAccount() { + return this.defaultDataLakeStoreAccount; + } + + /** + * Get the dataLakeStoreAccounts property: The list of Data Lake Store accounts associated with this account. + * + * @return the dataLakeStoreAccounts value. + */ + public List dataLakeStoreAccounts() { + return this.dataLakeStoreAccounts; + } + + /** + * Get the publicDataLakeStoreAccounts property: The list of Data Lake Store accounts associated with this account. + * + * @return the publicDataLakeStoreAccounts value. + */ + public List publicDataLakeStoreAccounts() { + return this.publicDataLakeStoreAccounts; + } + + /** + * Set the publicDataLakeStoreAccounts property: The list of Data Lake Store accounts associated with this account. + * + * @param publicDataLakeStoreAccounts the publicDataLakeStoreAccounts value to set. + * @return the DataLakeAnalyticsAccountInner object itself. + */ + public DataLakeAnalyticsAccountInner withPublicDataLakeStoreAccounts( + List publicDataLakeStoreAccounts) { + this.publicDataLakeStoreAccounts = publicDataLakeStoreAccounts; + return this; + } + + /** + * Get the storageAccounts property: The list of Azure Blob Storage accounts associated with this account. + * + * @return the storageAccounts value. + */ + public List storageAccounts() { + return this.storageAccounts; + } + + /** + * Get the computePolicies property: The list of compute policies associated with this account. + * + * @return the computePolicies value. + */ + public List computePolicies() { + return this.computePolicies; + } + + /** + * Get the hiveMetastores property: The list of hiveMetastores associated with this account. + * + * @return the hiveMetastores value. + */ + public List hiveMetastores() { + return this.hiveMetastores; + } + + /** + * Get the virtualNetworkRules property: The list of virtualNetwork rules associated with this account. + * + * @return the virtualNetworkRules value. + */ + public List virtualNetworkRules() { + return this.virtualNetworkRules; + } + + /** + * Get the firewallRules property: The list of firewall rules associated with this account. + * + * @return the firewallRules value. + */ + public List firewallRules() { + return this.firewallRules; + } + + /** + * Get the firewallState property: The current state of the IP address firewall for this account. + * + * @return the firewallState value. + */ + public FirewallState firewallState() { + return this.firewallState; + } + + /** + * Set the firewallState property: The current state of the IP address firewall for this account. + * + * @param firewallState the firewallState value to set. + * @return the DataLakeAnalyticsAccountInner object itself. + */ + public DataLakeAnalyticsAccountInner withFirewallState(FirewallState firewallState) { + this.firewallState = firewallState; + return this; + } + + /** + * Get the firewallAllowAzureIps property: The current state of allowing or disallowing IPs originating within Azure + * through the firewall. If the firewall is disabled, this is not enforced. + * + * @return the firewallAllowAzureIps value. + */ + public FirewallAllowAzureIpsState firewallAllowAzureIps() { + return this.firewallAllowAzureIps; + } + + /** + * Set the firewallAllowAzureIps property: The current state of allowing or disallowing IPs originating within Azure + * through the firewall. If the firewall is disabled, this is not enforced. + * + * @param firewallAllowAzureIps the firewallAllowAzureIps value to set. + * @return the DataLakeAnalyticsAccountInner object itself. + */ + public DataLakeAnalyticsAccountInner withFirewallAllowAzureIps(FirewallAllowAzureIpsState firewallAllowAzureIps) { + this.firewallAllowAzureIps = firewallAllowAzureIps; + return this; + } + + /** + * Get the newTier property: The commitment tier for the next month. + * + * @return the newTier value. + */ + public TierType newTier() { + return this.newTier; + } + + /** + * Set the newTier property: The commitment tier for the next month. + * + * @param newTier the newTier value to set. + * @return the DataLakeAnalyticsAccountInner object itself. + */ + public DataLakeAnalyticsAccountInner withNewTier(TierType newTier) { + this.newTier = newTier; + return this; + } + + /** + * Get the currentTier property: The commitment tier in use for the current month. + * + * @return the currentTier value. + */ + public TierType currentTier() { + return this.currentTier; + } + + /** + * Get the maxJobCount property: The maximum supported jobs running under the account at the same time. + * + * @return the maxJobCount value. + */ + public Integer maxJobCount() { + return this.maxJobCount; + } + + /** + * Set the maxJobCount property: The maximum supported jobs running under the account at the same time. + * + * @param maxJobCount the maxJobCount value to set. + * @return the DataLakeAnalyticsAccountInner object itself. + */ + public DataLakeAnalyticsAccountInner withMaxJobCount(Integer maxJobCount) { + this.maxJobCount = maxJobCount; + return this; + } + + /** + * Get the systemMaxJobCount property: The system defined maximum supported jobs running under the account at the + * same time, which restricts the maximum number of running jobs the user can set for the account. + * + * @return the systemMaxJobCount value. + */ + public Integer systemMaxJobCount() { + return this.systemMaxJobCount; + } + + /** + * Get the maxDegreeOfParallelism property: The maximum supported degree of parallelism for this account. + * + * @return the maxDegreeOfParallelism value. + */ + public Integer maxDegreeOfParallelism() { + return this.maxDegreeOfParallelism; + } + + /** + * Set the maxDegreeOfParallelism property: The maximum supported degree of parallelism for this account. + * + * @param maxDegreeOfParallelism the maxDegreeOfParallelism value to set. + * @return the DataLakeAnalyticsAccountInner object itself. + */ + public DataLakeAnalyticsAccountInner withMaxDegreeOfParallelism(Integer maxDegreeOfParallelism) { + this.maxDegreeOfParallelism = maxDegreeOfParallelism; + return this; + } + + /** + * Get the systemMaxDegreeOfParallelism property: The system defined maximum supported degree of parallelism for + * this account, which restricts the maximum value of parallelism the user can set for the account. + * + * @return the systemMaxDegreeOfParallelism value. + */ + public Integer systemMaxDegreeOfParallelism() { + return this.systemMaxDegreeOfParallelism; + } + + /** + * Get the maxDegreeOfParallelismPerJob property: The maximum supported degree of parallelism per job for this + * account. + * + * @return the maxDegreeOfParallelismPerJob value. + */ + public Integer maxDegreeOfParallelismPerJob() { + return this.maxDegreeOfParallelismPerJob; + } + + /** + * Set the maxDegreeOfParallelismPerJob property: The maximum supported degree of parallelism per job for this + * account. + * + * @param maxDegreeOfParallelismPerJob the maxDegreeOfParallelismPerJob value to set. + * @return the DataLakeAnalyticsAccountInner object itself. + */ + public DataLakeAnalyticsAccountInner withMaxDegreeOfParallelismPerJob(Integer maxDegreeOfParallelismPerJob) { + this.maxDegreeOfParallelismPerJob = maxDegreeOfParallelismPerJob; + return this; + } + + /** + * Get the minPriorityPerJob property: The minimum supported priority per job for this account. + * + * @return the minPriorityPerJob value. + */ + public Integer minPriorityPerJob() { + return this.minPriorityPerJob; + } + + /** + * Get the queryStoreRetention property: The number of days that job metadata is retained. + * + * @return the queryStoreRetention value. + */ + public Integer queryStoreRetention() { + return this.queryStoreRetention; + } + + /** + * Set the queryStoreRetention property: The number of days that job metadata is retained. + * + * @param queryStoreRetention the queryStoreRetention value to set. + * @return the DataLakeAnalyticsAccountInner object itself. + */ + public DataLakeAnalyticsAccountInner withQueryStoreRetention(Integer queryStoreRetention) { + this.queryStoreRetention = queryStoreRetention; + return this; + } + + /** + * Get the debugDataAccessLevel property: The current state of the DebugDataAccessLevel for this account. + * + * @return the debugDataAccessLevel value. + */ + public DebugDataAccessLevel debugDataAccessLevel() { + return this.debugDataAccessLevel; + } + + /** {@inheritDoc} */ + @Override + public DataLakeAnalyticsAccountInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataLakeAnalyticsAccountInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dataLakeStoreAccounts() != null) { + dataLakeStoreAccounts().forEach(e -> e.validate()); + } + if (publicDataLakeStoreAccounts() != null) { + publicDataLakeStoreAccounts().forEach(e -> e.validate()); + } + if (storageAccounts() != null) { + storageAccounts().forEach(e -> e.validate()); + } + if (computePolicies() != null) { + computePolicies().forEach(e -> e.validate()); + } + if (hiveMetastores() != null) { + hiveMetastores().forEach(e -> e.validate()); + } + if (virtualNetworkRules() != null) { + virtualNetworkRules().forEach(e -> e.validate()); + } + if (firewallRules() != null) { + firewallRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/DataLakeStoreAccountInformationInner.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/DataLakeStoreAccountInformationInner.java new file mode 100644 index 000000000000..130f01f6bb9a --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/DataLakeStoreAccountInformationInner.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Data Lake Store account information. */ +@JsonFlatten +@Immutable +public class DataLakeStoreAccountInformationInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataLakeStoreAccountInformationInner.class); + + /* + * The optional suffix for the Data Lake Store account. + */ + @JsonProperty(value = "properties.suffix", access = JsonProperty.Access.WRITE_ONLY) + private String suffix; + + /* + * The resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the suffix property: The optional suffix for the Data Lake Store account. + * + * @return the suffix value. + */ + public String suffix() { + return this.suffix; + } + + /** + * Get the name property: The resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** {@inheritDoc} */ + @Override + public DataLakeStoreAccountInformationInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/FirewallRuleInner.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/FirewallRuleInner.java new file mode 100644 index 000000000000..128e8ddbcae3 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/FirewallRuleInner.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Data Lake Analytics firewall rule information. */ +@JsonFlatten +@Immutable +public class FirewallRuleInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallRuleInner.class); + + /* + * The start IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.startIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String startIpAddress; + + /* + * The end IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.endIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String endIpAddress; + + /* + * The resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the startIpAddress property: The start IP address for the firewall rule. This can be either ipv4 or ipv6. + * Start and End should be in the same protocol. + * + * @return the startIpAddress value. + */ + public String startIpAddress() { + return this.startIpAddress; + } + + /** + * Get the endIpAddress property: The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start + * and End should be in the same protocol. + * + * @return the endIpAddress value. + */ + public String endIpAddress() { + return this.endIpAddress; + } + + /** + * Get the name property: The resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** {@inheritDoc} */ + @Override + public FirewallRuleInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/NameAvailabilityInformationInner.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/NameAvailabilityInformationInner.java new file mode 100644 index 000000000000..b2d809287fef --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/NameAvailabilityInformationInner.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.datalakeanalytics.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Data Lake Analytics account name availability result information. */ +@Immutable +public final class NameAvailabilityInformationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NameAvailabilityInformationInner.class); + + /* + * The Boolean value of true or false to indicate whether the Data Lake + * Analytics account name is available or not. + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean nameAvailable; + + /* + * The reason why the Data Lake Analytics account name is not available, if + * nameAvailable is false. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private String reason; + + /* + * The message describing why the Data Lake Analytics account name is not + * available, if nameAvailable is false. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get the nameAvailable property: The Boolean value of true or false to indicate whether the Data Lake Analytics + * account name is available or not. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get the reason property: The reason why the Data Lake Analytics account name is not available, if nameAvailable + * is false. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Get the message property: The message describing why the Data Lake Analytics account name is not available, if + * nameAvailable is false. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/OperationListResultInner.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/OperationListResultInner.java new file mode 100644 index 000000000000..8be68d5c2c41 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/OperationListResultInner.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datalakeanalytics.models.Operation; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of available operations for Data Lake Analytics. */ +@Immutable +public final class OperationListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResultInner.class); + + /* + * The results of the list operation. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The results of the list operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link (url) to the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/SasTokenInformationInner.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/SasTokenInformationInner.java new file mode 100644 index 000000000000..889c8402d7fb --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/SasTokenInformationInner.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.datalakeanalytics.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SAS token information. */ +@Immutable +public final class SasTokenInformationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SasTokenInformationInner.class); + + /* + * The access token for the associated Azure Storage Container. + */ + @JsonProperty(value = "accessToken", access = JsonProperty.Access.WRITE_ONLY) + private String accessToken; + + /** + * Get the accessToken property: The access token for the associated Azure Storage Container. + * + * @return the accessToken value. + */ + public String accessToken() { + return this.accessToken; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/StorageAccountInformationInner.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/StorageAccountInformationInner.java new file mode 100644 index 000000000000..c53ae5a034de --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/StorageAccountInformationInner.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure Storage account information. */ +@JsonFlatten +@Immutable +public class StorageAccountInformationInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountInformationInner.class); + + /* + * The optional suffix for the storage account. + */ + @JsonProperty(value = "properties.suffix", access = JsonProperty.Access.WRITE_ONLY) + private String suffix; + + /* + * The resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the suffix property: The optional suffix for the storage account. + * + * @return the suffix value. + */ + public String suffix() { + return this.suffix; + } + + /** + * Get the name property: The resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** {@inheritDoc} */ + @Override + public StorageAccountInformationInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/StorageContainerInner.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/StorageContainerInner.java new file mode 100644 index 000000000000..596ac1b6a4b1 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/StorageContainerInner.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.datalakeanalytics.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Azure Storage blob container information. */ +@JsonFlatten +@Immutable +public class StorageContainerInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageContainerInner.class); + + /* + * The last modified time of the blob container. + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTime; + + /* + * The resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the lastModifiedTime property: The last modified time of the blob container. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the name property: The resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** {@inheritDoc} */ + @Override + public StorageContainerInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/package-info.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/package-info.java new file mode 100644 index 000000000000..5908a6a55aac --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the inner data models for DataLakeAnalyticsAccountManagementClient. Creates an Azure Data Lake + * Analytics account management client. + */ +package com.azure.resourcemanager.datalakeanalytics.fluent.models; diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/package-info.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/package-info.java new file mode 100644 index 000000000000..af0781971620 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the service clients for DataLakeAnalyticsAccountManagementClient. Creates an Azure Data Lake + * Analytics account management client. + */ +package com.azure.resourcemanager.datalakeanalytics.fluent; diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/AccountsClientImpl.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/AccountsClientImpl.java new file mode 100644 index 000000000000..513b3cf2b898 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/AccountsClientImpl.java @@ -0,0 +1,2074 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.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.datalakeanalytics.fluent.AccountsClient; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.DataLakeAnalyticsAccountBasicInner; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.DataLakeAnalyticsAccountInner; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.NameAvailabilityInformationInner; +import com.azure.resourcemanager.datalakeanalytics.models.CheckNameAvailabilityParameters; +import com.azure.resourcemanager.datalakeanalytics.models.CreateDataLakeAnalyticsAccountParameters; +import com.azure.resourcemanager.datalakeanalytics.models.DataLakeAnalyticsAccountListResult; +import com.azure.resourcemanager.datalakeanalytics.models.UpdateDataLakeAnalyticsAccountParameters; +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 AccountsClient. */ +public final class AccountsClientImpl implements AccountsClient { + private final ClientLogger logger = new ClientLogger(AccountsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AccountsService service; + + /** The service client containing this operation class. */ + private final DataLakeAnalyticsAccountManagementClientImpl client; + + /** + * Initializes an instance of AccountsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AccountsClientImpl(DataLakeAnalyticsAccountManagementClientImpl client) { + this.service = RestProxy.create(AccountsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataLakeAnalyticsAccountManagementClientAccounts to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataLakeAnalyticsAcc") + private interface AccountsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DataLakeAnalytics/accounts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("$select") String select, + @QueryParam("$orderby") String orderby, + @QueryParam("$count") Boolean count, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("$select") String select, + @QueryParam("$orderby") String orderby, + @QueryParam("$count") Boolean count, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts/{accountName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CreateDataLakeAnalyticsAccountParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts/{accountName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts/{accountName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateDataLakeAnalyticsAccountParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts/{accountName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.DataLakeAnalytics/locations/{location}" + + "/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CheckNameAvailabilityParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @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); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a + * link to the next page, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Analytics accounts, if any, within the current subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String filter, Integer top, Integer skip, String select, String orderby, Boolean count) { + 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(), + filter, + top, + skip, + select, + orderby, + count, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a + * link to the next page, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Analytics accounts, if any, within the current subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String filter, Integer top, Integer skip, String select, String orderby, Boolean count, 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(), + filter, + top, + skip, + select, + orderby, + count, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a + * link to the next page, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Analytics accounts, if any, within the current subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String filter, Integer top, Integer skip, String select, String orderby, Boolean count) { + return new PagedFlux<>( + () -> listSinglePageAsync(filter, top, skip, select, orderby, count), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a + * link to the next page, if any. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Analytics accounts, if any, within the current subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + return new PagedFlux<>( + () -> listSinglePageAsync(filter, top, skip, select, orderby, count), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a + * link to the next page, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Analytics accounts, if any, within the current subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String filter, Integer top, Integer skip, String select, String orderby, Boolean count, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(filter, top, skip, select, orderby, count, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a + * link to the next page, if any. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Analytics accounts, if any, within the current subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + return new PagedIterable<>(listAsync(filter, top, skip, select, orderby, count)); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a + * link to the next page, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Analytics accounts, if any, within the current subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String filter, Integer top, Integer skip, String select, String orderby, Boolean count, Context context) { + return new PagedIterable<>(listAsync(filter, top, skip, select, orderby, count, context)); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a + * link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Analytics accounts, if any, within a specific resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, + String filter, + Integer top, + Integer skip, + String select, + String orderby, + Boolean count) { + 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, + filter, + top, + skip, + select, + orderby, + count, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a + * link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Analytics accounts, if any, within a specific resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, + String filter, + Integer top, + Integer skip, + String select, + String orderby, + Boolean count, + 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, + filter, + top, + skip, + select, + orderby, + count, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a + * link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Analytics accounts, if any, within a specific resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, + String filter, + Integer top, + Integer skip, + String select, + String orderby, + Boolean count) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, skip, select, orderby, count), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a + * link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Analytics accounts, if any, within a specific resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, skip, select, orderby, count), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a + * link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Analytics accounts, if any, within a specific resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, + String filter, + Integer top, + Integer skip, + String select, + String orderby, + Boolean count, + Context context) { + return new PagedFlux<>( + () -> + listByResourceGroupSinglePageAsync( + resourceGroupName, filter, top, skip, select, orderby, count, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a + * link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Analytics accounts, if any, within a specific resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + return new PagedIterable<>( + listByResourceGroupAsync(resourceGroupName, filter, top, skip, select, orderby, count)); + } + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a + * link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Analytics accounts, if any, within a specific resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, + String filter, + Integer top, + Integer skip, + String select, + String orderby, + Boolean count, + Context context) { + return new PagedIterable<>( + listByResourceGroupAsync(resourceGroupName, filter, top, skip, select, orderby, count, context)); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake + * Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to create a new Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String accountName, CreateDataLakeAnalyticsAccountParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake + * Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to create a new Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String accountName, + CreateDataLakeAnalyticsAccountParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake + * Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to create a new Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataLakeAnalyticsAccountInner> beginCreateAsync( + String resourceGroupName, String accountName, CreateDataLakeAnalyticsAccountParameters parameters) { + Mono>> mono = createWithResponseAsync(resourceGroupName, accountName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DataLakeAnalyticsAccountInner.class, + DataLakeAnalyticsAccountInner.class, + Context.NONE); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake + * Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to create a new Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataLakeAnalyticsAccountInner> beginCreateAsync( + String resourceGroupName, + String accountName, + CreateDataLakeAnalyticsAccountParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, accountName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DataLakeAnalyticsAccountInner.class, + DataLakeAnalyticsAccountInner.class, + context); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake + * Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to create a new Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataLakeAnalyticsAccountInner> beginCreate( + String resourceGroupName, String accountName, CreateDataLakeAnalyticsAccountParameters parameters) { + return beginCreateAsync(resourceGroupName, accountName, parameters).getSyncPoller(); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake + * Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to create a new Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataLakeAnalyticsAccountInner> beginCreate( + String resourceGroupName, + String accountName, + CreateDataLakeAnalyticsAccountParameters parameters, + Context context) { + return beginCreateAsync(resourceGroupName, accountName, parameters, context).getSyncPoller(); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake + * Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to create a new Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String accountName, CreateDataLakeAnalyticsAccountParameters parameters) { + return beginCreateAsync(resourceGroupName, accountName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake + * Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to create a new Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String accountName, + CreateDataLakeAnalyticsAccountParameters parameters, + Context context) { + return beginCreateAsync(resourceGroupName, accountName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake + * Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to create a new Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataLakeAnalyticsAccountInner create( + String resourceGroupName, String accountName, CreateDataLakeAnalyticsAccountParameters parameters) { + return createAsync(resourceGroupName, accountName, parameters).block(); + } + + /** + * Creates the specified Data Lake Analytics account. This supplies the user with computation services for Data Lake + * Analytics workloads. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to create a new Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataLakeAnalyticsAccountInner create( + String resourceGroupName, + String accountName, + CreateDataLakeAnalyticsAccountParameters parameters, + Context context) { + return createAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * Gets details of the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets details of the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets details of the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, accountName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets details of the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataLakeAnalyticsAccountInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupAsync(resourceGroupName, accountName).block(); + } + + /** + * Gets details of the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account + * object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String accountName, UpdateDataLakeAnalyticsAccountParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account + * object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to the update Data Lake Analytics account 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 a Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String accountName, + UpdateDataLakeAnalyticsAccountParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account + * object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataLakeAnalyticsAccountInner> beginUpdateAsync( + String resourceGroupName, String accountName, UpdateDataLakeAnalyticsAccountParameters parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, accountName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DataLakeAnalyticsAccountInner.class, + DataLakeAnalyticsAccountInner.class, + Context.NONE); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account + * object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to the update Data Lake Analytics account 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 a Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataLakeAnalyticsAccountInner> beginUpdateAsync( + String resourceGroupName, + String accountName, + UpdateDataLakeAnalyticsAccountParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, accountName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DataLakeAnalyticsAccountInner.class, + DataLakeAnalyticsAccountInner.class, + context); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account + * object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataLakeAnalyticsAccountInner> beginUpdate( + String resourceGroupName, String accountName, UpdateDataLakeAnalyticsAccountParameters parameters) { + return beginUpdateAsync(resourceGroupName, accountName, parameters).getSyncPoller(); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account + * object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to the update Data Lake Analytics account 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 a Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataLakeAnalyticsAccountInner> beginUpdate( + String resourceGroupName, + String accountName, + UpdateDataLakeAnalyticsAccountParameters parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, accountName, parameters, context).getSyncPoller(); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account + * object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, UpdateDataLakeAnalyticsAccountParameters parameters) { + return beginUpdateAsync(resourceGroupName, accountName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account + * object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String accountName) { + final UpdateDataLakeAnalyticsAccountParameters parameters = null; + return beginUpdateAsync(resourceGroupName, accountName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account + * object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to the update Data Lake Analytics account 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 a Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String accountName, + UpdateDataLakeAnalyticsAccountParameters parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, accountName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account + * object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to the update Data Lake Analytics account operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataLakeAnalyticsAccountInner update( + String resourceGroupName, String accountName, UpdateDataLakeAnalyticsAccountParameters parameters) { + return updateAsync(resourceGroupName, accountName, parameters).block(); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account + * object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataLakeAnalyticsAccountInner update(String resourceGroupName, String accountName) { + final UpdateDataLakeAnalyticsAccountParameters parameters = null; + return updateAsync(resourceGroupName, accountName, parameters).block(); + } + + /** + * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account + * object. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param parameters Parameters supplied to the update Data Lake Analytics account 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 a Data Lake Analytics account object, containing all information associated with the named Data Lake + * Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataLakeAnalyticsAccountInner update( + String resourceGroupName, + String accountName, + UpdateDataLakeAnalyticsAccountParameters parameters, + Context context) { + return updateAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * Begins the delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Begins the delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Begins the delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, accountName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Begins the delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String accountName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, accountName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Begins the delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName) { + return beginDeleteAsync(resourceGroupName, accountName).getSyncPoller(); + } + + /** + * Begins the delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String accountName, Context context) { + return beginDeleteAsync(resourceGroupName, accountName, context).getSyncPoller(); + } + + /** + * Begins the delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName) { + return beginDeleteAsync(resourceGroupName, accountName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Begins the delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, Context context) { + return beginDeleteAsync(resourceGroupName, accountName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Begins the delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName) { + deleteAsync(resourceGroupName, accountName).block(); + } + + /** + * Begins the delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, Context context) { + deleteAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Checks whether the specified account name is available or taken. + * + * @param location The resource location without whitespace. + * @param parameters Parameters supplied to check the Data Lake Analytics account name availability. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics account name availability result information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String location, CheckNameAvailabilityParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Checks whether the specified account name is available or taken. + * + * @param location The resource location without whitespace. + * @param parameters Parameters supplied to check the Data Lake Analytics account name availability. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics account name availability result information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String location, CheckNameAvailabilityParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Checks whether the specified account name is available or taken. + * + * @param location The resource location without whitespace. + * @param parameters Parameters supplied to check the Data Lake Analytics account name availability. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics account name availability result information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String location, CheckNameAvailabilityParameters parameters) { + return checkNameAvailabilityWithResponseAsync(location, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks whether the specified account name is available or taken. + * + * @param location The resource location without whitespace. + * @param parameters Parameters supplied to check the Data Lake Analytics account name availability. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics account name availability result information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NameAvailabilityInformationInner checkNameAvailability( + String location, CheckNameAvailabilityParameters parameters) { + return checkNameAvailabilityAsync(location, parameters).block(); + } + + /** + * Checks whether the specified account name is available or taken. + * + * @param location The resource location without whitespace. + * @param parameters Parameters supplied to check the Data Lake Analytics account name availability. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics account name availability result information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String location, CheckNameAvailabilityParameters parameters, Context context) { + return checkNameAvailabilityWithResponseAsync(location, parameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics account list information. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 data Lake Analytics account list information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics account list information. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 data Lake Analytics account list information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/AccountsImpl.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/AccountsImpl.java new file mode 100644 index 000000000000..2be1bcb858b1 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/AccountsImpl.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.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.datalakeanalytics.DataLakeAnalyticsManager; +import com.azure.resourcemanager.datalakeanalytics.fluent.AccountsClient; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.DataLakeAnalyticsAccountBasicInner; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.DataLakeAnalyticsAccountInner; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.NameAvailabilityInformationInner; +import com.azure.resourcemanager.datalakeanalytics.models.Accounts; +import com.azure.resourcemanager.datalakeanalytics.models.CheckNameAvailabilityParameters; +import com.azure.resourcemanager.datalakeanalytics.models.DataLakeAnalyticsAccount; +import com.azure.resourcemanager.datalakeanalytics.models.DataLakeAnalyticsAccountBasic; +import com.azure.resourcemanager.datalakeanalytics.models.NameAvailabilityInformation; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AccountsImpl implements Accounts { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AccountsImpl.class); + + private final AccountsClient innerClient; + + private final DataLakeAnalyticsManager serviceManager; + + public AccountsImpl(AccountsClient innerClient, DataLakeAnalyticsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new DataLakeAnalyticsAccountBasicImpl(inner1, this.manager())); + } + + public PagedIterable list( + String filter, Integer top, Integer skip, String select, String orderby, Boolean count, Context context) { + PagedIterable inner = + this.serviceClient().list(filter, top, skip, select, orderby, count, context); + return Utils.mapPage(inner, inner1 -> new DataLakeAnalyticsAccountBasicImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new DataLakeAnalyticsAccountBasicImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, + String filter, + Integer top, + Integer skip, + String select, + String orderby, + Boolean count, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByResourceGroup(resourceGroupName, filter, top, skip, select, orderby, count, context); + return Utils.mapPage(inner, inner1 -> new DataLakeAnalyticsAccountBasicImpl(inner1, this.manager())); + } + + public DataLakeAnalyticsAccount getByResourceGroup(String resourceGroupName, String accountName) { + DataLakeAnalyticsAccountInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, accountName); + if (inner != null) { + return new DataLakeAnalyticsAccountImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DataLakeAnalyticsAccountImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String accountName) { + this.serviceClient().delete(resourceGroupName, accountName); + } + + public void delete(String resourceGroupName, String accountName, Context context) { + this.serviceClient().delete(resourceGroupName, accountName, context); + } + + public NameAvailabilityInformation checkNameAvailability( + String location, CheckNameAvailabilityParameters parameters) { + NameAvailabilityInformationInner inner = this.serviceClient().checkNameAvailability(location, parameters); + if (inner != null) { + return new NameAvailabilityInformationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + String location, CheckNameAvailabilityParameters parameters, Context context) { + Response inner = + this.serviceClient().checkNameAvailabilityWithResponse(location, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NameAvailabilityInformationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DataLakeAnalyticsAccount getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, accountName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + this.delete(resourceGroupName, accountName, 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 accountName = Utils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + this.delete(resourceGroupName, accountName, context); + } + + private AccountsClient serviceClient() { + return this.innerClient; + } + + private DataLakeAnalyticsManager manager() { + return this.serviceManager; + } + + public DataLakeAnalyticsAccountImpl define(String name) { + return new DataLakeAnalyticsAccountImpl(name, this.manager()); + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/CapabilityInformationImpl.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/CapabilityInformationImpl.java new file mode 100644 index 000000000000..9d23b436fab6 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/CapabilityInformationImpl.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.datalakeanalytics.implementation; + +import com.azure.resourcemanager.datalakeanalytics.DataLakeAnalyticsManager; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.CapabilityInformationInner; +import com.azure.resourcemanager.datalakeanalytics.models.CapabilityInformation; +import com.azure.resourcemanager.datalakeanalytics.models.SubscriptionState; +import java.util.UUID; + +public final class CapabilityInformationImpl implements CapabilityInformation { + private CapabilityInformationInner innerObject; + + private final DataLakeAnalyticsManager serviceManager; + + CapabilityInformationImpl(CapabilityInformationInner innerObject, DataLakeAnalyticsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public UUID subscriptionId() { + return this.innerModel().subscriptionId(); + } + + public SubscriptionState state() { + return this.innerModel().state(); + } + + public Integer maxAccountCount() { + return this.innerModel().maxAccountCount(); + } + + public Integer accountCount() { + return this.innerModel().accountCount(); + } + + public Boolean migrationState() { + return this.innerModel().migrationState(); + } + + public CapabilityInformationInner innerModel() { + return this.innerObject; + } + + private DataLakeAnalyticsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/ComputePoliciesClientImpl.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/ComputePoliciesClientImpl.java new file mode 100644 index 000000000000..aefb11029e74 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/ComputePoliciesClientImpl.java @@ -0,0 +1,1165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datalakeanalytics.fluent.ComputePoliciesClient; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.ComputePolicyInner; +import com.azure.resourcemanager.datalakeanalytics.models.ComputePolicyListResult; +import com.azure.resourcemanager.datalakeanalytics.models.CreateOrUpdateComputePolicyParameters; +import com.azure.resourcemanager.datalakeanalytics.models.UpdateComputePolicyParameters; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ComputePoliciesClient. */ +public final class ComputePoliciesClientImpl implements ComputePoliciesClient { + private final ClientLogger logger = new ClientLogger(ComputePoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ComputePoliciesService service; + + /** The service client containing this operation class. */ + private final DataLakeAnalyticsAccountManagementClientImpl client; + + /** + * Initializes an instance of ComputePoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ComputePoliciesClientImpl(DataLakeAnalyticsAccountManagementClientImpl client) { + this.service = + RestProxy.create(ComputePoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataLakeAnalyticsAccountManagementClientComputePolicies to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataLakeAnalyticsAcc") + private interface ComputePoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts/{accountName}/computePolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByAccount( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts/{accountName}/computePolicies/{computePolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("computePolicyName") String computePolicyName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CreateOrUpdateComputePolicyParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts/{accountName}/computePolicies/{computePolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("computePolicyName") String computePolicyName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts/{accountName}/computePolicies/{computePolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("computePolicyName") String computePolicyName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateComputePolicyParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts/{accountName}/computePolicies/{computePolicyName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("computePolicyName") String computePolicyName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByAccountNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the Data Lake Analytics compute policies within the specified Data Lake Analytics account. An account + * supports, at most, 50 policies. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of compute policies in the account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountSinglePageAsync( + String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByAccount( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists the Data Lake Analytics compute policies within the specified Data Lake Analytics account. An account + * supports, at most, 50 policies. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of compute policies in the account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountSinglePageAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByAccount( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the Data Lake Analytics compute policies within the specified Data Lake Analytics account. An account + * supports, at most, 50 policies. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of compute policies in the account. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByAccountAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>( + () -> listByAccountSinglePageAsync(resourceGroupName, accountName), + nextLink -> listByAccountNextSinglePageAsync(nextLink)); + } + + /** + * Lists the Data Lake Analytics compute policies within the specified Data Lake Analytics account. An account + * supports, at most, 50 policies. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of compute policies in the account. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByAccountAsync( + String resourceGroupName, String accountName, Context context) { + return new PagedFlux<>( + () -> listByAccountSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listByAccountNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the Data Lake Analytics compute policies within the specified Data Lake Analytics account. An account + * supports, at most, 50 policies. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of compute policies in the account. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByAccount(String resourceGroupName, String accountName) { + return new PagedIterable<>(listByAccountAsync(resourceGroupName, accountName)); + } + + /** + * Lists the Data Lake Analytics compute policies within the specified Data Lake Analytics account. An account + * supports, at most, 50 policies. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of compute policies in the account. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByAccount( + String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(listByAccountAsync(resourceGroupName, accountName, context)); + } + + /** + * Creates or updates the specified compute policy. During update, the compute policy with the specified name will + * be replaced with this new compute policy. An account supports, at most, 50 policies. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to create or update. + * @param parameters Parameters supplied to create or update the compute policy. The max degree of parallelism per + * job property, min priority per job property, or both must be present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics compute policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String accountName, + String computePolicyName, + CreateOrUpdateComputePolicyParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (computePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter computePolicyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + computePolicyName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates the specified compute policy. During update, the compute policy with the specified name will + * be replaced with this new compute policy. An account supports, at most, 50 policies. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to create or update. + * @param parameters Parameters supplied to create or update the compute policy. The max degree of parallelism per + * job property, min priority per job property, or both must be present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics compute policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String accountName, + String computePolicyName, + CreateOrUpdateComputePolicyParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (computePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter computePolicyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + computePolicyName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Creates or updates the specified compute policy. During update, the compute policy with the specified name will + * be replaced with this new compute policy. An account supports, at most, 50 policies. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to create or update. + * @param parameters Parameters supplied to create or update the compute policy. The max degree of parallelism per + * job property, min priority per job property, or both must be present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics compute policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String accountName, + String computePolicyName, + CreateOrUpdateComputePolicyParameters parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, computePolicyName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the specified compute policy. During update, the compute policy with the specified name will + * be replaced with this new compute policy. An account supports, at most, 50 policies. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to create or update. + * @param parameters Parameters supplied to create or update the compute policy. The max degree of parallelism per + * job property, min priority per job property, or both must be present. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics compute policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ComputePolicyInner createOrUpdate( + String resourceGroupName, + String accountName, + String computePolicyName, + CreateOrUpdateComputePolicyParameters parameters) { + return createOrUpdateAsync(resourceGroupName, accountName, computePolicyName, parameters).block(); + } + + /** + * Creates or updates the specified compute policy. During update, the compute policy with the specified name will + * be replaced with this new compute policy. An account supports, at most, 50 policies. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to create or update. + * @param parameters Parameters supplied to create or update the compute policy. The max degree of parallelism per + * job property, min priority per job property, or both must be present. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics compute policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + String computePolicyName, + CreateOrUpdateComputePolicyParameters parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, computePolicyName, parameters, context) + .block(); + } + + /** + * Gets the specified Data Lake Analytics compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Analytics compute policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String computePolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (computePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter computePolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + computePolicyName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the specified Data Lake Analytics compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Analytics compute policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String computePolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (computePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter computePolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + computePolicyName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the specified Data Lake Analytics compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Analytics compute policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String computePolicyName) { + return getWithResponseAsync(resourceGroupName, accountName, computePolicyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Data Lake Analytics compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Analytics compute policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ComputePolicyInner get(String resourceGroupName, String accountName, String computePolicyName) { + return getAsync(resourceGroupName, accountName, computePolicyName).block(); + } + + /** + * Gets the specified Data Lake Analytics compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Analytics compute policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String computePolicyName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, computePolicyName, context).block(); + } + + /** + * Updates the specified compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to update. + * @param parameters Parameters supplied to update the compute policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics compute policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String accountName, + String computePolicyName, + UpdateComputePolicyParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (computePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter computePolicyName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + computePolicyName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the specified compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to update. + * @param parameters Parameters supplied to update the compute policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics compute policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String accountName, + String computePolicyName, + UpdateComputePolicyParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (computePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter computePolicyName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + computePolicyName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Updates the specified compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to update. + * @param parameters Parameters supplied to update the compute policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics compute policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String accountName, + String computePolicyName, + UpdateComputePolicyParameters parameters) { + return updateWithResponseAsync(resourceGroupName, accountName, computePolicyName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the specified compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics compute policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String accountName, String computePolicyName) { + final UpdateComputePolicyParameters parameters = null; + return updateWithResponseAsync(resourceGroupName, accountName, computePolicyName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the specified compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics compute policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ComputePolicyInner update(String resourceGroupName, String accountName, String computePolicyName) { + final UpdateComputePolicyParameters parameters = null; + return updateAsync(resourceGroupName, accountName, computePolicyName, parameters).block(); + } + + /** + * Updates the specified compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to update. + * @param parameters Parameters supplied to update the compute policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics compute policy information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String accountName, + String computePolicyName, + UpdateComputePolicyParameters parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, computePolicyName, parameters, context).block(); + } + + /** + * Deletes the specified compute policy from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String computePolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (computePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter computePolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + computePolicyName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the specified compute policy from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String computePolicyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (computePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter computePolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + computePolicyName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the specified compute policy from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String computePolicyName) { + return deleteWithResponseAsync(resourceGroupName, accountName, computePolicyName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the specified compute policy from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String computePolicyName) { + deleteAsync(resourceGroupName, accountName, computePolicyName).block(); + } + + /** + * Deletes the specified compute policy from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String accountName, String computePolicyName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, computePolicyName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of compute policies in the account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountNextSinglePageAsync(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.listByAccountNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of compute policies in the account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountNextSinglePageAsync(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 + .listByAccountNext(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/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/ComputePoliciesImpl.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/ComputePoliciesImpl.java new file mode 100644 index 000000000000..adbf81eda7d4 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/ComputePoliciesImpl.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.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.datalakeanalytics.DataLakeAnalyticsManager; +import com.azure.resourcemanager.datalakeanalytics.fluent.ComputePoliciesClient; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.ComputePolicyInner; +import com.azure.resourcemanager.datalakeanalytics.models.ComputePolicies; +import com.azure.resourcemanager.datalakeanalytics.models.ComputePolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ComputePoliciesImpl implements ComputePolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ComputePoliciesImpl.class); + + private final ComputePoliciesClient innerClient; + + private final DataLakeAnalyticsManager serviceManager; + + public ComputePoliciesImpl(ComputePoliciesClient innerClient, DataLakeAnalyticsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByAccount(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().listByAccount(resourceGroupName, accountName); + return Utils.mapPage(inner, inner1 -> new ComputePolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByAccount(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = + this.serviceClient().listByAccount(resourceGroupName, accountName, context); + return Utils.mapPage(inner, inner1 -> new ComputePolicyImpl(inner1, this.manager())); + } + + public ComputePolicy get(String resourceGroupName, String accountName, String computePolicyName) { + ComputePolicyInner inner = this.serviceClient().get(resourceGroupName, accountName, computePolicyName); + if (inner != null) { + return new ComputePolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String computePolicyName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, computePolicyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ComputePolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String computePolicyName) { + this.serviceClient().delete(resourceGroupName, accountName, computePolicyName); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, String computePolicyName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, computePolicyName, context); + } + + public ComputePolicy getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String computePolicyName = Utils.getValueFromIdByName(id, "computePolicies"); + if (computePolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'computePolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, computePolicyName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String computePolicyName = Utils.getValueFromIdByName(id, "computePolicies"); + if (computePolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'computePolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, computePolicyName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String computePolicyName = Utils.getValueFromIdByName(id, "computePolicies"); + if (computePolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'computePolicies'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, computePolicyName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String computePolicyName = Utils.getValueFromIdByName(id, "computePolicies"); + if (computePolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'computePolicies'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, computePolicyName, context); + } + + private ComputePoliciesClient serviceClient() { + return this.innerClient; + } + + private DataLakeAnalyticsManager manager() { + return this.serviceManager; + } + + public ComputePolicyImpl define(String name) { + return new ComputePolicyImpl(name, this.manager()); + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/ComputePolicyImpl.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/ComputePolicyImpl.java new file mode 100644 index 000000000000..a5b8a738c5ac --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/ComputePolicyImpl.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.datalakeanalytics.DataLakeAnalyticsManager; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.ComputePolicyInner; +import com.azure.resourcemanager.datalakeanalytics.models.AadObjectType; +import com.azure.resourcemanager.datalakeanalytics.models.ComputePolicy; +import com.azure.resourcemanager.datalakeanalytics.models.CreateOrUpdateComputePolicyParameters; +import com.azure.resourcemanager.datalakeanalytics.models.UpdateComputePolicyParameters; +import java.util.UUID; + +public final class ComputePolicyImpl implements ComputePolicy, ComputePolicy.Definition, ComputePolicy.Update { + private ComputePolicyInner innerObject; + + private final DataLakeAnalyticsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public UUID objectId() { + return this.innerModel().objectId(); + } + + public AadObjectType objectType() { + return this.innerModel().objectType(); + } + + public Integer maxDegreeOfParallelismPerJob() { + return this.innerModel().maxDegreeOfParallelismPerJob(); + } + + public Integer minPriorityPerJob() { + return this.innerModel().minPriorityPerJob(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ComputePolicyInner innerModel() { + return this.innerObject; + } + + private DataLakeAnalyticsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String computePolicyName; + + private CreateOrUpdateComputePolicyParameters createParameters; + + private UpdateComputePolicyParameters updateParameters; + + public ComputePolicyImpl withExistingAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public ComputePolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getComputePolicies() + .createOrUpdateWithResponse( + resourceGroupName, accountName, computePolicyName, createParameters, Context.NONE) + .getValue(); + return this; + } + + public ComputePolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getComputePolicies() + .createOrUpdateWithResponse( + resourceGroupName, accountName, computePolicyName, createParameters, context) + .getValue(); + return this; + } + + ComputePolicyImpl(String name, DataLakeAnalyticsManager serviceManager) { + this.innerObject = new ComputePolicyInner(); + this.serviceManager = serviceManager; + this.computePolicyName = name; + this.createParameters = new CreateOrUpdateComputePolicyParameters(); + } + + public ComputePolicyImpl update() { + this.updateParameters = new UpdateComputePolicyParameters(); + return this; + } + + public ComputePolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getComputePolicies() + .updateWithResponse(resourceGroupName, accountName, computePolicyName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public ComputePolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getComputePolicies() + .updateWithResponse(resourceGroupName, accountName, computePolicyName, updateParameters, context) + .getValue(); + return this; + } + + ComputePolicyImpl(ComputePolicyInner innerObject, DataLakeAnalyticsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "accounts"); + this.computePolicyName = Utils.getValueFromIdByName(innerObject.id(), "computePolicies"); + } + + public ComputePolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getComputePolicies() + .getWithResponse(resourceGroupName, accountName, computePolicyName, Context.NONE) + .getValue(); + return this; + } + + public ComputePolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getComputePolicies() + .getWithResponse(resourceGroupName, accountName, computePolicyName, context) + .getValue(); + return this; + } + + public ComputePolicyImpl withObjectId(UUID objectId) { + if (isInCreateMode()) { + this.createParameters.withObjectId(objectId); + return this; + } else { + this.updateParameters.withObjectId(objectId); + return this; + } + } + + public ComputePolicyImpl withObjectType(AadObjectType objectType) { + if (isInCreateMode()) { + this.createParameters.withObjectType(objectType); + return this; + } else { + this.updateParameters.withObjectType(objectType); + return this; + } + } + + public ComputePolicyImpl withMaxDegreeOfParallelismPerJob(Integer maxDegreeOfParallelismPerJob) { + if (isInCreateMode()) { + this.createParameters.withMaxDegreeOfParallelismPerJob(maxDegreeOfParallelismPerJob); + return this; + } else { + this.updateParameters.withMaxDegreeOfParallelismPerJob(maxDegreeOfParallelismPerJob); + return this; + } + } + + public ComputePolicyImpl withMinPriorityPerJob(Integer minPriorityPerJob) { + if (isInCreateMode()) { + this.createParameters.withMinPriorityPerJob(minPriorityPerJob); + return this; + } else { + this.updateParameters.withMinPriorityPerJob(minPriorityPerJob); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/DataLakeAnalyticsAccountBasicImpl.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/DataLakeAnalyticsAccountBasicImpl.java new file mode 100644 index 000000000000..6bc927c4ba82 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/DataLakeAnalyticsAccountBasicImpl.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.datalakeanalytics.implementation; + +import com.azure.resourcemanager.datalakeanalytics.DataLakeAnalyticsManager; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.DataLakeAnalyticsAccountBasicInner; +import com.azure.resourcemanager.datalakeanalytics.models.DataLakeAnalyticsAccountBasic; +import com.azure.resourcemanager.datalakeanalytics.models.DataLakeAnalyticsAccountState; +import com.azure.resourcemanager.datalakeanalytics.models.DataLakeAnalyticsAccountStatus; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Map; +import java.util.UUID; + +public final class DataLakeAnalyticsAccountBasicImpl implements DataLakeAnalyticsAccountBasic { + private DataLakeAnalyticsAccountBasicInner innerObject; + + private final DataLakeAnalyticsManager serviceManager; + + DataLakeAnalyticsAccountBasicImpl( + DataLakeAnalyticsAccountBasicInner innerObject, DataLakeAnalyticsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String 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 UUID accountId() { + return this.innerModel().accountId(); + } + + public DataLakeAnalyticsAccountStatus provisioningState() { + return this.innerModel().provisioningState(); + } + + public DataLakeAnalyticsAccountState state() { + return this.innerModel().state(); + } + + public OffsetDateTime creationTime() { + return this.innerModel().creationTime(); + } + + public OffsetDateTime lastModifiedTime() { + return this.innerModel().lastModifiedTime(); + } + + public String endpoint() { + return this.innerModel().endpoint(); + } + + public DataLakeAnalyticsAccountBasicInner innerModel() { + return this.innerObject; + } + + private DataLakeAnalyticsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/DataLakeAnalyticsAccountImpl.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/DataLakeAnalyticsAccountImpl.java new file mode 100644 index 000000000000..9a78aa923a04 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/DataLakeAnalyticsAccountImpl.java @@ -0,0 +1,499 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datalakeanalytics.DataLakeAnalyticsManager; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.ComputePolicyInner; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.DataLakeAnalyticsAccountInner; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.DataLakeStoreAccountInformationInner; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.FirewallRuleInner; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.StorageAccountInformationInner; +import com.azure.resourcemanager.datalakeanalytics.models.AddDataLakeStoreWithAccountParameters; +import com.azure.resourcemanager.datalakeanalytics.models.AddStorageAccountWithAccountParameters; +import com.azure.resourcemanager.datalakeanalytics.models.ComputePolicy; +import com.azure.resourcemanager.datalakeanalytics.models.CreateComputePolicyWithAccountParameters; +import com.azure.resourcemanager.datalakeanalytics.models.CreateDataLakeAnalyticsAccountParameters; +import com.azure.resourcemanager.datalakeanalytics.models.CreateFirewallRuleWithAccountParameters; +import com.azure.resourcemanager.datalakeanalytics.models.DataLakeAnalyticsAccount; +import com.azure.resourcemanager.datalakeanalytics.models.DataLakeAnalyticsAccountState; +import com.azure.resourcemanager.datalakeanalytics.models.DataLakeAnalyticsAccountStatus; +import com.azure.resourcemanager.datalakeanalytics.models.DataLakeStoreAccountInformation; +import com.azure.resourcemanager.datalakeanalytics.models.DebugDataAccessLevel; +import com.azure.resourcemanager.datalakeanalytics.models.FirewallAllowAzureIpsState; +import com.azure.resourcemanager.datalakeanalytics.models.FirewallRule; +import com.azure.resourcemanager.datalakeanalytics.models.FirewallState; +import com.azure.resourcemanager.datalakeanalytics.models.HiveMetastore; +import com.azure.resourcemanager.datalakeanalytics.models.StorageAccountInformation; +import com.azure.resourcemanager.datalakeanalytics.models.TierType; +import com.azure.resourcemanager.datalakeanalytics.models.UpdateComputePolicyWithAccountParameters; +import com.azure.resourcemanager.datalakeanalytics.models.UpdateDataLakeAnalyticsAccountParameters; +import com.azure.resourcemanager.datalakeanalytics.models.UpdateDataLakeStoreWithAccountParameters; +import com.azure.resourcemanager.datalakeanalytics.models.UpdateFirewallRuleWithAccountParameters; +import com.azure.resourcemanager.datalakeanalytics.models.UpdateStorageAccountWithAccountParameters; +import com.azure.resourcemanager.datalakeanalytics.models.VirtualNetworkRule; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.stream.Collectors; + +public final class DataLakeAnalyticsAccountImpl + implements DataLakeAnalyticsAccount, DataLakeAnalyticsAccount.Definition, DataLakeAnalyticsAccount.Update { + private DataLakeAnalyticsAccountInner innerObject; + + private final DataLakeAnalyticsManager 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 UUID accountId() { + return this.innerModel().accountId(); + } + + public DataLakeAnalyticsAccountStatus provisioningState() { + return this.innerModel().provisioningState(); + } + + public DataLakeAnalyticsAccountState state() { + return this.innerModel().state(); + } + + public OffsetDateTime creationTime() { + return this.innerModel().creationTime(); + } + + public OffsetDateTime lastModifiedTime() { + return this.innerModel().lastModifiedTime(); + } + + public String endpoint() { + return this.innerModel().endpoint(); + } + + public String defaultDataLakeStoreAccount() { + return this.innerModel().defaultDataLakeStoreAccount(); + } + + public List dataLakeStoreAccounts() { + List inner = this.innerModel().dataLakeStoreAccounts(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new DataLakeStoreAccountInformationImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List publicDataLakeStoreAccounts() { + List inner = this.innerModel().publicDataLakeStoreAccounts(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new DataLakeStoreAccountInformationImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List storageAccounts() { + List inner = this.innerModel().storageAccounts(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new StorageAccountInformationImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List computePolicies() { + List inner = this.innerModel().computePolicies(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ComputePolicyImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List hiveMetastores() { + List inner = this.innerModel().hiveMetastores(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List virtualNetworkRules() { + List inner = this.innerModel().virtualNetworkRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List firewallRules() { + List inner = this.innerModel().firewallRules(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new FirewallRuleImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public FirewallState firewallState() { + return this.innerModel().firewallState(); + } + + public FirewallAllowAzureIpsState firewallAllowAzureIps() { + return this.innerModel().firewallAllowAzureIps(); + } + + public TierType newTier() { + return this.innerModel().newTier(); + } + + public TierType currentTier() { + return this.innerModel().currentTier(); + } + + public Integer maxJobCount() { + return this.innerModel().maxJobCount(); + } + + public Integer systemMaxJobCount() { + return this.innerModel().systemMaxJobCount(); + } + + public Integer maxDegreeOfParallelism() { + return this.innerModel().maxDegreeOfParallelism(); + } + + public Integer systemMaxDegreeOfParallelism() { + return this.innerModel().systemMaxDegreeOfParallelism(); + } + + public Integer maxDegreeOfParallelismPerJob() { + return this.innerModel().maxDegreeOfParallelismPerJob(); + } + + public Integer minPriorityPerJob() { + return this.innerModel().minPriorityPerJob(); + } + + public Integer queryStoreRetention() { + return this.innerModel().queryStoreRetention(); + } + + public DebugDataAccessLevel debugDataAccessLevel() { + return this.innerModel().debugDataAccessLevel(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public DataLakeAnalyticsAccountInner innerModel() { + return this.innerObject; + } + + private DataLakeAnalyticsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private CreateDataLakeAnalyticsAccountParameters createParameters; + + private UpdateDataLakeAnalyticsAccountParameters updateParameters; + + public DataLakeAnalyticsAccountImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public DataLakeAnalyticsAccount create() { + this.innerObject = + serviceManager + .serviceClient() + .getAccounts() + .create(resourceGroupName, accountName, createParameters, Context.NONE); + return this; + } + + public DataLakeAnalyticsAccount create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAccounts() + .create(resourceGroupName, accountName, createParameters, context); + return this; + } + + DataLakeAnalyticsAccountImpl(String name, DataLakeAnalyticsManager serviceManager) { + this.innerObject = new DataLakeAnalyticsAccountInner(); + this.serviceManager = serviceManager; + this.accountName = name; + this.createParameters = new CreateDataLakeAnalyticsAccountParameters(); + } + + public DataLakeAnalyticsAccountImpl update() { + this.updateParameters = new UpdateDataLakeAnalyticsAccountParameters(); + return this; + } + + public DataLakeAnalyticsAccount apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAccounts() + .update(resourceGroupName, accountName, updateParameters, Context.NONE); + return this; + } + + public DataLakeAnalyticsAccount apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAccounts() + .update(resourceGroupName, accountName, updateParameters, context); + return this; + } + + DataLakeAnalyticsAccountImpl(DataLakeAnalyticsAccountInner innerObject, DataLakeAnalyticsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "accounts"); + } + + public DataLakeAnalyticsAccount refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAccounts() + .getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE) + .getValue(); + return this; + } + + public DataLakeAnalyticsAccount refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAccounts() + .getByResourceGroupWithResponse(resourceGroupName, accountName, context) + .getValue(); + return this; + } + + public DataLakeAnalyticsAccountImpl withRegion(Region location) { + this.createParameters.withLocation(location.toString()); + return this; + } + + public DataLakeAnalyticsAccountImpl withRegion(String location) { + this.createParameters.withLocation(location); + return this; + } + + public DataLakeAnalyticsAccountImpl withDefaultDataLakeStoreAccount(String defaultDataLakeStoreAccount) { + this.createParameters.withDefaultDataLakeStoreAccount(defaultDataLakeStoreAccount); + return this; + } + + public DataLakeAnalyticsAccountImpl withDataLakeStoreAccounts( + List dataLakeStoreAccounts) { + this.createParameters.withDataLakeStoreAccounts(dataLakeStoreAccounts); + return this; + } + + public DataLakeAnalyticsAccountImpl withTags(Map tags) { + if (isInCreateMode()) { + this.createParameters.withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public DataLakeAnalyticsAccountImpl withStorageAccounts( + List storageAccounts) { + this.createParameters.withStorageAccounts(storageAccounts); + return this; + } + + public DataLakeAnalyticsAccountImpl withComputePolicies( + List computePolicies) { + this.createParameters.withComputePolicies(computePolicies); + return this; + } + + public DataLakeAnalyticsAccountImpl withFirewallRules(List firewallRules) { + this.createParameters.withFirewallRules(firewallRules); + return this; + } + + public DataLakeAnalyticsAccountImpl withFirewallState(FirewallState firewallState) { + if (isInCreateMode()) { + this.createParameters.withFirewallState(firewallState); + return this; + } else { + this.updateParameters.withFirewallState(firewallState); + return this; + } + } + + public DataLakeAnalyticsAccountImpl withFirewallAllowAzureIps(FirewallAllowAzureIpsState firewallAllowAzureIps) { + if (isInCreateMode()) { + this.createParameters.withFirewallAllowAzureIps(firewallAllowAzureIps); + return this; + } else { + this.updateParameters.withFirewallAllowAzureIps(firewallAllowAzureIps); + return this; + } + } + + public DataLakeAnalyticsAccountImpl withNewTier(TierType newTier) { + if (isInCreateMode()) { + this.createParameters.withNewTier(newTier); + return this; + } else { + this.updateParameters.withNewTier(newTier); + return this; + } + } + + public DataLakeAnalyticsAccountImpl withMaxJobCount(Integer maxJobCount) { + if (isInCreateMode()) { + this.createParameters.withMaxJobCount(maxJobCount); + return this; + } else { + this.updateParameters.withMaxJobCount(maxJobCount); + return this; + } + } + + public DataLakeAnalyticsAccountImpl withMaxDegreeOfParallelism(Integer maxDegreeOfParallelism) { + if (isInCreateMode()) { + this.createParameters.withMaxDegreeOfParallelism(maxDegreeOfParallelism); + return this; + } else { + this.updateParameters.withMaxDegreeOfParallelism(maxDegreeOfParallelism); + return this; + } + } + + public DataLakeAnalyticsAccountImpl withMaxDegreeOfParallelismPerJob(Integer maxDegreeOfParallelismPerJob) { + if (isInCreateMode()) { + this.createParameters.withMaxDegreeOfParallelismPerJob(maxDegreeOfParallelismPerJob); + return this; + } else { + this.updateParameters.withMaxDegreeOfParallelismPerJob(maxDegreeOfParallelismPerJob); + return this; + } + } + + public DataLakeAnalyticsAccountImpl withMinPriorityPerJob(Integer minPriorityPerJob) { + if (isInCreateMode()) { + this.createParameters.withMinPriorityPerJob(minPriorityPerJob); + return this; + } else { + this.updateParameters.withMinPriorityPerJob(minPriorityPerJob); + return this; + } + } + + public DataLakeAnalyticsAccountImpl withQueryStoreRetention(Integer queryStoreRetention) { + if (isInCreateMode()) { + this.createParameters.withQueryStoreRetention(queryStoreRetention); + return this; + } else { + this.updateParameters.withQueryStoreRetention(queryStoreRetention); + return this; + } + } + + public DataLakeAnalyticsAccountImpl withDataLakeStoreAccountsForUpdate( + List dataLakeStoreAccounts) { + this.updateParameters.withDataLakeStoreAccounts(dataLakeStoreAccounts); + return this; + } + + public DataLakeAnalyticsAccountImpl withStorageAccountsForUpdate( + List storageAccounts) { + this.updateParameters.withStorageAccounts(storageAccounts); + return this; + } + + public DataLakeAnalyticsAccountImpl withComputePoliciesForUpdate( + List computePolicies) { + this.updateParameters.withComputePolicies(computePolicies); + return this; + } + + public DataLakeAnalyticsAccountImpl withFirewallRulesForUpdate( + List firewallRules) { + this.updateParameters.withFirewallRules(firewallRules); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/DataLakeAnalyticsAccountManagementClientBuilder.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/DataLakeAnalyticsAccountManagementClientBuilder.java new file mode 100644 index 000000000000..37d94e8223a8 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/DataLakeAnalyticsAccountManagementClientBuilder.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.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 DataLakeAnalyticsAccountManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {DataLakeAnalyticsAccountManagementClientImpl.class}) +public final class DataLakeAnalyticsAccountManagementClientBuilder { + /* + * Get subscription credentials which uniquely identify Microsoft Azure + * subscription. The subscription ID forms part of the URI for every + * service call. + */ + private String subscriptionId; + + /** + * Sets Get subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the DataLakeAnalyticsAccountManagementClientBuilder. + */ + public DataLakeAnalyticsAccountManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the DataLakeAnalyticsAccountManagementClientBuilder. + */ + public DataLakeAnalyticsAccountManagementClientBuilder 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 DataLakeAnalyticsAccountManagementClientBuilder. + */ + public DataLakeAnalyticsAccountManagementClientBuilder 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 DataLakeAnalyticsAccountManagementClientBuilder. + */ + public DataLakeAnalyticsAccountManagementClientBuilder 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 DataLakeAnalyticsAccountManagementClientBuilder. + */ + public DataLakeAnalyticsAccountManagementClientBuilder 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 DataLakeAnalyticsAccountManagementClientBuilder. + */ + public DataLakeAnalyticsAccountManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of DataLakeAnalyticsAccountManagementClientImpl with the provided parameters. + * + * @return an instance of DataLakeAnalyticsAccountManagementClientImpl. + */ + public DataLakeAnalyticsAccountManagementClientImpl 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(); + } + DataLakeAnalyticsAccountManagementClientImpl client = + new DataLakeAnalyticsAccountManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/DataLakeAnalyticsAccountManagementClientImpl.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/DataLakeAnalyticsAccountManagementClientImpl.java new file mode 100644 index 000000000000..21b7c8b1b815 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/DataLakeAnalyticsAccountManagementClientImpl.java @@ -0,0 +1,382 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.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.datalakeanalytics.fluent.AccountsClient; +import com.azure.resourcemanager.datalakeanalytics.fluent.ComputePoliciesClient; +import com.azure.resourcemanager.datalakeanalytics.fluent.DataLakeAnalyticsAccountManagementClient; +import com.azure.resourcemanager.datalakeanalytics.fluent.DataLakeStoreAccountsClient; +import com.azure.resourcemanager.datalakeanalytics.fluent.FirewallRulesClient; +import com.azure.resourcemanager.datalakeanalytics.fluent.LocationsClient; +import com.azure.resourcemanager.datalakeanalytics.fluent.OperationsClient; +import com.azure.resourcemanager.datalakeanalytics.fluent.StorageAccountsClient; +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 DataLakeAnalyticsAccountManagementClientImpl type. */ +@ServiceClient(builder = DataLakeAnalyticsAccountManagementClientBuilder.class) +public final class DataLakeAnalyticsAccountManagementClientImpl implements DataLakeAnalyticsAccountManagementClient { + private final ClientLogger logger = new ClientLogger(DataLakeAnalyticsAccountManagementClientImpl.class); + + /** + * Get subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part + * of the URI for every service call. + */ + private final String subscriptionId; + + /** + * Gets Get subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @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 AccountsClient object to access its operations. */ + private final AccountsClient accounts; + + /** + * Gets the AccountsClient object to access its operations. + * + * @return the AccountsClient object. + */ + public AccountsClient getAccounts() { + return this.accounts; + } + + /** The DataLakeStoreAccountsClient object to access its operations. */ + private final DataLakeStoreAccountsClient dataLakeStoreAccounts; + + /** + * Gets the DataLakeStoreAccountsClient object to access its operations. + * + * @return the DataLakeStoreAccountsClient object. + */ + public DataLakeStoreAccountsClient getDataLakeStoreAccounts() { + return this.dataLakeStoreAccounts; + } + + /** The StorageAccountsClient object to access its operations. */ + private final StorageAccountsClient storageAccounts; + + /** + * Gets the StorageAccountsClient object to access its operations. + * + * @return the StorageAccountsClient object. + */ + public StorageAccountsClient getStorageAccounts() { + return this.storageAccounts; + } + + /** The ComputePoliciesClient object to access its operations. */ + private final ComputePoliciesClient computePolicies; + + /** + * Gets the ComputePoliciesClient object to access its operations. + * + * @return the ComputePoliciesClient object. + */ + public ComputePoliciesClient getComputePolicies() { + return this.computePolicies; + } + + /** The FirewallRulesClient object to access its operations. */ + private final FirewallRulesClient firewallRules; + + /** + * Gets the FirewallRulesClient object to access its operations. + * + * @return the FirewallRulesClient object. + */ + public FirewallRulesClient getFirewallRules() { + return this.firewallRules; + } + + /** 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 LocationsClient object to access its operations. */ + private final LocationsClient locations; + + /** + * Gets the LocationsClient object to access its operations. + * + * @return the LocationsClient object. + */ + public LocationsClient getLocations() { + return this.locations; + } + + /** + * Initializes an instance of DataLakeAnalyticsAccountManagementClient 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 Get subscription credentials which uniquely identify Microsoft Azure subscription. The + * subscription ID forms part of the URI for every service call. + * @param endpoint server parameter. + */ + DataLakeAnalyticsAccountManagementClientImpl( + 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 = "2016-11-01"; + this.accounts = new AccountsClientImpl(this); + this.dataLakeStoreAccounts = new DataLakeStoreAccountsClientImpl(this); + this.storageAccounts = new StorageAccountsClientImpl(this); + this.computePolicies = new ComputePoliciesClientImpl(this); + this.firewallRules = new FirewallRulesClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.locations = new LocationsClientImpl(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/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/DataLakeStoreAccountInformationImpl.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/DataLakeStoreAccountInformationImpl.java new file mode 100644 index 000000000000..83cf39310188 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/DataLakeStoreAccountInformationImpl.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.datalakeanalytics.implementation; + +import com.azure.resourcemanager.datalakeanalytics.DataLakeAnalyticsManager; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.DataLakeStoreAccountInformationInner; +import com.azure.resourcemanager.datalakeanalytics.models.DataLakeStoreAccountInformation; + +public final class DataLakeStoreAccountInformationImpl implements DataLakeStoreAccountInformation { + private DataLakeStoreAccountInformationInner innerObject; + + private final DataLakeAnalyticsManager serviceManager; + + DataLakeStoreAccountInformationImpl( + DataLakeStoreAccountInformationInner innerObject, DataLakeAnalyticsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String suffix() { + return this.innerModel().suffix(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public DataLakeStoreAccountInformationInner innerModel() { + return this.innerObject; + } + + private DataLakeAnalyticsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/DataLakeStoreAccountsClientImpl.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/DataLakeStoreAccountsClientImpl.java new file mode 100644 index 000000000000..09db56c2478a --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/DataLakeStoreAccountsClientImpl.java @@ -0,0 +1,1076 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datalakeanalytics.fluent.DataLakeStoreAccountsClient; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.DataLakeStoreAccountInformationInner; +import com.azure.resourcemanager.datalakeanalytics.models.AddDataLakeStoreParameters; +import com.azure.resourcemanager.datalakeanalytics.models.DataLakeStoreAccountInformationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DataLakeStoreAccountsClient. */ +public final class DataLakeStoreAccountsClientImpl implements DataLakeStoreAccountsClient { + private final ClientLogger logger = new ClientLogger(DataLakeStoreAccountsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DataLakeStoreAccountsService service; + + /** The service client containing this operation class. */ + private final DataLakeAnalyticsAccountManagementClientImpl client; + + /** + * Initializes an instance of DataLakeStoreAccountsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataLakeStoreAccountsClientImpl(DataLakeAnalyticsAccountManagementClientImpl client) { + this.service = + RestProxy + .create(DataLakeStoreAccountsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataLakeAnalyticsAccountManagementClientDataLakeStoreAccounts to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataLakeAnalyticsAcc") + private interface DataLakeStoreAccountsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts/{accountName}/dataLakeStoreAccounts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByAccount( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("$select") String select, + @QueryParam("$orderby") String orderby, + @QueryParam("$count") Boolean count, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts/{accountName}/dataLakeStoreAccounts/{dataLakeStoreAccountName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> add( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("dataLakeStoreAccountName") String dataLakeStoreAccountName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AddDataLakeStoreParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts/{accountName}/dataLakeStoreAccounts/{dataLakeStoreAccountName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("dataLakeStoreAccountName") String dataLakeStoreAccountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts/{accountName}/dataLakeStoreAccounts/{dataLakeStoreAccountName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("dataLakeStoreAccountName") String dataLakeStoreAccountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByAccountNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response + * includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountSinglePageAsync( + String resourceGroupName, + String accountName, + String filter, + Integer top, + Integer skip, + String select, + String orderby, + Boolean count) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByAccount( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + filter, + top, + skip, + select, + orderby, + count, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response + * includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountSinglePageAsync( + String resourceGroupName, + String accountName, + String filter, + Integer top, + Integer skip, + String select, + String orderby, + Boolean count, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByAccount( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + filter, + top, + skip, + select, + orderby, + count, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response + * includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByAccountAsync( + String resourceGroupName, + String accountName, + String filter, + Integer top, + Integer skip, + String select, + String orderby, + Boolean count) { + return new PagedFlux<>( + () -> + listByAccountSinglePageAsync(resourceGroupName, accountName, filter, top, skip, select, orderby, count), + nextLink -> listByAccountNextSinglePageAsync(nextLink)); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response + * includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByAccountAsync( + String resourceGroupName, String accountName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + return new PagedFlux<>( + () -> + listByAccountSinglePageAsync(resourceGroupName, accountName, filter, top, skip, select, orderby, count), + nextLink -> listByAccountNextSinglePageAsync(nextLink)); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response + * includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByAccountAsync( + String resourceGroupName, + String accountName, + String filter, + Integer top, + Integer skip, + String select, + String orderby, + Boolean count, + Context context) { + return new PagedFlux<>( + () -> + listByAccountSinglePageAsync( + resourceGroupName, accountName, filter, top, skip, select, orderby, count, context), + nextLink -> listByAccountNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response + * includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByAccount( + String resourceGroupName, String accountName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + return new PagedIterable<>( + listByAccountAsync(resourceGroupName, accountName, filter, top, skip, select, orderby, count)); + } + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response + * includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByAccount( + String resourceGroupName, + String accountName, + String filter, + Integer top, + Integer skip, + String select, + String orderby, + Boolean count, + Context context) { + return new PagedIterable<>( + listByAccountAsync(resourceGroupName, accountName, filter, top, skip, select, orderby, count, context)); + } + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @param parameters The details of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> addWithResponseAsync( + String resourceGroupName, + String accountName, + String dataLakeStoreAccountName, + AddDataLakeStoreParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (dataLakeStoreAccountName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter dataLakeStoreAccountName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .add( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + dataLakeStoreAccountName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @param parameters The details of the Data Lake Store account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> addWithResponseAsync( + String resourceGroupName, + String accountName, + String dataLakeStoreAccountName, + AddDataLakeStoreParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (dataLakeStoreAccountName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter dataLakeStoreAccountName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .add( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + dataLakeStoreAccountName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @param parameters The details of the Data Lake Store account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono addAsync( + String resourceGroupName, + String accountName, + String dataLakeStoreAccountName, + AddDataLakeStoreParameters parameters) { + return addWithResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName, parameters) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 addAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + final AddDataLakeStoreParameters parameters = null; + return addWithResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName, parameters) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 add(String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + final AddDataLakeStoreParameters parameters = null; + addAsync(resourceGroupName, accountName, dataLakeStoreAccountName, parameters).block(); + } + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @param parameters The details of the Data Lake Store account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response addWithResponse( + String resourceGroupName, + String accountName, + String dataLakeStoreAccountName, + AddDataLakeStoreParameters parameters, + Context context) { + return addWithResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName, parameters, context) + .block(); + } + + /** + * Gets the specified Data Lake Store account details in the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Store account details in the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (dataLakeStoreAccountName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter dataLakeStoreAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + dataLakeStoreAccountName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the specified Data Lake Store account details in the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Store account details in the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String dataLakeStoreAccountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (dataLakeStoreAccountName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter dataLakeStoreAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + dataLakeStoreAccountName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the specified Data Lake Store account details in the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Store account details in the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + return getWithResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Data Lake Store account details in the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Store account details in the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataLakeStoreAccountInformationInner get( + String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + return getAsync(resourceGroupName, accountName, dataLakeStoreAccountName).block(); + } + + /** + * Gets the specified Data Lake Store account details in the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Store account details in the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String dataLakeStoreAccountName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName, context).block(); + } + + /** + * Updates the Data Lake Analytics account specified to remove the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (dataLakeStoreAccountName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter dataLakeStoreAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + dataLakeStoreAccountName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the Data Lake Analytics account specified to remove the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String dataLakeStoreAccountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (dataLakeStoreAccountName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter dataLakeStoreAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + dataLakeStoreAccountName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Updates the Data Lake Analytics account specified to remove the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + return deleteWithResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Updates the Data Lake Analytics account specified to remove the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + deleteAsync(resourceGroupName, accountName, dataLakeStoreAccountName).block(); + } + + /** + * Updates the Data Lake Analytics account specified to remove the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String accountName, String dataLakeStoreAccountName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName, 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 data Lake Store account list information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountNextSinglePageAsync( + 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.listByAccountNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 data Lake Store account list information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountNextSinglePageAsync( + 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 + .listByAccountNext(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/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/DataLakeStoreAccountsImpl.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/DataLakeStoreAccountsImpl.java new file mode 100644 index 000000000000..5a316ac61c30 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/DataLakeStoreAccountsImpl.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.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.datalakeanalytics.DataLakeAnalyticsManager; +import com.azure.resourcemanager.datalakeanalytics.fluent.DataLakeStoreAccountsClient; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.DataLakeStoreAccountInformationInner; +import com.azure.resourcemanager.datalakeanalytics.models.AddDataLakeStoreParameters; +import com.azure.resourcemanager.datalakeanalytics.models.DataLakeStoreAccountInformation; +import com.azure.resourcemanager.datalakeanalytics.models.DataLakeStoreAccounts; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DataLakeStoreAccountsImpl implements DataLakeStoreAccounts { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataLakeStoreAccountsImpl.class); + + private final DataLakeStoreAccountsClient innerClient; + + private final DataLakeAnalyticsManager serviceManager; + + public DataLakeStoreAccountsImpl(DataLakeStoreAccountsClient innerClient, DataLakeAnalyticsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByAccount(String resourceGroupName, String accountName) { + PagedIterable inner = + this.serviceClient().listByAccount(resourceGroupName, accountName); + return Utils.mapPage(inner, inner1 -> new DataLakeStoreAccountInformationImpl(inner1, this.manager())); + } + + public PagedIterable listByAccount( + String resourceGroupName, + String accountName, + String filter, + Integer top, + Integer skip, + String select, + String orderby, + Boolean count, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByAccount(resourceGroupName, accountName, filter, top, skip, select, orderby, count, context); + return Utils.mapPage(inner, inner1 -> new DataLakeStoreAccountInformationImpl(inner1, this.manager())); + } + + public void add(String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + this.serviceClient().add(resourceGroupName, accountName, dataLakeStoreAccountName); + } + + public Response addWithResponse( + String resourceGroupName, + String accountName, + String dataLakeStoreAccountName, + AddDataLakeStoreParameters parameters, + Context context) { + return this + .serviceClient() + .addWithResponse(resourceGroupName, accountName, dataLakeStoreAccountName, parameters, context); + } + + public DataLakeStoreAccountInformation get( + String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + DataLakeStoreAccountInformationInner inner = + this.serviceClient().get(resourceGroupName, accountName, dataLakeStoreAccountName); + if (inner != null) { + return new DataLakeStoreAccountInformationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String dataLakeStoreAccountName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, dataLakeStoreAccountName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DataLakeStoreAccountInformationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String dataLakeStoreAccountName) { + this.serviceClient().delete(resourceGroupName, accountName, dataLakeStoreAccountName); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, String dataLakeStoreAccountName, Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, accountName, dataLakeStoreAccountName, context); + } + + private DataLakeStoreAccountsClient serviceClient() { + return this.innerClient; + } + + private DataLakeAnalyticsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/FirewallRuleImpl.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/FirewallRuleImpl.java new file mode 100644 index 000000000000..b1087be0fd04 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/FirewallRuleImpl.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.datalakeanalytics.DataLakeAnalyticsManager; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.FirewallRuleInner; +import com.azure.resourcemanager.datalakeanalytics.models.CreateOrUpdateFirewallRuleParameters; +import com.azure.resourcemanager.datalakeanalytics.models.FirewallRule; +import com.azure.resourcemanager.datalakeanalytics.models.UpdateFirewallRuleParameters; + +public final class FirewallRuleImpl implements FirewallRule, FirewallRule.Definition, FirewallRule.Update { + private FirewallRuleInner innerObject; + + private final DataLakeAnalyticsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String startIpAddress() { + return this.innerModel().startIpAddress(); + } + + public String endIpAddress() { + return this.innerModel().endIpAddress(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public FirewallRuleInner innerModel() { + return this.innerObject; + } + + private DataLakeAnalyticsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String firewallRuleName; + + private CreateOrUpdateFirewallRuleParameters createParameters; + + private UpdateFirewallRuleParameters updateParameters; + + public FirewallRuleImpl withExistingAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public FirewallRule create() { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallRules() + .createOrUpdateWithResponse( + resourceGroupName, accountName, firewallRuleName, createParameters, Context.NONE) + .getValue(); + return this; + } + + public FirewallRule create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallRules() + .createOrUpdateWithResponse(resourceGroupName, accountName, firewallRuleName, createParameters, context) + .getValue(); + return this; + } + + FirewallRuleImpl(String name, DataLakeAnalyticsManager serviceManager) { + this.innerObject = new FirewallRuleInner(); + this.serviceManager = serviceManager; + this.firewallRuleName = name; + this.createParameters = new CreateOrUpdateFirewallRuleParameters(); + } + + public FirewallRuleImpl update() { + this.updateParameters = new UpdateFirewallRuleParameters(); + return this; + } + + public FirewallRule apply() { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallRules() + .updateWithResponse(resourceGroupName, accountName, firewallRuleName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public FirewallRule apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallRules() + .updateWithResponse(resourceGroupName, accountName, firewallRuleName, updateParameters, context) + .getValue(); + return this; + } + + FirewallRuleImpl(FirewallRuleInner innerObject, DataLakeAnalyticsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = Utils.getValueFromIdByName(innerObject.id(), "accounts"); + this.firewallRuleName = Utils.getValueFromIdByName(innerObject.id(), "firewallRules"); + } + + public FirewallRule refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallRules() + .getWithResponse(resourceGroupName, accountName, firewallRuleName, Context.NONE) + .getValue(); + return this; + } + + public FirewallRule refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFirewallRules() + .getWithResponse(resourceGroupName, accountName, firewallRuleName, context) + .getValue(); + return this; + } + + public FirewallRuleImpl withStartIpAddress(String startIpAddress) { + if (isInCreateMode()) { + this.createParameters.withStartIpAddress(startIpAddress); + return this; + } else { + this.updateParameters.withStartIpAddress(startIpAddress); + return this; + } + } + + public FirewallRuleImpl withEndIpAddress(String endIpAddress) { + if (isInCreateMode()) { + this.createParameters.withEndIpAddress(endIpAddress); + return this; + } else { + this.updateParameters.withEndIpAddress(endIpAddress); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/FirewallRulesClientImpl.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/FirewallRulesClientImpl.java new file mode 100644 index 000000000000..eecc6fb71755 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/FirewallRulesClientImpl.java @@ -0,0 +1,1153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datalakeanalytics.fluent.FirewallRulesClient; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.FirewallRuleInner; +import com.azure.resourcemanager.datalakeanalytics.models.CreateOrUpdateFirewallRuleParameters; +import com.azure.resourcemanager.datalakeanalytics.models.FirewallRuleListResult; +import com.azure.resourcemanager.datalakeanalytics.models.UpdateFirewallRuleParameters; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in FirewallRulesClient. */ +public final class FirewallRulesClientImpl implements FirewallRulesClient { + private final ClientLogger logger = new ClientLogger(FirewallRulesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final FirewallRulesService service; + + /** The service client containing this operation class. */ + private final DataLakeAnalyticsAccountManagementClientImpl client; + + /** + * Initializes an instance of FirewallRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FirewallRulesClientImpl(DataLakeAnalyticsAccountManagementClientImpl client) { + this.service = + RestProxy.create(FirewallRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataLakeAnalyticsAccountManagementClientFirewallRules to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataLakeAnalyticsAcc") + private interface FirewallRulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts/{accountName}/firewallRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByAccount( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts/{accountName}/firewallRules/{firewallRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("firewallRuleName") String firewallRuleName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CreateOrUpdateFirewallRuleParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts/{accountName}/firewallRules/{firewallRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("firewallRuleName") String firewallRuleName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts/{accountName}/firewallRules/{firewallRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("firewallRuleName") String firewallRuleName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateFirewallRuleParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts/{accountName}/firewallRules/{firewallRuleName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("firewallRuleName") String firewallRuleName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByAccountNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the Data Lake Analytics firewall rules within the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics firewall rule list information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountSinglePageAsync( + String resourceGroupName, String accountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByAccount( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists the Data Lake Analytics firewall rules within the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics firewall rule list information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountSinglePageAsync( + String resourceGroupName, String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByAccount( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the Data Lake Analytics firewall rules within the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics firewall rule list information. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByAccountAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>( + () -> listByAccountSinglePageAsync(resourceGroupName, accountName), + nextLink -> listByAccountNextSinglePageAsync(nextLink)); + } + + /** + * Lists the Data Lake Analytics firewall rules within the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics firewall rule list information. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByAccountAsync( + String resourceGroupName, String accountName, Context context) { + return new PagedFlux<>( + () -> listByAccountSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listByAccountNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the Data Lake Analytics firewall rules within the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics firewall rule list information. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByAccount(String resourceGroupName, String accountName) { + return new PagedIterable<>(listByAccountAsync(resourceGroupName, accountName)); + } + + /** + * Lists the Data Lake Analytics firewall rules within the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics firewall rule list information. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByAccount( + String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(listByAccountAsync(resourceGroupName, accountName, context)); + } + + /** + * Creates or updates the specified firewall rule. During update, the firewall rule with the specified name will be + * replaced with this new firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to create or update. + * @param parameters Parameters supplied to create or update the firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics firewall rule information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String accountName, + String firewallRuleName, + CreateOrUpdateFirewallRuleParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (firewallRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + firewallRuleName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates the specified firewall rule. During update, the firewall rule with the specified name will be + * replaced with this new firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to create or update. + * @param parameters Parameters supplied to create or update the firewall rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics firewall rule information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String accountName, + String firewallRuleName, + CreateOrUpdateFirewallRuleParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (firewallRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + firewallRuleName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Creates or updates the specified firewall rule. During update, the firewall rule with the specified name will be + * replaced with this new firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to create or update. + * @param parameters Parameters supplied to create or update the firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics firewall rule information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String accountName, + String firewallRuleName, + CreateOrUpdateFirewallRuleParameters parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the specified firewall rule. During update, the firewall rule with the specified name will be + * replaced with this new firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to create or update. + * @param parameters Parameters supplied to create or update the firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics firewall rule information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FirewallRuleInner createOrUpdate( + String resourceGroupName, + String accountName, + String firewallRuleName, + CreateOrUpdateFirewallRuleParameters parameters) { + return createOrUpdateAsync(resourceGroupName, accountName, firewallRuleName, parameters).block(); + } + + /** + * Creates or updates the specified firewall rule. During update, the firewall rule with the specified name will be + * replaced with this new firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to create or update. + * @param parameters Parameters supplied to create or update the firewall rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics firewall rule information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String accountName, + String firewallRuleName, + CreateOrUpdateFirewallRuleParameters parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters, context) + .block(); + } + + /** + * Gets the specified Data Lake Analytics firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Analytics firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String firewallRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (firewallRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + firewallRuleName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the specified Data Lake Analytics firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Analytics firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String firewallRuleName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (firewallRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + firewallRuleName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the specified Data Lake Analytics firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Analytics firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String firewallRuleName) { + return getWithResponseAsync(resourceGroupName, accountName, firewallRuleName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Data Lake Analytics firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Analytics firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FirewallRuleInner get(String resourceGroupName, String accountName, String firewallRuleName) { + return getAsync(resourceGroupName, accountName, firewallRuleName).block(); + } + + /** + * Gets the specified Data Lake Analytics firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Analytics firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String firewallRuleName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, firewallRuleName, context).block(); + } + + /** + * Updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to update. + * @param parameters Parameters supplied to update the firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics firewall rule information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String accountName, + String firewallRuleName, + UpdateFirewallRuleParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (firewallRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + firewallRuleName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to update. + * @param parameters Parameters supplied to update the firewall rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics firewall rule information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String accountName, + String firewallRuleName, + UpdateFirewallRuleParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (firewallRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + firewallRuleName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to update. + * @param parameters Parameters supplied to update the firewall rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics firewall rule information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String accountName, + String firewallRuleName, + UpdateFirewallRuleParameters parameters) { + return updateWithResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics firewall rule information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String accountName, String firewallRuleName) { + final UpdateFirewallRuleParameters parameters = null; + return updateWithResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics firewall rule information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FirewallRuleInner update(String resourceGroupName, String accountName, String firewallRuleName) { + final UpdateFirewallRuleParameters parameters = null; + return updateAsync(resourceGroupName, accountName, firewallRuleName, parameters).block(); + } + + /** + * Updates the specified firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to update. + * @param parameters Parameters supplied to update the firewall rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics firewall rule information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String accountName, + String firewallRuleName, + UpdateFirewallRuleParameters parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters, context).block(); + } + + /** + * Deletes the specified firewall rule from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String firewallRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (firewallRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + firewallRuleName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the specified firewall rule from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String firewallRuleName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (firewallRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + firewallRuleName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the specified firewall rule from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String firewallRuleName) { + return deleteWithResponseAsync(resourceGroupName, accountName, firewallRuleName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the specified firewall rule from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String firewallRuleName) { + deleteAsync(resourceGroupName, accountName, firewallRuleName).block(); + } + + /** + * Deletes the specified firewall rule from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String accountName, String firewallRuleName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, firewallRuleName, 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 data Lake Analytics firewall rule list information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountNextSinglePageAsync(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.listByAccountNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 data Lake Analytics firewall rule list information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountNextSinglePageAsync(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 + .listByAccountNext(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/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/FirewallRulesImpl.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/FirewallRulesImpl.java new file mode 100644 index 000000000000..ef61b7c8bc70 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/FirewallRulesImpl.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.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.datalakeanalytics.DataLakeAnalyticsManager; +import com.azure.resourcemanager.datalakeanalytics.fluent.FirewallRulesClient; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.FirewallRuleInner; +import com.azure.resourcemanager.datalakeanalytics.models.FirewallRule; +import com.azure.resourcemanager.datalakeanalytics.models.FirewallRules; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class FirewallRulesImpl implements FirewallRules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallRulesImpl.class); + + private final FirewallRulesClient innerClient; + + private final DataLakeAnalyticsManager serviceManager; + + public FirewallRulesImpl(FirewallRulesClient innerClient, DataLakeAnalyticsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByAccount(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().listByAccount(resourceGroupName, accountName); + return Utils.mapPage(inner, inner1 -> new FirewallRuleImpl(inner1, this.manager())); + } + + public PagedIterable listByAccount(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = + this.serviceClient().listByAccount(resourceGroupName, accountName, context); + return Utils.mapPage(inner, inner1 -> new FirewallRuleImpl(inner1, this.manager())); + } + + public FirewallRule get(String resourceGroupName, String accountName, String firewallRuleName) { + FirewallRuleInner inner = this.serviceClient().get(resourceGroupName, accountName, firewallRuleName); + if (inner != null) { + return new FirewallRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String firewallRuleName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, firewallRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FirewallRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String firewallRuleName) { + this.serviceClient().delete(resourceGroupName, accountName, firewallRuleName); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, String firewallRuleName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, firewallRuleName, context); + } + + public FirewallRule getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String firewallRuleName = Utils.getValueFromIdByName(id, "firewallRules"); + if (firewallRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'firewallRules'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, firewallRuleName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String firewallRuleName = Utils.getValueFromIdByName(id, "firewallRules"); + if (firewallRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'firewallRules'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, firewallRuleName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String firewallRuleName = Utils.getValueFromIdByName(id, "firewallRules"); + if (firewallRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'firewallRules'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, firewallRuleName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = Utils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String firewallRuleName = Utils.getValueFromIdByName(id, "firewallRules"); + if (firewallRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'firewallRules'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, firewallRuleName, context); + } + + private FirewallRulesClient serviceClient() { + return this.innerClient; + } + + private DataLakeAnalyticsManager manager() { + return this.serviceManager; + } + + public FirewallRuleImpl define(String name) { + return new FirewallRuleImpl(name, this.manager()); + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/LocationsClientImpl.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/LocationsClientImpl.java new file mode 100644 index 000000000000..4ce397dd18e1 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/LocationsClientImpl.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datalakeanalytics.fluent.LocationsClient; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.CapabilityInformationInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LocationsClient. */ +public final class LocationsClientImpl implements LocationsClient { + private final ClientLogger logger = new ClientLogger(LocationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LocationsService service; + + /** The service client containing this operation class. */ + private final DataLakeAnalyticsAccountManagementClientImpl client; + + /** + * Initializes an instance of LocationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LocationsClientImpl(DataLakeAnalyticsAccountManagementClientImpl client) { + this.service = + RestProxy.create(LocationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataLakeAnalyticsAccountManagementClientLocations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataLakeAnalyticsAcc") + private interface LocationsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DataLakeAnalytics/locations/{location}/capability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getCapability( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets subscription-level properties and limits for Data Lake Analytics specified by resource location. + * + * @param location The resource location without whitespace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription-level properties and limits for Data Lake Analytics specified by resource location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getCapabilityWithResponseAsync(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 + .getCapability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets subscription-level properties and limits for Data Lake Analytics specified by resource location. + * + * @param location The resource location without whitespace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription-level properties and limits for Data Lake Analytics specified by resource location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getCapabilityWithResponseAsync( + 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 + .getCapability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets subscription-level properties and limits for Data Lake Analytics specified by resource location. + * + * @param location The resource location without whitespace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription-level properties and limits for Data Lake Analytics specified by resource location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getCapabilityAsync(String location) { + return getCapabilityWithResponseAsync(location) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets subscription-level properties and limits for Data Lake Analytics specified by resource location. + * + * @param location The resource location without whitespace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription-level properties and limits for Data Lake Analytics specified by resource location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapabilityInformationInner getCapability(String location) { + return getCapabilityAsync(location).block(); + } + + /** + * Gets subscription-level properties and limits for Data Lake Analytics specified by resource location. + * + * @param location The resource location without whitespace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription-level properties and limits for Data Lake Analytics specified by resource location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getCapabilityWithResponse(String location, Context context) { + return getCapabilityWithResponseAsync(location, context).block(); + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/LocationsImpl.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/LocationsImpl.java new file mode 100644 index 000000000000..f80540e045e1 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/LocationsImpl.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datalakeanalytics.DataLakeAnalyticsManager; +import com.azure.resourcemanager.datalakeanalytics.fluent.LocationsClient; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.CapabilityInformationInner; +import com.azure.resourcemanager.datalakeanalytics.models.CapabilityInformation; +import com.azure.resourcemanager.datalakeanalytics.models.Locations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LocationsImpl implements Locations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LocationsImpl.class); + + private final LocationsClient innerClient; + + private final DataLakeAnalyticsManager serviceManager; + + public LocationsImpl(LocationsClient innerClient, DataLakeAnalyticsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CapabilityInformation getCapability(String location) { + CapabilityInformationInner inner = this.serviceClient().getCapability(location); + if (inner != null) { + return new CapabilityInformationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getCapabilityWithResponse(String location, Context context) { + Response inner = this.serviceClient().getCapabilityWithResponse(location, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CapabilityInformationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private LocationsClient serviceClient() { + return this.innerClient; + } + + private DataLakeAnalyticsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/NameAvailabilityInformationImpl.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/NameAvailabilityInformationImpl.java new file mode 100644 index 000000000000..9c9502c8b38f --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/NameAvailabilityInformationImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.implementation; + +import com.azure.resourcemanager.datalakeanalytics.DataLakeAnalyticsManager; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.NameAvailabilityInformationInner; +import com.azure.resourcemanager.datalakeanalytics.models.NameAvailabilityInformation; + +public final class NameAvailabilityInformationImpl implements NameAvailabilityInformation { + private NameAvailabilityInformationInner innerObject; + + private final DataLakeAnalyticsManager serviceManager; + + NameAvailabilityInformationImpl( + NameAvailabilityInformationInner innerObject, DataLakeAnalyticsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public String reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public NameAvailabilityInformationInner innerModel() { + return this.innerObject; + } + + private DataLakeAnalyticsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/OperationListResultImpl.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/OperationListResultImpl.java new file mode 100644 index 000000000000..99310e2d3dcb --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/OperationListResultImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.implementation; + +import com.azure.resourcemanager.datalakeanalytics.DataLakeAnalyticsManager; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.OperationListResultInner; +import com.azure.resourcemanager.datalakeanalytics.models.Operation; +import com.azure.resourcemanager.datalakeanalytics.models.OperationListResult; +import java.util.Collections; +import java.util.List; + +public final class OperationListResultImpl implements OperationListResult { + private OperationListResultInner innerObject; + + private final DataLakeAnalyticsManager serviceManager; + + OperationListResultImpl(OperationListResultInner innerObject, DataLakeAnalyticsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public OperationListResultInner innerModel() { + return this.innerObject; + } + + private DataLakeAnalyticsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/OperationsClientImpl.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..ac158c8322d1 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/OperationsClientImpl.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.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.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.datalakeanalytics.fluent.OperationsClient; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.OperationListResultInner; +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 DataLakeAnalyticsAccountManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(DataLakeAnalyticsAccountManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataLakeAnalyticsAccountManagementClientOperations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataLakeAnalyticsAcc") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.DataLakeAnalytics/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the available Data Lake Analytics REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available operations for Data Lake Analytics. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync() { + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all of the available Data Lake Analytics REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available operations for Data Lake Analytics. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(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); + } + + /** + * Lists all of the available Data Lake Analytics REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available operations for Data Lake Analytics. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync() { + return listWithResponseAsync() + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists all of the available Data Lake Analytics REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available operations for Data Lake Analytics. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationListResultInner list() { + return listAsync().block(); + } + + /** + * Lists all of the available Data Lake Analytics REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available operations for Data Lake Analytics. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(Context context) { + return listWithResponseAsync(context).block(); + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/OperationsImpl.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/OperationsImpl.java new file mode 100644 index 000000000000..b611f97db115 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/OperationsImpl.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datalakeanalytics.DataLakeAnalyticsManager; +import com.azure.resourcemanager.datalakeanalytics.fluent.OperationsClient; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.OperationListResultInner; +import com.azure.resourcemanager.datalakeanalytics.models.OperationListResult; +import com.azure.resourcemanager.datalakeanalytics.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final DataLakeAnalyticsManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, DataLakeAnalyticsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public OperationListResult list() { + OperationListResultInner inner = this.serviceClient().list(); + if (inner != null) { + return new OperationListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse(Context context) { + Response inner = this.serviceClient().listWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private DataLakeAnalyticsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/SasTokenInformationImpl.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/SasTokenInformationImpl.java new file mode 100644 index 000000000000..50f3645c4497 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/SasTokenInformationImpl.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.implementation; + +import com.azure.resourcemanager.datalakeanalytics.DataLakeAnalyticsManager; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.SasTokenInformationInner; +import com.azure.resourcemanager.datalakeanalytics.models.SasTokenInformation; + +public final class SasTokenInformationImpl implements SasTokenInformation { + private SasTokenInformationInner innerObject; + + private final DataLakeAnalyticsManager serviceManager; + + SasTokenInformationImpl(SasTokenInformationInner innerObject, DataLakeAnalyticsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String accessToken() { + return this.innerModel().accessToken(); + } + + public SasTokenInformationInner innerModel() { + return this.innerObject; + } + + private DataLakeAnalyticsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/StorageAccountInformationImpl.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/StorageAccountInformationImpl.java new file mode 100644 index 000000000000..7f0cc967718a --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/StorageAccountInformationImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.implementation; + +import com.azure.resourcemanager.datalakeanalytics.DataLakeAnalyticsManager; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.StorageAccountInformationInner; +import com.azure.resourcemanager.datalakeanalytics.models.StorageAccountInformation; + +public final class StorageAccountInformationImpl implements StorageAccountInformation { + private StorageAccountInformationInner innerObject; + + private final DataLakeAnalyticsManager serviceManager; + + StorageAccountInformationImpl(StorageAccountInformationInner innerObject, DataLakeAnalyticsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String suffix() { + return this.innerModel().suffix(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public StorageAccountInformationInner innerModel() { + return this.innerObject; + } + + private DataLakeAnalyticsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/StorageAccountsClientImpl.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/StorageAccountsClientImpl.java new file mode 100644 index 000000000000..93f9e856bf41 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/StorageAccountsClientImpl.java @@ -0,0 +1,2160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datalakeanalytics.fluent.StorageAccountsClient; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.SasTokenInformationInner; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.StorageAccountInformationInner; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.StorageContainerInner; +import com.azure.resourcemanager.datalakeanalytics.models.AddStorageAccountParameters; +import com.azure.resourcemanager.datalakeanalytics.models.SasTokenInformationListResult; +import com.azure.resourcemanager.datalakeanalytics.models.StorageAccountInformationListResult; +import com.azure.resourcemanager.datalakeanalytics.models.StorageContainerListResult; +import com.azure.resourcemanager.datalakeanalytics.models.UpdateStorageAccountParameters; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in StorageAccountsClient. */ +public final class StorageAccountsClientImpl implements StorageAccountsClient { + private final ClientLogger logger = new ClientLogger(StorageAccountsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final StorageAccountsService service; + + /** The service client containing this operation class. */ + private final DataLakeAnalyticsAccountManagementClientImpl client; + + /** + * Initializes an instance of StorageAccountsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + StorageAccountsClientImpl(DataLakeAnalyticsAccountManagementClientImpl client) { + this.service = + RestProxy.create(StorageAccountsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataLakeAnalyticsAccountManagementClientStorageAccounts to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataLakeAnalyticsAcc") + private interface StorageAccountsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts/{accountName}/storageAccounts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByAccount( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("$skip") Integer skip, + @QueryParam("$select") String select, + @QueryParam("$orderby") String orderby, + @QueryParam("$count") Boolean count, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts/{accountName}/storageAccounts/{storageAccountName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> add( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("storageAccountName") String storageAccountName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AddStorageAccountParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts/{accountName}/storageAccounts/{storageAccountName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("storageAccountName") String storageAccountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts/{accountName}/storageAccounts/{storageAccountName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("storageAccountName") String storageAccountName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateStorageAccountParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts/{accountName}/storageAccounts/{storageAccountName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("storageAccountName") String storageAccountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts/{accountName}/storageAccounts/{storageAccountName}/containers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listStorageContainers( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("storageAccountName") String storageAccountName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts/{accountName}/storageAccounts/{storageAccountName}/containers/{containerName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getStorageContainer( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("storageAccountName") String storageAccountName, + @PathParam("containerName") String containerName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics" + + "/accounts/{accountName}/storageAccounts/{storageAccountName}/containers/{containerName}" + + "/listSasTokens") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSasTokens( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, + @PathParam("storageAccountName") String storageAccountName, + @PathParam("containerName") String containerName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByAccountNext( + @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> listStorageContainersNext( + @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> listSasTokensNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The + * response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param filter The OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountSinglePageAsync( + String resourceGroupName, + String accountName, + String filter, + Integer top, + Integer skip, + String select, + String orderby, + Boolean count) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByAccount( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + filter, + top, + skip, + select, + orderby, + count, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The + * response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param filter The OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountSinglePageAsync( + String resourceGroupName, + String accountName, + String filter, + Integer top, + Integer skip, + String select, + String orderby, + Boolean count, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByAccount( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + filter, + top, + skip, + select, + orderby, + count, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The + * response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param filter The OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByAccountAsync( + String resourceGroupName, + String accountName, + String filter, + Integer top, + Integer skip, + String select, + String orderby, + Boolean count) { + return new PagedFlux<>( + () -> + listByAccountSinglePageAsync(resourceGroupName, accountName, filter, top, skip, select, orderby, count), + nextLink -> listByAccountNextSinglePageAsync(nextLink)); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The + * response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByAccountAsync(String resourceGroupName, String accountName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + return new PagedFlux<>( + () -> + listByAccountSinglePageAsync(resourceGroupName, accountName, filter, top, skip, select, orderby, count), + nextLink -> listByAccountNextSinglePageAsync(nextLink)); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The + * response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param filter The OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByAccountAsync( + String resourceGroupName, + String accountName, + String filter, + Integer top, + Integer skip, + String select, + String orderby, + Boolean count, + Context context) { + return new PagedFlux<>( + () -> + listByAccountSinglePageAsync( + resourceGroupName, accountName, filter, top, skip, select, orderby, count, context), + nextLink -> listByAccountNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The + * response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByAccount(String resourceGroupName, String accountName) { + final String filter = null; + final Integer top = null; + final Integer skip = null; + final String select = null; + final String orderby = null; + final Boolean count = null; + return new PagedIterable<>( + listByAccountAsync(resourceGroupName, accountName, filter, top, skip, select, orderby, count)); + } + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The + * response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param filter The OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByAccount( + String resourceGroupName, + String accountName, + String filter, + Integer top, + Integer skip, + String select, + String orderby, + Boolean count, + Context context) { + return new PagedIterable<>( + listByAccountAsync(resourceGroupName, accountName, filter, top, skip, select, orderby, count, context)); + } + + /** + * Updates the specified Data Lake Analytics account to add an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to add. + * @param parameters The parameters containing the access key and optional suffix for the Azure Storage Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> addWithResponseAsync( + String resourceGroupName, + String accountName, + String storageAccountName, + AddStorageAccountParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (storageAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .add( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + storageAccountName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the specified Data Lake Analytics account to add an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to add. + * @param parameters The parameters containing the access key and optional suffix for the Azure Storage Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> addWithResponseAsync( + String resourceGroupName, + String accountName, + String storageAccountName, + AddStorageAccountParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (storageAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .add( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + storageAccountName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Updates the specified Data Lake Analytics account to add an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to add. + * @param parameters The parameters containing the access key and optional suffix for the Azure Storage Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono addAsync( + String resourceGroupName, + String accountName, + String storageAccountName, + AddStorageAccountParameters parameters) { + return addWithResponseAsync(resourceGroupName, accountName, storageAccountName, parameters) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Updates the specified Data Lake Analytics account to add an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to add. + * @param parameters The parameters containing the access key and optional suffix for the Azure Storage Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void add( + String resourceGroupName, + String accountName, + String storageAccountName, + AddStorageAccountParameters parameters) { + addAsync(resourceGroupName, accountName, storageAccountName, parameters).block(); + } + + /** + * Updates the specified Data Lake Analytics account to add an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to add. + * @param parameters The parameters containing the access key and optional suffix for the Azure Storage Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response addWithResponse( + String resourceGroupName, + String accountName, + String storageAccountName, + AddStorageAccountParameters parameters, + Context context) { + return addWithResponseAsync(resourceGroupName, accountName, storageAccountName, parameters, context).block(); + } + + /** + * Gets the specified Azure Storage account linked to the given Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account for which to retrieve the details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Storage account linked to the given Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String storageAccountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (storageAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + storageAccountName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the specified Azure Storage account linked to the given Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account for which to retrieve the details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Storage account linked to the given Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String accountName, String storageAccountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (storageAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + storageAccountName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the specified Azure Storage account linked to the given Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account for which to retrieve the details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Storage account linked to the given Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String accountName, String storageAccountName) { + return getWithResponseAsync(resourceGroupName, accountName, storageAccountName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Azure Storage account linked to the given Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account for which to retrieve the details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Storage account linked to the given Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageAccountInformationInner get(String resourceGroupName, String accountName, String storageAccountName) { + return getAsync(resourceGroupName, accountName, storageAccountName).block(); + } + + /** + * Gets the specified Azure Storage account linked to the given Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account for which to retrieve the details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Storage account linked to the given Data Lake Analytics account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String accountName, String storageAccountName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, storageAccountName, context).block(); + } + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key + * and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The Azure Storage account to modify. + * @param parameters The parameters containing the access key and suffix to update the storage account with, if any. + * Passing nothing results in no change. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> updateWithResponseAsync( + String resourceGroupName, + String accountName, + String storageAccountName, + UpdateStorageAccountParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (storageAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + storageAccountName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key + * and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The Azure Storage account to modify. + * @param parameters The parameters containing the access key and suffix to update the storage account with, if any. + * Passing nothing results in no change. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> updateWithResponseAsync( + String resourceGroupName, + String accountName, + String storageAccountName, + UpdateStorageAccountParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (storageAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + storageAccountName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key + * and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The Azure Storage account to modify. + * @param parameters The parameters containing the access key and suffix to update the storage account with, if any. + * Passing nothing results in no change. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 updateAsync( + String resourceGroupName, + String accountName, + String storageAccountName, + UpdateStorageAccountParameters parameters) { + return updateWithResponseAsync(resourceGroupName, accountName, storageAccountName, parameters) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key + * and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The Azure Storage account to modify. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 updateAsync(String resourceGroupName, String accountName, String storageAccountName) { + final UpdateStorageAccountParameters parameters = null; + return updateWithResponseAsync(resourceGroupName, accountName, storageAccountName, parameters) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key + * and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The Azure Storage account to modify. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 update(String resourceGroupName, String accountName, String storageAccountName) { + final UpdateStorageAccountParameters parameters = null; + updateAsync(resourceGroupName, accountName, storageAccountName, parameters).block(); + } + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key + * and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The Azure Storage account to modify. + * @param parameters The parameters containing the access key and suffix to update the storage account with, if any. + * Passing nothing results in no change. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String accountName, + String storageAccountName, + UpdateStorageAccountParameters parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, storageAccountName, parameters, context).block(); + } + + /** + * Updates the specified Data Lake Analytics account to remove an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String storageAccountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (storageAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + storageAccountName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the specified Data Lake Analytics account to remove an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, String storageAccountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (storageAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + storageAccountName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Updates the specified Data Lake Analytics account to remove an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String storageAccountName) { + return deleteWithResponseAsync(resourceGroupName, accountName, storageAccountName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Updates the specified Data Lake Analytics account to remove an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String storageAccountName) { + deleteAsync(resourceGroupName, accountName, storageAccountName).block(); + } + + /** + * Updates the specified Data Lake Analytics account to remove an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String accountName, String storageAccountName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, storageAccountName, context).block(); + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage + * account combination. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to list blob containers. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of blob containers associated with the storage account attached to the Data Lake Analytics + * account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listStorageContainersSinglePageAsync( + String resourceGroupName, String accountName, String storageAccountName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (storageAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listStorageContainers( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + storageAccountName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage + * account combination. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to list blob containers. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of blob containers associated with the storage account attached to the Data Lake Analytics + * account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listStorageContainersSinglePageAsync( + String resourceGroupName, String accountName, String storageAccountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (storageAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listStorageContainers( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + storageAccountName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage + * account combination. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to list blob containers. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of blob containers associated with the storage account attached to the Data Lake Analytics + * account. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listStorageContainersAsync( + String resourceGroupName, String accountName, String storageAccountName) { + return new PagedFlux<>( + () -> listStorageContainersSinglePageAsync(resourceGroupName, accountName, storageAccountName), + nextLink -> listStorageContainersNextSinglePageAsync(nextLink)); + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage + * account combination. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to list blob containers. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of blob containers associated with the storage account attached to the Data Lake Analytics + * account. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listStorageContainersAsync( + String resourceGroupName, String accountName, String storageAccountName, Context context) { + return new PagedFlux<>( + () -> listStorageContainersSinglePageAsync(resourceGroupName, accountName, storageAccountName, context), + nextLink -> listStorageContainersNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage + * account combination. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to list blob containers. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of blob containers associated with the storage account attached to the Data Lake Analytics + * account. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listStorageContainers( + String resourceGroupName, String accountName, String storageAccountName) { + return new PagedIterable<>(listStorageContainersAsync(resourceGroupName, accountName, storageAccountName)); + } + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage + * account combination. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to list blob containers. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of blob containers associated with the storage account attached to the Data Lake Analytics + * account. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listStorageContainers( + String resourceGroupName, String accountName, String storageAccountName, Context context) { + return new PagedIterable<>( + listStorageContainersAsync(resourceGroupName, accountName, storageAccountName, context)); + } + + /** + * Gets the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage + * accounts. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to retrieve the blob container. + * @param containerName The name of the Azure storage container to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage + * accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getStorageContainerWithResponseAsync( + String resourceGroupName, String accountName, String storageAccountName, String containerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (storageAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getStorageContainer( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + storageAccountName, + containerName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage + * accounts. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to retrieve the blob container. + * @param containerName The name of the Azure storage container to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage + * accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getStorageContainerWithResponseAsync( + String resourceGroupName, + String accountName, + String storageAccountName, + String containerName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (storageAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getStorageContainer( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + storageAccountName, + containerName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage + * accounts. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to retrieve the blob container. + * @param containerName The name of the Azure storage container to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage + * accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getStorageContainerAsync( + String resourceGroupName, String accountName, String storageAccountName, String containerName) { + return getStorageContainerWithResponseAsync(resourceGroupName, accountName, storageAccountName, containerName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage + * accounts. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to retrieve the blob container. + * @param containerName The name of the Azure storage container to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage + * accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageContainerInner getStorageContainer( + String resourceGroupName, String accountName, String storageAccountName, String containerName) { + return getStorageContainerAsync(resourceGroupName, accountName, storageAccountName, containerName).block(); + } + + /** + * Gets the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage + * accounts. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to retrieve the blob container. + * @param containerName The name of the Azure storage container to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage + * accounts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getStorageContainerWithResponse( + String resourceGroupName, + String accountName, + String storageAccountName, + String containerName, + Context context) { + return getStorageContainerWithResponseAsync( + resourceGroupName, accountName, storageAccountName, containerName, context) + .block(); + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container + * combination. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account for which the SAS token is being requested. + * @param containerName The name of the Azure storage container for which the SAS token is being requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container + * combination. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSasTokensSinglePageAsync( + String resourceGroupName, String accountName, String storageAccountName, String containerName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (storageAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSasTokens( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + storageAccountName, + containerName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container + * combination. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account for which the SAS token is being requested. + * @param containerName The name of the Azure storage container for which the SAS token is being requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container + * combination. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSasTokensSinglePageAsync( + String resourceGroupName, + String accountName, + String storageAccountName, + String containerName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (storageAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null.")); + } + if (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listSasTokens( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + accountName, + storageAccountName, + containerName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container + * combination. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account for which the SAS token is being requested. + * @param containerName The name of the Azure storage container for which the SAS token is being requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container + * combination. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listSasTokensAsync( + String resourceGroupName, String accountName, String storageAccountName, String containerName) { + return new PagedFlux<>( + () -> listSasTokensSinglePageAsync(resourceGroupName, accountName, storageAccountName, containerName), + nextLink -> listSasTokensNextSinglePageAsync(nextLink)); + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container + * combination. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account for which the SAS token is being requested. + * @param containerName The name of the Azure storage container for which the SAS token is being requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container + * combination. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listSasTokensAsync( + String resourceGroupName, + String accountName, + String storageAccountName, + String containerName, + Context context) { + return new PagedFlux<>( + () -> + listSasTokensSinglePageAsync( + resourceGroupName, accountName, storageAccountName, containerName, context), + nextLink -> listSasTokensNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container + * combination. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account for which the SAS token is being requested. + * @param containerName The name of the Azure storage container for which the SAS token is being requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container + * combination. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSasTokens( + String resourceGroupName, String accountName, String storageAccountName, String containerName) { + return new PagedIterable<>( + listSasTokensAsync(resourceGroupName, accountName, storageAccountName, containerName)); + } + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container + * combination. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account for which the SAS token is being requested. + * @param containerName The name of the Azure storage container for which the SAS token is being requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container + * combination. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSasTokens( + String resourceGroupName, + String accountName, + String storageAccountName, + String containerName, + Context context) { + return new PagedIterable<>( + listSasTokensAsync(resourceGroupName, accountName, storageAccountName, containerName, 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 azure Storage account list information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountNextSinglePageAsync(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.listByAccountNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 azure Storage account list information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountNextSinglePageAsync( + 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 + .listByAccountNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of blob containers associated with the storage account attached to the Data Lake Analytics + * account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listStorageContainersNextSinglePageAsync(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.listStorageContainersNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of blob containers associated with the storage account attached to the Data Lake Analytics + * account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listStorageContainersNextSinglePageAsync( + 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 + .listStorageContainersNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS response that contains the storage account, container and associated SAS token for connection + * use. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSasTokensNextSinglePageAsync(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.listSasTokensNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS response that contains the storage account, container and associated SAS token for connection + * use. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSasTokensNextSinglePageAsync( + 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 + .listSasTokensNext(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/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/StorageAccountsImpl.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/StorageAccountsImpl.java new file mode 100644 index 000000000000..6b5c5a182bdb --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/StorageAccountsImpl.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.datalakeanalytics.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.datalakeanalytics.DataLakeAnalyticsManager; +import com.azure.resourcemanager.datalakeanalytics.fluent.StorageAccountsClient; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.SasTokenInformationInner; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.StorageAccountInformationInner; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.StorageContainerInner; +import com.azure.resourcemanager.datalakeanalytics.models.AddStorageAccountParameters; +import com.azure.resourcemanager.datalakeanalytics.models.SasTokenInformation; +import com.azure.resourcemanager.datalakeanalytics.models.StorageAccountInformation; +import com.azure.resourcemanager.datalakeanalytics.models.StorageAccounts; +import com.azure.resourcemanager.datalakeanalytics.models.StorageContainer; +import com.azure.resourcemanager.datalakeanalytics.models.UpdateStorageAccountParameters; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class StorageAccountsImpl implements StorageAccounts { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountsImpl.class); + + private final StorageAccountsClient innerClient; + + private final DataLakeAnalyticsManager serviceManager; + + public StorageAccountsImpl(StorageAccountsClient innerClient, DataLakeAnalyticsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByAccount(String resourceGroupName, String accountName) { + PagedIterable inner = + this.serviceClient().listByAccount(resourceGroupName, accountName); + return Utils.mapPage(inner, inner1 -> new StorageAccountInformationImpl(inner1, this.manager())); + } + + public PagedIterable listByAccount( + String resourceGroupName, + String accountName, + String filter, + Integer top, + Integer skip, + String select, + String orderby, + Boolean count, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByAccount(resourceGroupName, accountName, filter, top, skip, select, orderby, count, context); + return Utils.mapPage(inner, inner1 -> new StorageAccountInformationImpl(inner1, this.manager())); + } + + public void add( + String resourceGroupName, + String accountName, + String storageAccountName, + AddStorageAccountParameters parameters) { + this.serviceClient().add(resourceGroupName, accountName, storageAccountName, parameters); + } + + public Response addWithResponse( + String resourceGroupName, + String accountName, + String storageAccountName, + AddStorageAccountParameters parameters, + Context context) { + return this + .serviceClient() + .addWithResponse(resourceGroupName, accountName, storageAccountName, parameters, context); + } + + public StorageAccountInformation get(String resourceGroupName, String accountName, String storageAccountName) { + StorageAccountInformationInner inner = + this.serviceClient().get(resourceGroupName, accountName, storageAccountName); + if (inner != null) { + return new StorageAccountInformationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String accountName, String storageAccountName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, accountName, storageAccountName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new StorageAccountInformationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void update(String resourceGroupName, String accountName, String storageAccountName) { + this.serviceClient().update(resourceGroupName, accountName, storageAccountName); + } + + public Response updateWithResponse( + String resourceGroupName, + String accountName, + String storageAccountName, + UpdateStorageAccountParameters parameters, + Context context) { + return this + .serviceClient() + .updateWithResponse(resourceGroupName, accountName, storageAccountName, parameters, context); + } + + public void delete(String resourceGroupName, String accountName, String storageAccountName) { + this.serviceClient().delete(resourceGroupName, accountName, storageAccountName); + } + + public Response deleteWithResponse( + String resourceGroupName, String accountName, String storageAccountName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, storageAccountName, context); + } + + public PagedIterable listStorageContainers( + String resourceGroupName, String accountName, String storageAccountName) { + PagedIterable inner = + this.serviceClient().listStorageContainers(resourceGroupName, accountName, storageAccountName); + return Utils.mapPage(inner, inner1 -> new StorageContainerImpl(inner1, this.manager())); + } + + public PagedIterable listStorageContainers( + String resourceGroupName, String accountName, String storageAccountName, Context context) { + PagedIterable inner = + this.serviceClient().listStorageContainers(resourceGroupName, accountName, storageAccountName, context); + return Utils.mapPage(inner, inner1 -> new StorageContainerImpl(inner1, this.manager())); + } + + public StorageContainer getStorageContainer( + String resourceGroupName, String accountName, String storageAccountName, String containerName) { + StorageContainerInner inner = + this.serviceClient().getStorageContainer(resourceGroupName, accountName, storageAccountName, containerName); + if (inner != null) { + return new StorageContainerImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getStorageContainerWithResponse( + String resourceGroupName, + String accountName, + String storageAccountName, + String containerName, + Context context) { + Response inner = + this + .serviceClient() + .getStorageContainerWithResponse( + resourceGroupName, accountName, storageAccountName, containerName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new StorageContainerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listSasTokens( + String resourceGroupName, String accountName, String storageAccountName, String containerName) { + PagedIterable inner = + this.serviceClient().listSasTokens(resourceGroupName, accountName, storageAccountName, containerName); + return Utils.mapPage(inner, inner1 -> new SasTokenInformationImpl(inner1, this.manager())); + } + + public PagedIterable listSasTokens( + String resourceGroupName, + String accountName, + String storageAccountName, + String containerName, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listSasTokens(resourceGroupName, accountName, storageAccountName, containerName, context); + return Utils.mapPage(inner, inner1 -> new SasTokenInformationImpl(inner1, this.manager())); + } + + private StorageAccountsClient serviceClient() { + return this.innerClient; + } + + private DataLakeAnalyticsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/StorageContainerImpl.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/StorageContainerImpl.java new file mode 100644 index 000000000000..a488fbff4115 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/StorageContainerImpl.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.datalakeanalytics.implementation; + +import com.azure.resourcemanager.datalakeanalytics.DataLakeAnalyticsManager; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.StorageContainerInner; +import com.azure.resourcemanager.datalakeanalytics.models.StorageContainer; +import java.time.OffsetDateTime; + +public final class StorageContainerImpl implements StorageContainer { + private StorageContainerInner innerObject; + + private final DataLakeAnalyticsManager serviceManager; + + StorageContainerImpl(StorageContainerInner innerObject, DataLakeAnalyticsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public OffsetDateTime lastModifiedTime() { + return this.innerModel().lastModifiedTime(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public StorageContainerInner innerModel() { + return this.innerObject; + } + + private DataLakeAnalyticsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/Utils.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/Utils.java new file mode 100644 index 000000000000..c65a3335a8f3 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/Utils.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.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.Mono; + +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 pageIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pageIterable, Function mapper) { + super(new PagedFlux(Mono::empty)); + this.pageIterable = pageIterable; + this.mapper = mapper; + this.pageMapper = + 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 pageIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pageIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pageIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pageIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pageIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pageIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pageIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pageIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pageIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pageIterable.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/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/package-info.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/package-info.java new file mode 100644 index 000000000000..bef16b5aad1b --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for DataLakeAnalyticsAccountManagementClient. Creates an Azure Data Lake + * Analytics account management client. + */ +package com.azure.resourcemanager.datalakeanalytics.implementation; diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/AadObjectType.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/AadObjectType.java new file mode 100644 index 000000000000..9da8b52e6315 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/AadObjectType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AadObjectType. */ +public final class AadObjectType extends ExpandableStringEnum { + /** Static value User for AadObjectType. */ + public static final AadObjectType USER = fromString("User"); + + /** Static value Group for AadObjectType. */ + public static final AadObjectType GROUP = fromString("Group"); + + /** Static value ServicePrincipal for AadObjectType. */ + public static final AadObjectType SERVICE_PRINCIPAL = fromString("ServicePrincipal"); + + /** + * Creates or finds a AadObjectType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AadObjectType. + */ + @JsonCreator + public static AadObjectType fromString(String name) { + return fromString(name, AadObjectType.class); + } + + /** @return known AadObjectType values. */ + public static Collection values() { + return values(AadObjectType.class); + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/Accounts.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/Accounts.java new file mode 100644 index 000000000000..bb75f013b2cf --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/Accounts.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.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 Accounts. */ +public interface Accounts { + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a + * link to the next page, if any. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Analytics accounts, if any, within the current subscription. + */ + PagedIterable list(); + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a + * link to the next page, if any. + * + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Analytics accounts, if any, within the current subscription. + */ + PagedIterable list( + String filter, Integer top, Integer skip, String select, String orderby, Boolean count, Context context); + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a + * link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Analytics accounts, if any, within a specific resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. This includes a + * link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Analytics accounts, if any, within a specific resource group. + */ + PagedIterable listByResourceGroup( + String resourceGroupName, + String filter, + Integer top, + Integer skip, + String select, + String orderby, + Boolean count, + Context context); + + /** + * Gets details of the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified Data Lake Analytics account. + */ + DataLakeAnalyticsAccount getByResourceGroup(String resourceGroupName, String accountName); + + /** + * Gets details of the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified Data Lake Analytics account. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String accountName, Context context); + + /** + * Begins the delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String accountName); + + /** + * Begins the delete process for the Data Lake Analytics account object specified by the account name. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, Context context); + + /** + * Checks whether the specified account name is available or taken. + * + * @param location The resource location without whitespace. + * @param parameters Parameters supplied to check the Data Lake Analytics account name availability. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics account name availability result information. + */ + NameAvailabilityInformation checkNameAvailability(String location, CheckNameAvailabilityParameters parameters); + + /** + * Checks whether the specified account name is available or taken. + * + * @param location The resource location without whitespace. + * @param parameters Parameters supplied to check the Data Lake Analytics account name availability. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics account name availability result information. + */ + Response checkNameAvailabilityWithResponse( + String location, CheckNameAvailabilityParameters parameters, Context context); + + /** + * Gets details of the specified Data Lake Analytics account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified Data Lake Analytics account. + */ + DataLakeAnalyticsAccount getById(String id); + + /** + * Gets details of the specified Data Lake Analytics account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details of the specified Data Lake Analytics account. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins the delete process for the Data Lake Analytics account object specified by the account name. + * + * @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); + + /** + * Begins the delete process for the Data Lake Analytics account object specified by the account name. + * + * @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 DataLakeAnalyticsAccount resource. + * + * @param name resource name. + * @return the first stage of the new DataLakeAnalyticsAccount definition. + */ + DataLakeAnalyticsAccount.DefinitionStages.Blank define(String name); +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/AddDataLakeStoreParameters.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/AddDataLakeStoreParameters.java new file mode 100644 index 000000000000..d63855cb59cf --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/AddDataLakeStoreParameters.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.datalakeanalytics.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; + +/** The parameters used to add a new Data Lake Store account. */ +@JsonFlatten +@Fluent +public class AddDataLakeStoreParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AddDataLakeStoreParameters.class); + + /* + * The optional suffix for the Data Lake Store account. + */ + @JsonProperty(value = "properties.suffix") + private String suffix; + + /** + * Get the suffix property: The optional suffix for the Data Lake Store account. + * + * @return the suffix value. + */ + public String suffix() { + return this.suffix; + } + + /** + * Set the suffix property: The optional suffix for the Data Lake Store account. + * + * @param suffix the suffix value to set. + * @return the AddDataLakeStoreParameters object itself. + */ + public AddDataLakeStoreParameters withSuffix(String suffix) { + this.suffix = suffix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/AddDataLakeStoreWithAccountParameters.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/AddDataLakeStoreWithAccountParameters.java new file mode 100644 index 000000000000..e71436d1bcb3 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/AddDataLakeStoreWithAccountParameters.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.datalakeanalytics.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; + +/** The parameters used to add a new Data Lake Store account while creating a new Data Lake Analytics account. */ +@JsonFlatten +@Fluent +public class AddDataLakeStoreWithAccountParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AddDataLakeStoreWithAccountParameters.class); + + /* + * The unique name of the Data Lake Store account to add. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The optional suffix for the Data Lake Store account. + */ + @JsonProperty(value = "properties.suffix") + private String suffix; + + /** + * Get the name property: The unique name of the Data Lake Store account to add. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The unique name of the Data Lake Store account to add. + * + * @param name the name value to set. + * @return the AddDataLakeStoreWithAccountParameters object itself. + */ + public AddDataLakeStoreWithAccountParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the suffix property: The optional suffix for the Data Lake Store account. + * + * @return the suffix value. + */ + public String suffix() { + return this.suffix; + } + + /** + * Set the suffix property: The optional suffix for the Data Lake Store account. + * + * @param suffix the suffix value to set. + * @return the AddDataLakeStoreWithAccountParameters object itself. + */ + public AddDataLakeStoreWithAccountParameters withSuffix(String suffix) { + this.suffix = suffix; + 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 AddDataLakeStoreWithAccountParameters")); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/AddStorageAccountParameters.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/AddStorageAccountParameters.java new file mode 100644 index 000000000000..f8bcf890ed48 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/AddStorageAccountParameters.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.datalakeanalytics.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; + +/** The parameters used to add a new Azure Storage account. */ +@JsonFlatten +@Fluent +public class AddStorageAccountParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AddStorageAccountParameters.class); + + /* + * The access key associated with this Azure Storage account that will be + * used to connect to it. + */ + @JsonProperty(value = "properties.accessKey", required = true) + private String accessKey; + + /* + * The optional suffix for the storage account. + */ + @JsonProperty(value = "properties.suffix") + private String suffix; + + /** + * Get the accessKey property: The access key associated with this Azure Storage account that will be used to + * connect to it. + * + * @return the accessKey value. + */ + public String accessKey() { + return this.accessKey; + } + + /** + * Set the accessKey property: The access key associated with this Azure Storage account that will be used to + * connect to it. + * + * @param accessKey the accessKey value to set. + * @return the AddStorageAccountParameters object itself. + */ + public AddStorageAccountParameters withAccessKey(String accessKey) { + this.accessKey = accessKey; + return this; + } + + /** + * Get the suffix property: The optional suffix for the storage account. + * + * @return the suffix value. + */ + public String suffix() { + return this.suffix; + } + + /** + * Set the suffix property: The optional suffix for the storage account. + * + * @param suffix the suffix value to set. + * @return the AddStorageAccountParameters object itself. + */ + public AddStorageAccountParameters withSuffix(String suffix) { + this.suffix = suffix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (accessKey() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property accessKey in model AddStorageAccountParameters")); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/AddStorageAccountWithAccountParameters.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/AddStorageAccountWithAccountParameters.java new file mode 100644 index 000000000000..891c61813290 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/AddStorageAccountWithAccountParameters.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.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; + +/** The parameters used to add a new Azure Storage account while creating a new Data Lake Analytics account. */ +@JsonFlatten +@Fluent +public class AddStorageAccountWithAccountParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AddStorageAccountWithAccountParameters.class); + + /* + * The unique name of the Azure Storage account to add. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The access key associated with this Azure Storage account that will be + * used to connect to it. + */ + @JsonProperty(value = "properties.accessKey", required = true) + private String accessKey; + + /* + * The optional suffix for the storage account. + */ + @JsonProperty(value = "properties.suffix") + private String suffix; + + /** + * Get the name property: The unique name of the Azure Storage account to add. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The unique name of the Azure Storage account to add. + * + * @param name the name value to set. + * @return the AddStorageAccountWithAccountParameters object itself. + */ + public AddStorageAccountWithAccountParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the accessKey property: The access key associated with this Azure Storage account that will be used to + * connect to it. + * + * @return the accessKey value. + */ + public String accessKey() { + return this.accessKey; + } + + /** + * Set the accessKey property: The access key associated with this Azure Storage account that will be used to + * connect to it. + * + * @param accessKey the accessKey value to set. + * @return the AddStorageAccountWithAccountParameters object itself. + */ + public AddStorageAccountWithAccountParameters withAccessKey(String accessKey) { + this.accessKey = accessKey; + return this; + } + + /** + * Get the suffix property: The optional suffix for the storage account. + * + * @return the suffix value. + */ + public String suffix() { + return this.suffix; + } + + /** + * Set the suffix property: The optional suffix for the storage account. + * + * @param suffix the suffix value to set. + * @return the AddStorageAccountWithAccountParameters object itself. + */ + public AddStorageAccountWithAccountParameters withSuffix(String suffix) { + this.suffix = suffix; + 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 AddStorageAccountWithAccountParameters")); + } + if (accessKey() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property accessKey in model AddStorageAccountWithAccountParameters")); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/CapabilityInformation.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/CapabilityInformation.java new file mode 100644 index 000000000000..5dcb5eb36865 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/CapabilityInformation.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.datalakeanalytics.models; + +import com.azure.resourcemanager.datalakeanalytics.fluent.models.CapabilityInformationInner; +import java.util.UUID; + +/** An immutable client-side representation of CapabilityInformation. */ +public interface CapabilityInformation { + /** + * Gets the subscriptionId property: The subscription credentials that uniquely identifies the subscription. + * + * @return the subscriptionId value. + */ + UUID subscriptionId(); + + /** + * Gets the state property: The subscription state. + * + * @return the state value. + */ + SubscriptionState state(); + + /** + * Gets the maxAccountCount property: The maximum supported number of accounts under this subscription. + * + * @return the maxAccountCount value. + */ + Integer maxAccountCount(); + + /** + * Gets the accountCount property: The current number of accounts under this subscription. + * + * @return the accountCount value. + */ + Integer accountCount(); + + /** + * Gets the migrationState property: The Boolean value of true or false to indicate the maintenance state. + * + * @return the migrationState value. + */ + Boolean migrationState(); + + /** + * Gets the inner com.azure.resourcemanager.datalakeanalytics.fluent.models.CapabilityInformationInner object. + * + * @return the inner object. + */ + CapabilityInformationInner innerModel(); +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/CheckNameAvailabilityParameters.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/CheckNameAvailabilityParameters.java new file mode 100644 index 000000000000..ba42559696f8 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/CheckNameAvailabilityParameters.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.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; + +/** Data Lake Analytics account name availability check parameters. */ +@Fluent +public final class CheckNameAvailabilityParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityParameters.class); + + /* + * The Data Lake Analytics name to check availability for. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The resource type. Note: This should not be set by the user, as the + * constant value is Microsoft.DataLakeAnalytics/accounts + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** Creates an instance of CheckNameAvailabilityParameters class. */ + public CheckNameAvailabilityParameters() { + type = "Microsoft.DataLakeAnalytics/accounts"; + } + + /** + * Get the name property: The Data Lake Analytics name to check availability for. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The Data Lake Analytics name to check availability for. + * + * @param name the name value to set. + * @return the CheckNameAvailabilityParameters object itself. + */ + public CheckNameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The resource type. Note: This should not be set by the user, as the constant value is + * Microsoft.DataLakeAnalytics/accounts. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The resource type. Note: This should not be set by the user, as the constant value is + * Microsoft.DataLakeAnalytics/accounts. + * + * @param type the type value to set. + * @return the CheckNameAvailabilityParameters object itself. + */ + public CheckNameAvailabilityParameters withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model CheckNameAvailabilityParameters")); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/ComputePolicies.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/ComputePolicies.java new file mode 100644 index 000000000000..2b6b74143570 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/ComputePolicies.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.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 ComputePolicies. */ +public interface ComputePolicies { + /** + * Lists the Data Lake Analytics compute policies within the specified Data Lake Analytics account. An account + * supports, at most, 50 policies. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of compute policies in the account. + */ + PagedIterable listByAccount(String resourceGroupName, String accountName); + + /** + * Lists the Data Lake Analytics compute policies within the specified Data Lake Analytics account. An account + * supports, at most, 50 policies. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of compute policies in the account. + */ + PagedIterable listByAccount(String resourceGroupName, String accountName, Context context); + + /** + * Gets the specified Data Lake Analytics compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Analytics compute policy. + */ + ComputePolicy get(String resourceGroupName, String accountName, String computePolicyName); + + /** + * Gets the specified Data Lake Analytics compute policy. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Analytics compute policy. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String computePolicyName, Context context); + + /** + * Deletes the specified compute policy from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String computePolicyName); + + /** + * Deletes the specified compute policy from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param computePolicyName The name of the compute policy to delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String accountName, String computePolicyName, Context context); + + /** + * Gets the specified Data Lake Analytics compute policy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Analytics compute policy. + */ + ComputePolicy getById(String id); + + /** + * Gets the specified Data Lake Analytics compute policy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Analytics compute policy. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified compute policy from the specified Data Lake Analytics account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified compute policy from the specified Data Lake Analytics account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ComputePolicy resource. + * + * @param name resource name. + * @return the first stage of the new ComputePolicy definition. + */ + ComputePolicy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/ComputePolicy.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/ComputePolicy.java new file mode 100644 index 000000000000..75bae6676f10 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/ComputePolicy.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.ComputePolicyInner; +import java.util.UUID; + +/** An immutable client-side representation of ComputePolicy. */ +public interface ComputePolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the objectId property: The AAD object identifier for the entity to create a policy for. + * + * @return the objectId value. + */ + UUID objectId(); + + /** + * Gets the objectType property: The type of AAD object the object identifier refers to. + * + * @return the objectType value. + */ + AadObjectType objectType(); + + /** + * Gets the maxDegreeOfParallelismPerJob property: The maximum degree of parallelism per job this user can use to + * submit jobs. + * + * @return the maxDegreeOfParallelismPerJob value. + */ + Integer maxDegreeOfParallelismPerJob(); + + /** + * Gets the minPriorityPerJob property: The minimum priority per job this user can use to submit jobs. + * + * @return the minPriorityPerJob value. + */ + Integer minPriorityPerJob(); + + /** + * Gets the name property: The resource name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the inner com.azure.resourcemanager.datalakeanalytics.fluent.models.ComputePolicyInner object. + * + * @return the inner object. + */ + ComputePolicyInner innerModel(); + + /** The entirety of the ComputePolicy definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithObjectId, + DefinitionStages.WithObjectType, + DefinitionStages.WithCreate { + } + /** The ComputePolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the ComputePolicy definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ComputePolicy definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @return the next definition stage. + */ + WithObjectId withExistingAccount(String resourceGroupName, String accountName); + } + /** The stage of the ComputePolicy definition allowing to specify objectId. */ + interface WithObjectId { + /** + * Specifies the objectId property: The AAD object identifier for the entity to create a policy for.. + * + * @param objectId The AAD object identifier for the entity to create a policy for. + * @return the next definition stage. + */ + WithObjectType withObjectId(UUID objectId); + } + /** The stage of the ComputePolicy definition allowing to specify objectType. */ + interface WithObjectType { + /** + * Specifies the objectType property: The type of AAD object the object identifier refers to.. + * + * @param objectType The type of AAD object the object identifier refers to. + * @return the next definition stage. + */ + WithCreate withObjectType(AadObjectType objectType); + } + /** + * The stage of the ComputePolicy 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.WithMaxDegreeOfParallelismPerJob, DefinitionStages.WithMinPriorityPerJob { + /** + * Executes the create request. + * + * @return the created resource. + */ + ComputePolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ComputePolicy create(Context context); + } + /** The stage of the ComputePolicy definition allowing to specify maxDegreeOfParallelismPerJob. */ + interface WithMaxDegreeOfParallelismPerJob { + /** + * Specifies the maxDegreeOfParallelismPerJob property: The maximum degree of parallelism per job this user + * can use to submit jobs. This property, the min priority per job property, or both must be passed.. + * + * @param maxDegreeOfParallelismPerJob The maximum degree of parallelism per job this user can use to submit + * jobs. This property, the min priority per job property, or both must be passed. + * @return the next definition stage. + */ + WithCreate withMaxDegreeOfParallelismPerJob(Integer maxDegreeOfParallelismPerJob); + } + /** The stage of the ComputePolicy definition allowing to specify minPriorityPerJob. */ + interface WithMinPriorityPerJob { + /** + * Specifies the minPriorityPerJob property: The minimum priority per job this user can use to submit jobs. + * This property, the max degree of parallelism per job property, or both must be passed.. + * + * @param minPriorityPerJob The minimum priority per job this user can use to submit jobs. This property, + * the max degree of parallelism per job property, or both must be passed. + * @return the next definition stage. + */ + WithCreate withMinPriorityPerJob(Integer minPriorityPerJob); + } + } + /** + * Begins update for the ComputePolicy resource. + * + * @return the stage of resource update. + */ + ComputePolicy.Update update(); + + /** The template for ComputePolicy update. */ + interface Update + extends UpdateStages.WithObjectId, + UpdateStages.WithObjectType, + UpdateStages.WithMaxDegreeOfParallelismPerJob, + UpdateStages.WithMinPriorityPerJob { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ComputePolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ComputePolicy apply(Context context); + } + /** The ComputePolicy update stages. */ + interface UpdateStages { + /** The stage of the ComputePolicy update allowing to specify objectId. */ + interface WithObjectId { + /** + * Specifies the objectId property: The AAD object identifier for the entity to create a policy for.. + * + * @param objectId The AAD object identifier for the entity to create a policy for. + * @return the next definition stage. + */ + Update withObjectId(UUID objectId); + } + /** The stage of the ComputePolicy update allowing to specify objectType. */ + interface WithObjectType { + /** + * Specifies the objectType property: The type of AAD object the object identifier refers to.. + * + * @param objectType The type of AAD object the object identifier refers to. + * @return the next definition stage. + */ + Update withObjectType(AadObjectType objectType); + } + /** The stage of the ComputePolicy update allowing to specify maxDegreeOfParallelismPerJob. */ + interface WithMaxDegreeOfParallelismPerJob { + /** + * Specifies the maxDegreeOfParallelismPerJob property: The maximum degree of parallelism per job this user + * can use to submit jobs. This property, the min priority per job property, or both must be passed.. + * + * @param maxDegreeOfParallelismPerJob The maximum degree of parallelism per job this user can use to submit + * jobs. This property, the min priority per job property, or both must be passed. + * @return the next definition stage. + */ + Update withMaxDegreeOfParallelismPerJob(Integer maxDegreeOfParallelismPerJob); + } + /** The stage of the ComputePolicy update allowing to specify minPriorityPerJob. */ + interface WithMinPriorityPerJob { + /** + * Specifies the minPriorityPerJob property: The minimum priority per job this user can use to submit jobs. + * This property, the max degree of parallelism per job property, or both must be passed.. + * + * @param minPriorityPerJob The minimum priority per job this user can use to submit jobs. This property, + * the max degree of parallelism per job property, or both must be passed. + * @return the next definition stage. + */ + Update withMinPriorityPerJob(Integer minPriorityPerJob); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ComputePolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ComputePolicy refresh(Context context); +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/ComputePolicyListResult.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/ComputePolicyListResult.java new file mode 100644 index 000000000000..bd950dd2aa96 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/ComputePolicyListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.ComputePolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of compute policies in the account. */ +@Immutable +public final class ComputePolicyListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ComputePolicyListResult.class); + + /* + * The results of the list operation. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The results of the list operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link (url) to the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/CreateComputePolicyWithAccountParameters.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/CreateComputePolicyWithAccountParameters.java new file mode 100644 index 000000000000..02c14b5606f8 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/CreateComputePolicyWithAccountParameters.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.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.UUID; + +/** The parameters used to create a new compute policy while creating a new Data Lake Analytics account. */ +@JsonFlatten +@Fluent +public class CreateComputePolicyWithAccountParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CreateComputePolicyWithAccountParameters.class); + + /* + * The unique name of the compute policy to create. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The AAD object identifier for the entity to create a policy for. + */ + @JsonProperty(value = "properties.objectId", required = true) + private UUID objectId; + + /* + * The type of AAD object the object identifier refers to. + */ + @JsonProperty(value = "properties.objectType", required = true) + private AadObjectType objectType; + + /* + * The maximum degree of parallelism per job this user can use to submit + * jobs. This property, the min priority per job property, or both must be + * passed. + */ + @JsonProperty(value = "properties.maxDegreeOfParallelismPerJob") + private Integer maxDegreeOfParallelismPerJob; + + /* + * The minimum priority per job this user can use to submit jobs. This + * property, the max degree of parallelism per job property, or both must + * be passed. + */ + @JsonProperty(value = "properties.minPriorityPerJob") + private Integer minPriorityPerJob; + + /** + * Get the name property: The unique name of the compute policy to create. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The unique name of the compute policy to create. + * + * @param name the name value to set. + * @return the CreateComputePolicyWithAccountParameters object itself. + */ + public CreateComputePolicyWithAccountParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the objectId property: The AAD object identifier for the entity to create a policy for. + * + * @return the objectId value. + */ + public UUID objectId() { + return this.objectId; + } + + /** + * Set the objectId property: The AAD object identifier for the entity to create a policy for. + * + * @param objectId the objectId value to set. + * @return the CreateComputePolicyWithAccountParameters object itself. + */ + public CreateComputePolicyWithAccountParameters withObjectId(UUID objectId) { + this.objectId = objectId; + return this; + } + + /** + * Get the objectType property: The type of AAD object the object identifier refers to. + * + * @return the objectType value. + */ + public AadObjectType objectType() { + return this.objectType; + } + + /** + * Set the objectType property: The type of AAD object the object identifier refers to. + * + * @param objectType the objectType value to set. + * @return the CreateComputePolicyWithAccountParameters object itself. + */ + public CreateComputePolicyWithAccountParameters withObjectType(AadObjectType objectType) { + this.objectType = objectType; + return this; + } + + /** + * Get the maxDegreeOfParallelismPerJob property: The maximum degree of parallelism per job this user can use to + * submit jobs. This property, the min priority per job property, or both must be passed. + * + * @return the maxDegreeOfParallelismPerJob value. + */ + public Integer maxDegreeOfParallelismPerJob() { + return this.maxDegreeOfParallelismPerJob; + } + + /** + * Set the maxDegreeOfParallelismPerJob property: The maximum degree of parallelism per job this user can use to + * submit jobs. This property, the min priority per job property, or both must be passed. + * + * @param maxDegreeOfParallelismPerJob the maxDegreeOfParallelismPerJob value to set. + * @return the CreateComputePolicyWithAccountParameters object itself. + */ + public CreateComputePolicyWithAccountParameters withMaxDegreeOfParallelismPerJob( + Integer maxDegreeOfParallelismPerJob) { + this.maxDegreeOfParallelismPerJob = maxDegreeOfParallelismPerJob; + return this; + } + + /** + * Get the minPriorityPerJob property: The minimum priority per job this user can use to submit jobs. This property, + * the max degree of parallelism per job property, or both must be passed. + * + * @return the minPriorityPerJob value. + */ + public Integer minPriorityPerJob() { + return this.minPriorityPerJob; + } + + /** + * Set the minPriorityPerJob property: The minimum priority per job this user can use to submit jobs. This property, + * the max degree of parallelism per job property, or both must be passed. + * + * @param minPriorityPerJob the minPriorityPerJob value to set. + * @return the CreateComputePolicyWithAccountParameters object itself. + */ + public CreateComputePolicyWithAccountParameters withMinPriorityPerJob(Integer minPriorityPerJob) { + this.minPriorityPerJob = minPriorityPerJob; + 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 CreateComputePolicyWithAccountParameters")); + } + if (objectId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property objectId in model CreateComputePolicyWithAccountParameters")); + } + if (objectType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property objectType in model CreateComputePolicyWithAccountParameters")); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/CreateDataLakeAnalyticsAccountParameters.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/CreateDataLakeAnalyticsAccountParameters.java new file mode 100644 index 000000000000..25baa2a72a8e --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/CreateDataLakeAnalyticsAccountParameters.java @@ -0,0 +1,462 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.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; + +/** The parameters to use for creating a Data Lake Analytics account. */ +@JsonFlatten +@Fluent +public class CreateDataLakeAnalyticsAccountParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CreateDataLakeAnalyticsAccountParameters.class); + + /* + * The resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /* + * The resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * The default Data Lake Store account associated with this account. + */ + @JsonProperty(value = "properties.defaultDataLakeStoreAccount", required = true) + private String defaultDataLakeStoreAccount; + + /* + * The list of Data Lake Store accounts associated with this account. + */ + @JsonProperty(value = "properties.dataLakeStoreAccounts", required = true) + private List dataLakeStoreAccounts; + + /* + * The list of Azure Blob Storage accounts associated with this account. + */ + @JsonProperty(value = "properties.storageAccounts") + private List storageAccounts; + + /* + * The list of compute policies associated with this account. + */ + @JsonProperty(value = "properties.computePolicies") + private List computePolicies; + + /* + * The list of firewall rules associated with this account. + */ + @JsonProperty(value = "properties.firewallRules") + private List firewallRules; + + /* + * The current state of the IP address firewall for this account. + */ + @JsonProperty(value = "properties.firewallState") + private FirewallState firewallState; + + /* + * The current state of allowing or disallowing IPs originating within + * Azure through the firewall. If the firewall is disabled, this is not + * enforced. + */ + @JsonProperty(value = "properties.firewallAllowAzureIps") + private FirewallAllowAzureIpsState firewallAllowAzureIps; + + /* + * The commitment tier for the next month. + */ + @JsonProperty(value = "properties.newTier") + private TierType newTier; + + /* + * The maximum supported jobs running under the account at the same time. + */ + @JsonProperty(value = "properties.maxJobCount") + private Integer maxJobCount; + + /* + * The maximum supported degree of parallelism for this account. + */ + @JsonProperty(value = "properties.maxDegreeOfParallelism") + private Integer maxDegreeOfParallelism; + + /* + * The maximum supported degree of parallelism per job for this account. + */ + @JsonProperty(value = "properties.maxDegreeOfParallelismPerJob") + private Integer maxDegreeOfParallelismPerJob; + + /* + * The minimum supported priority per job for this account. + */ + @JsonProperty(value = "properties.minPriorityPerJob") + private Integer minPriorityPerJob; + + /* + * The number of days that job metadata is retained. + */ + @JsonProperty(value = "properties.queryStoreRetention") + private Integer queryStoreRetention; + + /** + * Get the location property: The resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The resource location. + * + * @param location the location value to set. + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags property: The resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The resource tags. + * + * @param tags the tags value to set. + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the defaultDataLakeStoreAccount property: The default Data Lake Store account associated with this account. + * + * @return the defaultDataLakeStoreAccount value. + */ + public String defaultDataLakeStoreAccount() { + return this.defaultDataLakeStoreAccount; + } + + /** + * Set the defaultDataLakeStoreAccount property: The default Data Lake Store account associated with this account. + * + * @param defaultDataLakeStoreAccount the defaultDataLakeStoreAccount value to set. + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withDefaultDataLakeStoreAccount( + String defaultDataLakeStoreAccount) { + this.defaultDataLakeStoreAccount = defaultDataLakeStoreAccount; + return this; + } + + /** + * Get the dataLakeStoreAccounts property: The list of Data Lake Store accounts associated with this account. + * + * @return the dataLakeStoreAccounts value. + */ + public List dataLakeStoreAccounts() { + return this.dataLakeStoreAccounts; + } + + /** + * Set the dataLakeStoreAccounts property: The list of Data Lake Store accounts associated with this account. + * + * @param dataLakeStoreAccounts the dataLakeStoreAccounts value to set. + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withDataLakeStoreAccounts( + List dataLakeStoreAccounts) { + this.dataLakeStoreAccounts = dataLakeStoreAccounts; + return this; + } + + /** + * Get the storageAccounts property: The list of Azure Blob Storage accounts associated with this account. + * + * @return the storageAccounts value. + */ + public List storageAccounts() { + return this.storageAccounts; + } + + /** + * Set the storageAccounts property: The list of Azure Blob Storage accounts associated with this account. + * + * @param storageAccounts the storageAccounts value to set. + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withStorageAccounts( + List storageAccounts) { + this.storageAccounts = storageAccounts; + return this; + } + + /** + * Get the computePolicies property: The list of compute policies associated with this account. + * + * @return the computePolicies value. + */ + public List computePolicies() { + return this.computePolicies; + } + + /** + * Set the computePolicies property: The list of compute policies associated with this account. + * + * @param computePolicies the computePolicies value to set. + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withComputePolicies( + List computePolicies) { + this.computePolicies = computePolicies; + return this; + } + + /** + * Get the firewallRules property: The list of firewall rules associated with this account. + * + * @return the firewallRules value. + */ + public List firewallRules() { + return this.firewallRules; + } + + /** + * Set the firewallRules property: The list of firewall rules associated with this account. + * + * @param firewallRules the firewallRules value to set. + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withFirewallRules( + List firewallRules) { + this.firewallRules = firewallRules; + return this; + } + + /** + * Get the firewallState property: The current state of the IP address firewall for this account. + * + * @return the firewallState value. + */ + public FirewallState firewallState() { + return this.firewallState; + } + + /** + * Set the firewallState property: The current state of the IP address firewall for this account. + * + * @param firewallState the firewallState value to set. + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withFirewallState(FirewallState firewallState) { + this.firewallState = firewallState; + return this; + } + + /** + * Get the firewallAllowAzureIps property: The current state of allowing or disallowing IPs originating within Azure + * through the firewall. If the firewall is disabled, this is not enforced. + * + * @return the firewallAllowAzureIps value. + */ + public FirewallAllowAzureIpsState firewallAllowAzureIps() { + return this.firewallAllowAzureIps; + } + + /** + * Set the firewallAllowAzureIps property: The current state of allowing or disallowing IPs originating within Azure + * through the firewall. If the firewall is disabled, this is not enforced. + * + * @param firewallAllowAzureIps the firewallAllowAzureIps value to set. + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withFirewallAllowAzureIps( + FirewallAllowAzureIpsState firewallAllowAzureIps) { + this.firewallAllowAzureIps = firewallAllowAzureIps; + return this; + } + + /** + * Get the newTier property: The commitment tier for the next month. + * + * @return the newTier value. + */ + public TierType newTier() { + return this.newTier; + } + + /** + * Set the newTier property: The commitment tier for the next month. + * + * @param newTier the newTier value to set. + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withNewTier(TierType newTier) { + this.newTier = newTier; + return this; + } + + /** + * Get the maxJobCount property: The maximum supported jobs running under the account at the same time. + * + * @return the maxJobCount value. + */ + public Integer maxJobCount() { + return this.maxJobCount; + } + + /** + * Set the maxJobCount property: The maximum supported jobs running under the account at the same time. + * + * @param maxJobCount the maxJobCount value to set. + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withMaxJobCount(Integer maxJobCount) { + this.maxJobCount = maxJobCount; + return this; + } + + /** + * Get the maxDegreeOfParallelism property: The maximum supported degree of parallelism for this account. + * + * @return the maxDegreeOfParallelism value. + */ + public Integer maxDegreeOfParallelism() { + return this.maxDegreeOfParallelism; + } + + /** + * Set the maxDegreeOfParallelism property: The maximum supported degree of parallelism for this account. + * + * @param maxDegreeOfParallelism the maxDegreeOfParallelism value to set. + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withMaxDegreeOfParallelism(Integer maxDegreeOfParallelism) { + this.maxDegreeOfParallelism = maxDegreeOfParallelism; + return this; + } + + /** + * Get the maxDegreeOfParallelismPerJob property: The maximum supported degree of parallelism per job for this + * account. + * + * @return the maxDegreeOfParallelismPerJob value. + */ + public Integer maxDegreeOfParallelismPerJob() { + return this.maxDegreeOfParallelismPerJob; + } + + /** + * Set the maxDegreeOfParallelismPerJob property: The maximum supported degree of parallelism per job for this + * account. + * + * @param maxDegreeOfParallelismPerJob the maxDegreeOfParallelismPerJob value to set. + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withMaxDegreeOfParallelismPerJob( + Integer maxDegreeOfParallelismPerJob) { + this.maxDegreeOfParallelismPerJob = maxDegreeOfParallelismPerJob; + return this; + } + + /** + * Get the minPriorityPerJob property: The minimum supported priority per job for this account. + * + * @return the minPriorityPerJob value. + */ + public Integer minPriorityPerJob() { + return this.minPriorityPerJob; + } + + /** + * Set the minPriorityPerJob property: The minimum supported priority per job for this account. + * + * @param minPriorityPerJob the minPriorityPerJob value to set. + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withMinPriorityPerJob(Integer minPriorityPerJob) { + this.minPriorityPerJob = minPriorityPerJob; + return this; + } + + /** + * Get the queryStoreRetention property: The number of days that job metadata is retained. + * + * @return the queryStoreRetention value. + */ + public Integer queryStoreRetention() { + return this.queryStoreRetention; + } + + /** + * Set the queryStoreRetention property: The number of days that job metadata is retained. + * + * @param queryStoreRetention the queryStoreRetention value to set. + * @return the CreateDataLakeAnalyticsAccountParameters object itself. + */ + public CreateDataLakeAnalyticsAccountParameters withQueryStoreRetention(Integer queryStoreRetention) { + this.queryStoreRetention = queryStoreRetention; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (location() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property location in model CreateDataLakeAnalyticsAccountParameters")); + } + if (defaultDataLakeStoreAccount() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property defaultDataLakeStoreAccount in model" + + " CreateDataLakeAnalyticsAccountParameters")); + } + if (dataLakeStoreAccounts() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dataLakeStoreAccounts in model" + + " CreateDataLakeAnalyticsAccountParameters")); + } else { + dataLakeStoreAccounts().forEach(e -> e.validate()); + } + if (storageAccounts() != null) { + storageAccounts().forEach(e -> e.validate()); + } + if (computePolicies() != null) { + computePolicies().forEach(e -> e.validate()); + } + if (firewallRules() != null) { + firewallRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/CreateFirewallRuleWithAccountParameters.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/CreateFirewallRuleWithAccountParameters.java new file mode 100644 index 000000000000..9c2ba1627a0b --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/CreateFirewallRuleWithAccountParameters.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.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; + +/** The parameters used to create a new firewall rule while creating a new Data Lake Analytics account. */ +@JsonFlatten +@Fluent +public class CreateFirewallRuleWithAccountParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CreateFirewallRuleWithAccountParameters.class); + + /* + * The unique name of the firewall rule to create. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The start IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.startIpAddress", required = true) + private String startIpAddress; + + /* + * The end IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.endIpAddress", required = true) + private String endIpAddress; + + /** + * Get the name property: The unique name of the firewall rule to create. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The unique name of the firewall rule to create. + * + * @param name the name value to set. + * @return the CreateFirewallRuleWithAccountParameters object itself. + */ + public CreateFirewallRuleWithAccountParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the startIpAddress property: The start IP address for the firewall rule. This can be either ipv4 or ipv6. + * Start and End should be in the same protocol. + * + * @return the startIpAddress value. + */ + public String startIpAddress() { + return this.startIpAddress; + } + + /** + * Set the startIpAddress property: The start IP address for the firewall rule. This can be either ipv4 or ipv6. + * Start and End should be in the same protocol. + * + * @param startIpAddress the startIpAddress value to set. + * @return the CreateFirewallRuleWithAccountParameters object itself. + */ + public CreateFirewallRuleWithAccountParameters withStartIpAddress(String startIpAddress) { + this.startIpAddress = startIpAddress; + return this; + } + + /** + * Get the endIpAddress property: The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start + * and End should be in the same protocol. + * + * @return the endIpAddress value. + */ + public String endIpAddress() { + return this.endIpAddress; + } + + /** + * Set the endIpAddress property: The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start + * and End should be in the same protocol. + * + * @param endIpAddress the endIpAddress value to set. + * @return the CreateFirewallRuleWithAccountParameters object itself. + */ + public CreateFirewallRuleWithAccountParameters withEndIpAddress(String endIpAddress) { + this.endIpAddress = endIpAddress; + 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 CreateFirewallRuleWithAccountParameters")); + } + if (startIpAddress() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property startIpAddress in model CreateFirewallRuleWithAccountParameters")); + } + if (endIpAddress() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property endIpAddress in model CreateFirewallRuleWithAccountParameters")); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/CreateOrUpdateComputePolicyParameters.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/CreateOrUpdateComputePolicyParameters.java new file mode 100644 index 000000000000..637df53d521c --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/CreateOrUpdateComputePolicyParameters.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.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.UUID; + +/** The parameters used to create a new compute policy. */ +@JsonFlatten +@Fluent +public class CreateOrUpdateComputePolicyParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CreateOrUpdateComputePolicyParameters.class); + + /* + * The AAD object identifier for the entity to create a policy for. + */ + @JsonProperty(value = "properties.objectId", required = true) + private UUID objectId; + + /* + * The type of AAD object the object identifier refers to. + */ + @JsonProperty(value = "properties.objectType", required = true) + private AadObjectType objectType; + + /* + * The maximum degree of parallelism per job this user can use to submit + * jobs. This property, the min priority per job property, or both must be + * passed. + */ + @JsonProperty(value = "properties.maxDegreeOfParallelismPerJob") + private Integer maxDegreeOfParallelismPerJob; + + /* + * The minimum priority per job this user can use to submit jobs. This + * property, the max degree of parallelism per job property, or both must + * be passed. + */ + @JsonProperty(value = "properties.minPriorityPerJob") + private Integer minPriorityPerJob; + + /** + * Get the objectId property: The AAD object identifier for the entity to create a policy for. + * + * @return the objectId value. + */ + public UUID objectId() { + return this.objectId; + } + + /** + * Set the objectId property: The AAD object identifier for the entity to create a policy for. + * + * @param objectId the objectId value to set. + * @return the CreateOrUpdateComputePolicyParameters object itself. + */ + public CreateOrUpdateComputePolicyParameters withObjectId(UUID objectId) { + this.objectId = objectId; + return this; + } + + /** + * Get the objectType property: The type of AAD object the object identifier refers to. + * + * @return the objectType value. + */ + public AadObjectType objectType() { + return this.objectType; + } + + /** + * Set the objectType property: The type of AAD object the object identifier refers to. + * + * @param objectType the objectType value to set. + * @return the CreateOrUpdateComputePolicyParameters object itself. + */ + public CreateOrUpdateComputePolicyParameters withObjectType(AadObjectType objectType) { + this.objectType = objectType; + return this; + } + + /** + * Get the maxDegreeOfParallelismPerJob property: The maximum degree of parallelism per job this user can use to + * submit jobs. This property, the min priority per job property, or both must be passed. + * + * @return the maxDegreeOfParallelismPerJob value. + */ + public Integer maxDegreeOfParallelismPerJob() { + return this.maxDegreeOfParallelismPerJob; + } + + /** + * Set the maxDegreeOfParallelismPerJob property: The maximum degree of parallelism per job this user can use to + * submit jobs. This property, the min priority per job property, or both must be passed. + * + * @param maxDegreeOfParallelismPerJob the maxDegreeOfParallelismPerJob value to set. + * @return the CreateOrUpdateComputePolicyParameters object itself. + */ + public CreateOrUpdateComputePolicyParameters withMaxDegreeOfParallelismPerJob( + Integer maxDegreeOfParallelismPerJob) { + this.maxDegreeOfParallelismPerJob = maxDegreeOfParallelismPerJob; + return this; + } + + /** + * Get the minPriorityPerJob property: The minimum priority per job this user can use to submit jobs. This property, + * the max degree of parallelism per job property, or both must be passed. + * + * @return the minPriorityPerJob value. + */ + public Integer minPriorityPerJob() { + return this.minPriorityPerJob; + } + + /** + * Set the minPriorityPerJob property: The minimum priority per job this user can use to submit jobs. This property, + * the max degree of parallelism per job property, or both must be passed. + * + * @param minPriorityPerJob the minPriorityPerJob value to set. + * @return the CreateOrUpdateComputePolicyParameters object itself. + */ + public CreateOrUpdateComputePolicyParameters withMinPriorityPerJob(Integer minPriorityPerJob) { + this.minPriorityPerJob = minPriorityPerJob; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (objectId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property objectId in model CreateOrUpdateComputePolicyParameters")); + } + if (objectType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property objectType in model CreateOrUpdateComputePolicyParameters")); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/CreateOrUpdateFirewallRuleParameters.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/CreateOrUpdateFirewallRuleParameters.java new file mode 100644 index 000000000000..4d3ee9adcfee --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/CreateOrUpdateFirewallRuleParameters.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.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; + +/** The parameters used to create a new firewall rule. */ +@JsonFlatten +@Fluent +public class CreateOrUpdateFirewallRuleParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CreateOrUpdateFirewallRuleParameters.class); + + /* + * The start IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.startIpAddress", required = true) + private String startIpAddress; + + /* + * The end IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.endIpAddress", required = true) + private String endIpAddress; + + /** + * Get the startIpAddress property: The start IP address for the firewall rule. This can be either ipv4 or ipv6. + * Start and End should be in the same protocol. + * + * @return the startIpAddress value. + */ + public String startIpAddress() { + return this.startIpAddress; + } + + /** + * Set the startIpAddress property: The start IP address for the firewall rule. This can be either ipv4 or ipv6. + * Start and End should be in the same protocol. + * + * @param startIpAddress the startIpAddress value to set. + * @return the CreateOrUpdateFirewallRuleParameters object itself. + */ + public CreateOrUpdateFirewallRuleParameters withStartIpAddress(String startIpAddress) { + this.startIpAddress = startIpAddress; + return this; + } + + /** + * Get the endIpAddress property: The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start + * and End should be in the same protocol. + * + * @return the endIpAddress value. + */ + public String endIpAddress() { + return this.endIpAddress; + } + + /** + * Set the endIpAddress property: The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start + * and End should be in the same protocol. + * + * @param endIpAddress the endIpAddress value to set. + * @return the CreateOrUpdateFirewallRuleParameters object itself. + */ + public CreateOrUpdateFirewallRuleParameters withEndIpAddress(String endIpAddress) { + this.endIpAddress = endIpAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (startIpAddress() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property startIpAddress in model CreateOrUpdateFirewallRuleParameters")); + } + if (endIpAddress() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property endIpAddress in model CreateOrUpdateFirewallRuleParameters")); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeAnalyticsAccount.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeAnalyticsAccount.java new file mode 100644 index 000000000000..035992ac9f92 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeAnalyticsAccount.java @@ -0,0 +1,677 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.DataLakeAnalyticsAccountInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +/** An immutable client-side representation of DataLakeAnalyticsAccount. */ +public interface DataLakeAnalyticsAccount { + /** + * 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 accountId property: The unique identifier associated with this Data Lake Analytics account. + * + * @return the accountId value. + */ + UUID accountId(); + + /** + * Gets the provisioningState property: The provisioning status of the Data Lake Analytics account. + * + * @return the provisioningState value. + */ + DataLakeAnalyticsAccountStatus provisioningState(); + + /** + * Gets the state property: The state of the Data Lake Analytics account. + * + * @return the state value. + */ + DataLakeAnalyticsAccountState state(); + + /** + * Gets the creationTime property: The account creation time. + * + * @return the creationTime value. + */ + OffsetDateTime creationTime(); + + /** + * Gets the lastModifiedTime property: The account last modified time. + * + * @return the lastModifiedTime value. + */ + OffsetDateTime lastModifiedTime(); + + /** + * Gets the endpoint property: The full CName endpoint for this account. + * + * @return the endpoint value. + */ + String endpoint(); + + /** + * Gets the defaultDataLakeStoreAccount property: The default Data Lake Store account associated with this account. + * + * @return the defaultDataLakeStoreAccount value. + */ + String defaultDataLakeStoreAccount(); + + /** + * Gets the dataLakeStoreAccounts property: The list of Data Lake Store accounts associated with this account. + * + * @return the dataLakeStoreAccounts value. + */ + List dataLakeStoreAccounts(); + + /** + * Gets the publicDataLakeStoreAccounts property: The list of Data Lake Store accounts associated with this account. + * + * @return the publicDataLakeStoreAccounts value. + */ + List publicDataLakeStoreAccounts(); + + /** + * Gets the storageAccounts property: The list of Azure Blob Storage accounts associated with this account. + * + * @return the storageAccounts value. + */ + List storageAccounts(); + + /** + * Gets the computePolicies property: The list of compute policies associated with this account. + * + * @return the computePolicies value. + */ + List computePolicies(); + + /** + * Gets the hiveMetastores property: The list of hiveMetastores associated with this account. + * + * @return the hiveMetastores value. + */ + List hiveMetastores(); + + /** + * Gets the virtualNetworkRules property: The list of virtualNetwork rules associated with this account. + * + * @return the virtualNetworkRules value. + */ + List virtualNetworkRules(); + + /** + * Gets the firewallRules property: The list of firewall rules associated with this account. + * + * @return the firewallRules value. + */ + List firewallRules(); + + /** + * Gets the firewallState property: The current state of the IP address firewall for this account. + * + * @return the firewallState value. + */ + FirewallState firewallState(); + + /** + * Gets the firewallAllowAzureIps property: The current state of allowing or disallowing IPs originating within + * Azure through the firewall. If the firewall is disabled, this is not enforced. + * + * @return the firewallAllowAzureIps value. + */ + FirewallAllowAzureIpsState firewallAllowAzureIps(); + + /** + * Gets the newTier property: The commitment tier for the next month. + * + * @return the newTier value. + */ + TierType newTier(); + + /** + * Gets the currentTier property: The commitment tier in use for the current month. + * + * @return the currentTier value. + */ + TierType currentTier(); + + /** + * Gets the maxJobCount property: The maximum supported jobs running under the account at the same time. + * + * @return the maxJobCount value. + */ + Integer maxJobCount(); + + /** + * Gets the systemMaxJobCount property: The system defined maximum supported jobs running under the account at the + * same time, which restricts the maximum number of running jobs the user can set for the account. + * + * @return the systemMaxJobCount value. + */ + Integer systemMaxJobCount(); + + /** + * Gets the maxDegreeOfParallelism property: The maximum supported degree of parallelism for this account. + * + * @return the maxDegreeOfParallelism value. + */ + Integer maxDegreeOfParallelism(); + + /** + * Gets the systemMaxDegreeOfParallelism property: The system defined maximum supported degree of parallelism for + * this account, which restricts the maximum value of parallelism the user can set for the account. + * + * @return the systemMaxDegreeOfParallelism value. + */ + Integer systemMaxDegreeOfParallelism(); + + /** + * Gets the maxDegreeOfParallelismPerJob property: The maximum supported degree of parallelism per job for this + * account. + * + * @return the maxDegreeOfParallelismPerJob value. + */ + Integer maxDegreeOfParallelismPerJob(); + + /** + * Gets the minPriorityPerJob property: The minimum supported priority per job for this account. + * + * @return the minPriorityPerJob value. + */ + Integer minPriorityPerJob(); + + /** + * Gets the queryStoreRetention property: The number of days that job metadata is retained. + * + * @return the queryStoreRetention value. + */ + Integer queryStoreRetention(); + + /** + * Gets the debugDataAccessLevel property: The current state of the DebugDataAccessLevel for this account. + * + * @return the debugDataAccessLevel value. + */ + DebugDataAccessLevel debugDataAccessLevel(); + + /** + * 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.datalakeanalytics.fluent.models.DataLakeAnalyticsAccountInner object. + * + * @return the inner object. + */ + DataLakeAnalyticsAccountInner innerModel(); + + /** The entirety of the DataLakeAnalyticsAccount definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithDefaultDataLakeStoreAccount, + DefinitionStages.WithDataLakeStoreAccounts, + DefinitionStages.WithCreate { + } + /** The DataLakeAnalyticsAccount definition stages. */ + interface DefinitionStages { + /** The first stage of the DataLakeAnalyticsAccount definition. */ + interface Blank extends WithLocation { + } + /** The stage of the DataLakeAnalyticsAccount definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The resource location. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The resource location. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the DataLakeAnalyticsAccount definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the Azure resource group. + * @return the next definition stage. + */ + WithDefaultDataLakeStoreAccount withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the DataLakeAnalyticsAccount definition allowing to specify defaultDataLakeStoreAccount. */ + interface WithDefaultDataLakeStoreAccount { + /** + * Specifies the defaultDataLakeStoreAccount property: The default Data Lake Store account associated with + * this account.. + * + * @param defaultDataLakeStoreAccount The default Data Lake Store account associated with this account. + * @return the next definition stage. + */ + WithDataLakeStoreAccounts withDefaultDataLakeStoreAccount(String defaultDataLakeStoreAccount); + } + /** The stage of the DataLakeAnalyticsAccount definition allowing to specify dataLakeStoreAccounts. */ + interface WithDataLakeStoreAccounts { + /** + * Specifies the dataLakeStoreAccounts property: The list of Data Lake Store accounts associated with this + * account.. + * + * @param dataLakeStoreAccounts The list of Data Lake Store accounts associated with this account. + * @return the next definition stage. + */ + WithCreate withDataLakeStoreAccounts(List dataLakeStoreAccounts); + } + /** + * The stage of the DataLakeAnalyticsAccount 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.WithStorageAccounts, + DefinitionStages.WithComputePolicies, + DefinitionStages.WithFirewallRules, + DefinitionStages.WithFirewallState, + DefinitionStages.WithFirewallAllowAzureIps, + DefinitionStages.WithNewTier, + DefinitionStages.WithMaxJobCount, + DefinitionStages.WithMaxDegreeOfParallelism, + DefinitionStages.WithMaxDegreeOfParallelismPerJob, + DefinitionStages.WithMinPriorityPerJob, + DefinitionStages.WithQueryStoreRetention { + /** + * Executes the create request. + * + * @return the created resource. + */ + DataLakeAnalyticsAccount create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DataLakeAnalyticsAccount create(Context context); + } + /** The stage of the DataLakeAnalyticsAccount definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The resource tags.. + * + * @param tags The resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the DataLakeAnalyticsAccount definition allowing to specify storageAccounts. */ + interface WithStorageAccounts { + /** + * Specifies the storageAccounts property: The list of Azure Blob Storage accounts associated with this + * account.. + * + * @param storageAccounts The list of Azure Blob Storage accounts associated with this account. + * @return the next definition stage. + */ + WithCreate withStorageAccounts(List storageAccounts); + } + /** The stage of the DataLakeAnalyticsAccount definition allowing to specify computePolicies. */ + interface WithComputePolicies { + /** + * Specifies the computePolicies property: The list of compute policies associated with this account.. + * + * @param computePolicies The list of compute policies associated with this account. + * @return the next definition stage. + */ + WithCreate withComputePolicies(List computePolicies); + } + /** The stage of the DataLakeAnalyticsAccount definition allowing to specify firewallRules. */ + interface WithFirewallRules { + /** + * Specifies the firewallRules property: The list of firewall rules associated with this account.. + * + * @param firewallRules The list of firewall rules associated with this account. + * @return the next definition stage. + */ + WithCreate withFirewallRules(List firewallRules); + } + /** The stage of the DataLakeAnalyticsAccount definition allowing to specify firewallState. */ + interface WithFirewallState { + /** + * Specifies the firewallState property: The current state of the IP address firewall for this account.. + * + * @param firewallState The current state of the IP address firewall for this account. + * @return the next definition stage. + */ + WithCreate withFirewallState(FirewallState firewallState); + } + /** The stage of the DataLakeAnalyticsAccount definition allowing to specify firewallAllowAzureIps. */ + interface WithFirewallAllowAzureIps { + /** + * Specifies the firewallAllowAzureIps property: The current state of allowing or disallowing IPs + * originating within Azure through the firewall. If the firewall is disabled, this is not enforced.. + * + * @param firewallAllowAzureIps The current state of allowing or disallowing IPs originating within Azure + * through the firewall. If the firewall is disabled, this is not enforced. + * @return the next definition stage. + */ + WithCreate withFirewallAllowAzureIps(FirewallAllowAzureIpsState firewallAllowAzureIps); + } + /** The stage of the DataLakeAnalyticsAccount definition allowing to specify newTier. */ + interface WithNewTier { + /** + * Specifies the newTier property: The commitment tier for the next month.. + * + * @param newTier The commitment tier for the next month. + * @return the next definition stage. + */ + WithCreate withNewTier(TierType newTier); + } + /** The stage of the DataLakeAnalyticsAccount definition allowing to specify maxJobCount. */ + interface WithMaxJobCount { + /** + * Specifies the maxJobCount property: The maximum supported jobs running under the account at the same + * time.. + * + * @param maxJobCount The maximum supported jobs running under the account at the same time. + * @return the next definition stage. + */ + WithCreate withMaxJobCount(Integer maxJobCount); + } + /** The stage of the DataLakeAnalyticsAccount definition allowing to specify maxDegreeOfParallelism. */ + interface WithMaxDegreeOfParallelism { + /** + * Specifies the maxDegreeOfParallelism property: The maximum supported degree of parallelism for this + * account.. + * + * @param maxDegreeOfParallelism The maximum supported degree of parallelism for this account. + * @return the next definition stage. + */ + WithCreate withMaxDegreeOfParallelism(Integer maxDegreeOfParallelism); + } + /** The stage of the DataLakeAnalyticsAccount definition allowing to specify maxDegreeOfParallelismPerJob. */ + interface WithMaxDegreeOfParallelismPerJob { + /** + * Specifies the maxDegreeOfParallelismPerJob property: The maximum supported degree of parallelism per job + * for this account.. + * + * @param maxDegreeOfParallelismPerJob The maximum supported degree of parallelism per job for this account. + * @return the next definition stage. + */ + WithCreate withMaxDegreeOfParallelismPerJob(Integer maxDegreeOfParallelismPerJob); + } + /** The stage of the DataLakeAnalyticsAccount definition allowing to specify minPriorityPerJob. */ + interface WithMinPriorityPerJob { + /** + * Specifies the minPriorityPerJob property: The minimum supported priority per job for this account.. + * + * @param minPriorityPerJob The minimum supported priority per job for this account. + * @return the next definition stage. + */ + WithCreate withMinPriorityPerJob(Integer minPriorityPerJob); + } + /** The stage of the DataLakeAnalyticsAccount definition allowing to specify queryStoreRetention. */ + interface WithQueryStoreRetention { + /** + * Specifies the queryStoreRetention property: The number of days that job metadata is retained.. + * + * @param queryStoreRetention The number of days that job metadata is retained. + * @return the next definition stage. + */ + WithCreate withQueryStoreRetention(Integer queryStoreRetention); + } + } + /** + * Begins update for the DataLakeAnalyticsAccount resource. + * + * @return the stage of resource update. + */ + DataLakeAnalyticsAccount.Update update(); + + /** The template for DataLakeAnalyticsAccount update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithDataLakeStoreAccounts, + UpdateStages.WithStorageAccounts, + UpdateStages.WithComputePolicies, + UpdateStages.WithFirewallRules, + UpdateStages.WithFirewallState, + UpdateStages.WithFirewallAllowAzureIps, + UpdateStages.WithNewTier, + UpdateStages.WithMaxJobCount, + UpdateStages.WithMaxDegreeOfParallelism, + UpdateStages.WithMaxDegreeOfParallelismPerJob, + UpdateStages.WithMinPriorityPerJob, + UpdateStages.WithQueryStoreRetention { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DataLakeAnalyticsAccount apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DataLakeAnalyticsAccount apply(Context context); + } + /** The DataLakeAnalyticsAccount update stages. */ + interface UpdateStages { + /** The stage of the DataLakeAnalyticsAccount update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The resource tags.. + * + * @param tags The resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the DataLakeAnalyticsAccount update allowing to specify dataLakeStoreAccounts. */ + interface WithDataLakeStoreAccounts { + /** + * Specifies the dataLakeStoreAccounts property: The list of Data Lake Store accounts associated with this + * account.. + * + * @param dataLakeStoreAccounts The list of Data Lake Store accounts associated with this account. + * @return the next definition stage. + */ + Update withDataLakeStoreAccountsForUpdate( + List dataLakeStoreAccounts); + } + /** The stage of the DataLakeAnalyticsAccount update allowing to specify storageAccounts. */ + interface WithStorageAccounts { + /** + * Specifies the storageAccounts property: The list of Azure Blob storage accounts associated with this + * account.. + * + * @param storageAccounts The list of Azure Blob storage accounts associated with this account. + * @return the next definition stage. + */ + Update withStorageAccountsForUpdate(List storageAccounts); + } + /** The stage of the DataLakeAnalyticsAccount update allowing to specify computePolicies. */ + interface WithComputePolicies { + /** + * Specifies the computePolicies property: The list of compute policies associated with this account.. + * + * @param computePolicies The list of compute policies associated with this account. + * @return the next definition stage. + */ + Update withComputePoliciesForUpdate(List computePolicies); + } + /** The stage of the DataLakeAnalyticsAccount update allowing to specify firewallRules. */ + interface WithFirewallRules { + /** + * Specifies the firewallRules property: The list of firewall rules associated with this account.. + * + * @param firewallRules The list of firewall rules associated with this account. + * @return the next definition stage. + */ + Update withFirewallRulesForUpdate(List firewallRules); + } + /** The stage of the DataLakeAnalyticsAccount update allowing to specify firewallState. */ + interface WithFirewallState { + /** + * Specifies the firewallState property: The current state of the IP address firewall for this account. + * Disabling the firewall does not remove existing rules, they will just be ignored until the firewall is + * re-enabled.. + * + * @param firewallState The current state of the IP address firewall for this account. Disabling the + * firewall does not remove existing rules, they will just be ignored until the firewall is re-enabled. + * @return the next definition stage. + */ + Update withFirewallState(FirewallState firewallState); + } + /** The stage of the DataLakeAnalyticsAccount update allowing to specify firewallAllowAzureIps. */ + interface WithFirewallAllowAzureIps { + /** + * Specifies the firewallAllowAzureIps property: The current state of allowing or disallowing IPs + * originating within Azure through the firewall. If the firewall is disabled, this is not enforced.. + * + * @param firewallAllowAzureIps The current state of allowing or disallowing IPs originating within Azure + * through the firewall. If the firewall is disabled, this is not enforced. + * @return the next definition stage. + */ + Update withFirewallAllowAzureIps(FirewallAllowAzureIpsState firewallAllowAzureIps); + } + /** The stage of the DataLakeAnalyticsAccount update allowing to specify newTier. */ + interface WithNewTier { + /** + * Specifies the newTier property: The commitment tier to use for next month.. + * + * @param newTier The commitment tier to use for next month. + * @return the next definition stage. + */ + Update withNewTier(TierType newTier); + } + /** The stage of the DataLakeAnalyticsAccount update allowing to specify maxJobCount. */ + interface WithMaxJobCount { + /** + * Specifies the maxJobCount property: The maximum supported jobs running under the account at the same + * time.. + * + * @param maxJobCount The maximum supported jobs running under the account at the same time. + * @return the next definition stage. + */ + Update withMaxJobCount(Integer maxJobCount); + } + /** The stage of the DataLakeAnalyticsAccount update allowing to specify maxDegreeOfParallelism. */ + interface WithMaxDegreeOfParallelism { + /** + * Specifies the maxDegreeOfParallelism property: The maximum supported degree of parallelism for this + * account.. + * + * @param maxDegreeOfParallelism The maximum supported degree of parallelism for this account. + * @return the next definition stage. + */ + Update withMaxDegreeOfParallelism(Integer maxDegreeOfParallelism); + } + /** The stage of the DataLakeAnalyticsAccount update allowing to specify maxDegreeOfParallelismPerJob. */ + interface WithMaxDegreeOfParallelismPerJob { + /** + * Specifies the maxDegreeOfParallelismPerJob property: The maximum supported degree of parallelism per job + * for this account.. + * + * @param maxDegreeOfParallelismPerJob The maximum supported degree of parallelism per job for this account. + * @return the next definition stage. + */ + Update withMaxDegreeOfParallelismPerJob(Integer maxDegreeOfParallelismPerJob); + } + /** The stage of the DataLakeAnalyticsAccount update allowing to specify minPriorityPerJob. */ + interface WithMinPriorityPerJob { + /** + * Specifies the minPriorityPerJob property: The minimum supported priority per job for this account.. + * + * @param minPriorityPerJob The minimum supported priority per job for this account. + * @return the next definition stage. + */ + Update withMinPriorityPerJob(Integer minPriorityPerJob); + } + /** The stage of the DataLakeAnalyticsAccount update allowing to specify queryStoreRetention. */ + interface WithQueryStoreRetention { + /** + * Specifies the queryStoreRetention property: The number of days that job metadata is retained.. + * + * @param queryStoreRetention The number of days that job metadata is retained. + * @return the next definition stage. + */ + Update withQueryStoreRetention(Integer queryStoreRetention); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DataLakeAnalyticsAccount refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DataLakeAnalyticsAccount refresh(Context context); +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeAnalyticsAccountBasic.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeAnalyticsAccountBasic.java new file mode 100644 index 000000000000..96b9a4af009b --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeAnalyticsAccountBasic.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.resourcemanager.datalakeanalytics.fluent.models.DataLakeAnalyticsAccountBasicInner; +import java.time.OffsetDateTime; +import java.util.Map; +import java.util.UUID; + +/** An immutable client-side representation of DataLakeAnalyticsAccountBasic. */ +public interface DataLakeAnalyticsAccountBasic { + /** + * 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 accountId property: The unique identifier associated with this Data Lake Analytics account. + * + * @return the accountId value. + */ + UUID accountId(); + + /** + * Gets the provisioningState property: The provisioning status of the Data Lake Analytics account. + * + * @return the provisioningState value. + */ + DataLakeAnalyticsAccountStatus provisioningState(); + + /** + * Gets the state property: The state of the Data Lake Analytics account. + * + * @return the state value. + */ + DataLakeAnalyticsAccountState state(); + + /** + * Gets the creationTime property: The account creation time. + * + * @return the creationTime value. + */ + OffsetDateTime creationTime(); + + /** + * Gets the lastModifiedTime property: The account last modified time. + * + * @return the lastModifiedTime value. + */ + OffsetDateTime lastModifiedTime(); + + /** + * Gets the endpoint property: The full CName endpoint for this account. + * + * @return the endpoint value. + */ + String endpoint(); + + /** + * Gets the inner com.azure.resourcemanager.datalakeanalytics.fluent.models.DataLakeAnalyticsAccountBasicInner + * object. + * + * @return the inner object. + */ + DataLakeAnalyticsAccountBasicInner innerModel(); +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeAnalyticsAccountListResult.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeAnalyticsAccountListResult.java new file mode 100644 index 000000000000..100e1ffab38d --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeAnalyticsAccountListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.DataLakeAnalyticsAccountBasicInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Data Lake Analytics account list information. */ +@Immutable +public final class DataLakeAnalyticsAccountListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataLakeAnalyticsAccountListResult.class); + + /* + * The results of the list operation. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The results of the list operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link (url) to the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeAnalyticsAccountProperties.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeAnalyticsAccountProperties.java new file mode 100644 index 000000000000..f490682a1ca5 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeAnalyticsAccountProperties.java @@ -0,0 +1,457 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.ComputePolicyInner; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.DataLakeStoreAccountInformationInner; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.FirewallRuleInner; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.StorageAccountInformationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The account specific properties that are associated with an underlying Data Lake Analytics account. Returned only + * when retrieving a specific account. + */ +@Fluent +public final class DataLakeAnalyticsAccountProperties extends DataLakeAnalyticsAccountPropertiesBasic { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataLakeAnalyticsAccountProperties.class); + + /* + * The default Data Lake Store account associated with this account. + */ + @JsonProperty(value = "defaultDataLakeStoreAccount", access = JsonProperty.Access.WRITE_ONLY) + private String defaultDataLakeStoreAccount; + + /* + * The list of Data Lake Store accounts associated with this account. + */ + @JsonProperty(value = "dataLakeStoreAccounts", access = JsonProperty.Access.WRITE_ONLY) + private List dataLakeStoreAccounts; + + /* + * The list of Data Lake Store accounts associated with this account. + */ + @JsonProperty(value = "publicDataLakeStoreAccounts") + private List publicDataLakeStoreAccounts; + + /* + * The list of Azure Blob Storage accounts associated with this account. + */ + @JsonProperty(value = "storageAccounts", access = JsonProperty.Access.WRITE_ONLY) + private List storageAccounts; + + /* + * The list of compute policies associated with this account. + */ + @JsonProperty(value = "computePolicies", access = JsonProperty.Access.WRITE_ONLY) + private List computePolicies; + + /* + * The list of hiveMetastores associated with this account. + */ + @JsonProperty(value = "hiveMetastores", access = JsonProperty.Access.WRITE_ONLY) + private List hiveMetastores; + + /* + * The list of virtualNetwork rules associated with this account. + */ + @JsonProperty(value = "virtualNetworkRules", access = JsonProperty.Access.WRITE_ONLY) + private List virtualNetworkRules; + + /* + * The list of firewall rules associated with this account. + */ + @JsonProperty(value = "firewallRules", access = JsonProperty.Access.WRITE_ONLY) + private List firewallRules; + + /* + * The current state of the IP address firewall for this account. + */ + @JsonProperty(value = "firewallState") + private FirewallState firewallState; + + /* + * The current state of allowing or disallowing IPs originating within + * Azure through the firewall. If the firewall is disabled, this is not + * enforced. + */ + @JsonProperty(value = "firewallAllowAzureIps") + private FirewallAllowAzureIpsState firewallAllowAzureIps; + + /* + * The commitment tier for the next month. + */ + @JsonProperty(value = "newTier") + private TierType newTier; + + /* + * The commitment tier in use for the current month. + */ + @JsonProperty(value = "currentTier", access = JsonProperty.Access.WRITE_ONLY) + private TierType currentTier; + + /* + * The maximum supported jobs running under the account at the same time. + */ + @JsonProperty(value = "maxJobCount") + private Integer maxJobCount; + + /* + * The system defined maximum supported jobs running under the account at + * the same time, which restricts the maximum number of running jobs the + * user can set for the account. + */ + @JsonProperty(value = "systemMaxJobCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer systemMaxJobCount; + + /* + * The maximum supported degree of parallelism for this account. + */ + @JsonProperty(value = "maxDegreeOfParallelism") + private Integer maxDegreeOfParallelism; + + /* + * The system defined maximum supported degree of parallelism for this + * account, which restricts the maximum value of parallelism the user can + * set for the account. + */ + @JsonProperty(value = "systemMaxDegreeOfParallelism", access = JsonProperty.Access.WRITE_ONLY) + private Integer systemMaxDegreeOfParallelism; + + /* + * The maximum supported degree of parallelism per job for this account. + */ + @JsonProperty(value = "maxDegreeOfParallelismPerJob") + private Integer maxDegreeOfParallelismPerJob; + + /* + * The minimum supported priority per job for this account. + */ + @JsonProperty(value = "minPriorityPerJob", access = JsonProperty.Access.WRITE_ONLY) + private Integer minPriorityPerJob; + + /* + * The number of days that job metadata is retained. + */ + @JsonProperty(value = "queryStoreRetention") + private Integer queryStoreRetention; + + /* + * The current state of the DebugDataAccessLevel for this account. + */ + @JsonProperty(value = "debugDataAccessLevel", access = JsonProperty.Access.WRITE_ONLY) + private DebugDataAccessLevel debugDataAccessLevel; + + /** + * Get the defaultDataLakeStoreAccount property: The default Data Lake Store account associated with this account. + * + * @return the defaultDataLakeStoreAccount value. + */ + public String defaultDataLakeStoreAccount() { + return this.defaultDataLakeStoreAccount; + } + + /** + * Get the dataLakeStoreAccounts property: The list of Data Lake Store accounts associated with this account. + * + * @return the dataLakeStoreAccounts value. + */ + public List dataLakeStoreAccounts() { + return this.dataLakeStoreAccounts; + } + + /** + * Get the publicDataLakeStoreAccounts property: The list of Data Lake Store accounts associated with this account. + * + * @return the publicDataLakeStoreAccounts value. + */ + public List publicDataLakeStoreAccounts() { + return this.publicDataLakeStoreAccounts; + } + + /** + * Set the publicDataLakeStoreAccounts property: The list of Data Lake Store accounts associated with this account. + * + * @param publicDataLakeStoreAccounts the publicDataLakeStoreAccounts value to set. + * @return the DataLakeAnalyticsAccountProperties object itself. + */ + public DataLakeAnalyticsAccountProperties withPublicDataLakeStoreAccounts( + List publicDataLakeStoreAccounts) { + this.publicDataLakeStoreAccounts = publicDataLakeStoreAccounts; + return this; + } + + /** + * Get the storageAccounts property: The list of Azure Blob Storage accounts associated with this account. + * + * @return the storageAccounts value. + */ + public List storageAccounts() { + return this.storageAccounts; + } + + /** + * Get the computePolicies property: The list of compute policies associated with this account. + * + * @return the computePolicies value. + */ + public List computePolicies() { + return this.computePolicies; + } + + /** + * Get the hiveMetastores property: The list of hiveMetastores associated with this account. + * + * @return the hiveMetastores value. + */ + public List hiveMetastores() { + return this.hiveMetastores; + } + + /** + * Get the virtualNetworkRules property: The list of virtualNetwork rules associated with this account. + * + * @return the virtualNetworkRules value. + */ + public List virtualNetworkRules() { + return this.virtualNetworkRules; + } + + /** + * Get the firewallRules property: The list of firewall rules associated with this account. + * + * @return the firewallRules value. + */ + public List firewallRules() { + return this.firewallRules; + } + + /** + * Get the firewallState property: The current state of the IP address firewall for this account. + * + * @return the firewallState value. + */ + public FirewallState firewallState() { + return this.firewallState; + } + + /** + * Set the firewallState property: The current state of the IP address firewall for this account. + * + * @param firewallState the firewallState value to set. + * @return the DataLakeAnalyticsAccountProperties object itself. + */ + public DataLakeAnalyticsAccountProperties withFirewallState(FirewallState firewallState) { + this.firewallState = firewallState; + return this; + } + + /** + * Get the firewallAllowAzureIps property: The current state of allowing or disallowing IPs originating within Azure + * through the firewall. If the firewall is disabled, this is not enforced. + * + * @return the firewallAllowAzureIps value. + */ + public FirewallAllowAzureIpsState firewallAllowAzureIps() { + return this.firewallAllowAzureIps; + } + + /** + * Set the firewallAllowAzureIps property: The current state of allowing or disallowing IPs originating within Azure + * through the firewall. If the firewall is disabled, this is not enforced. + * + * @param firewallAllowAzureIps the firewallAllowAzureIps value to set. + * @return the DataLakeAnalyticsAccountProperties object itself. + */ + public DataLakeAnalyticsAccountProperties withFirewallAllowAzureIps( + FirewallAllowAzureIpsState firewallAllowAzureIps) { + this.firewallAllowAzureIps = firewallAllowAzureIps; + return this; + } + + /** + * Get the newTier property: The commitment tier for the next month. + * + * @return the newTier value. + */ + public TierType newTier() { + return this.newTier; + } + + /** + * Set the newTier property: The commitment tier for the next month. + * + * @param newTier the newTier value to set. + * @return the DataLakeAnalyticsAccountProperties object itself. + */ + public DataLakeAnalyticsAccountProperties withNewTier(TierType newTier) { + this.newTier = newTier; + return this; + } + + /** + * Get the currentTier property: The commitment tier in use for the current month. + * + * @return the currentTier value. + */ + public TierType currentTier() { + return this.currentTier; + } + + /** + * Get the maxJobCount property: The maximum supported jobs running under the account at the same time. + * + * @return the maxJobCount value. + */ + public Integer maxJobCount() { + return this.maxJobCount; + } + + /** + * Set the maxJobCount property: The maximum supported jobs running under the account at the same time. + * + * @param maxJobCount the maxJobCount value to set. + * @return the DataLakeAnalyticsAccountProperties object itself. + */ + public DataLakeAnalyticsAccountProperties withMaxJobCount(Integer maxJobCount) { + this.maxJobCount = maxJobCount; + return this; + } + + /** + * Get the systemMaxJobCount property: The system defined maximum supported jobs running under the account at the + * same time, which restricts the maximum number of running jobs the user can set for the account. + * + * @return the systemMaxJobCount value. + */ + public Integer systemMaxJobCount() { + return this.systemMaxJobCount; + } + + /** + * Get the maxDegreeOfParallelism property: The maximum supported degree of parallelism for this account. + * + * @return the maxDegreeOfParallelism value. + */ + public Integer maxDegreeOfParallelism() { + return this.maxDegreeOfParallelism; + } + + /** + * Set the maxDegreeOfParallelism property: The maximum supported degree of parallelism for this account. + * + * @param maxDegreeOfParallelism the maxDegreeOfParallelism value to set. + * @return the DataLakeAnalyticsAccountProperties object itself. + */ + public DataLakeAnalyticsAccountProperties withMaxDegreeOfParallelism(Integer maxDegreeOfParallelism) { + this.maxDegreeOfParallelism = maxDegreeOfParallelism; + return this; + } + + /** + * Get the systemMaxDegreeOfParallelism property: The system defined maximum supported degree of parallelism for + * this account, which restricts the maximum value of parallelism the user can set for the account. + * + * @return the systemMaxDegreeOfParallelism value. + */ + public Integer systemMaxDegreeOfParallelism() { + return this.systemMaxDegreeOfParallelism; + } + + /** + * Get the maxDegreeOfParallelismPerJob property: The maximum supported degree of parallelism per job for this + * account. + * + * @return the maxDegreeOfParallelismPerJob value. + */ + public Integer maxDegreeOfParallelismPerJob() { + return this.maxDegreeOfParallelismPerJob; + } + + /** + * Set the maxDegreeOfParallelismPerJob property: The maximum supported degree of parallelism per job for this + * account. + * + * @param maxDegreeOfParallelismPerJob the maxDegreeOfParallelismPerJob value to set. + * @return the DataLakeAnalyticsAccountProperties object itself. + */ + public DataLakeAnalyticsAccountProperties withMaxDegreeOfParallelismPerJob(Integer maxDegreeOfParallelismPerJob) { + this.maxDegreeOfParallelismPerJob = maxDegreeOfParallelismPerJob; + return this; + } + + /** + * Get the minPriorityPerJob property: The minimum supported priority per job for this account. + * + * @return the minPriorityPerJob value. + */ + public Integer minPriorityPerJob() { + return this.minPriorityPerJob; + } + + /** + * Get the queryStoreRetention property: The number of days that job metadata is retained. + * + * @return the queryStoreRetention value. + */ + public Integer queryStoreRetention() { + return this.queryStoreRetention; + } + + /** + * Set the queryStoreRetention property: The number of days that job metadata is retained. + * + * @param queryStoreRetention the queryStoreRetention value to set. + * @return the DataLakeAnalyticsAccountProperties object itself. + */ + public DataLakeAnalyticsAccountProperties withQueryStoreRetention(Integer queryStoreRetention) { + this.queryStoreRetention = queryStoreRetention; + return this; + } + + /** + * Get the debugDataAccessLevel property: The current state of the DebugDataAccessLevel for this account. + * + * @return the debugDataAccessLevel value. + */ + public DebugDataAccessLevel debugDataAccessLevel() { + return this.debugDataAccessLevel; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dataLakeStoreAccounts() != null) { + dataLakeStoreAccounts().forEach(e -> e.validate()); + } + if (publicDataLakeStoreAccounts() != null) { + publicDataLakeStoreAccounts().forEach(e -> e.validate()); + } + if (storageAccounts() != null) { + storageAccounts().forEach(e -> e.validate()); + } + if (computePolicies() != null) { + computePolicies().forEach(e -> e.validate()); + } + if (hiveMetastores() != null) { + hiveMetastores().forEach(e -> e.validate()); + } + if (virtualNetworkRules() != null) { + virtualNetworkRules().forEach(e -> e.validate()); + } + if (firewallRules() != null) { + firewallRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeAnalyticsAccountPropertiesBasic.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeAnalyticsAccountPropertiesBasic.java new file mode 100644 index 000000000000..1ff5e9e415a2 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeAnalyticsAccountPropertiesBasic.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.UUID; + +/** The basic account specific properties that are associated with an underlying Data Lake Analytics account. */ +@Immutable +public class DataLakeAnalyticsAccountPropertiesBasic { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataLakeAnalyticsAccountPropertiesBasic.class); + + /* + * The unique identifier associated with this Data Lake Analytics account. + */ + @JsonProperty(value = "accountId", access = JsonProperty.Access.WRITE_ONLY) + private UUID accountId; + + /* + * The provisioning status of the Data Lake Analytics account. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private DataLakeAnalyticsAccountStatus provisioningState; + + /* + * The state of the Data Lake Analytics account. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private DataLakeAnalyticsAccountState state; + + /* + * The account creation time. + */ + @JsonProperty(value = "creationTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationTime; + + /* + * The account last modified time. + */ + @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTime; + + /* + * The full CName endpoint for this account. + */ + @JsonProperty(value = "endpoint", access = JsonProperty.Access.WRITE_ONLY) + private String endpoint; + + /** + * Get the accountId property: The unique identifier associated with this Data Lake Analytics account. + * + * @return the accountId value. + */ + public UUID accountId() { + return this.accountId; + } + + /** + * Get the provisioningState property: The provisioning status of the Data Lake Analytics account. + * + * @return the provisioningState value. + */ + public DataLakeAnalyticsAccountStatus provisioningState() { + return this.provisioningState; + } + + /** + * Get the state property: The state of the Data Lake Analytics account. + * + * @return the state value. + */ + public DataLakeAnalyticsAccountState state() { + return this.state; + } + + /** + * Get the creationTime property: The account creation time. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Get the lastModifiedTime property: The account last modified time. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get the endpoint property: The full CName endpoint for this account. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeAnalyticsAccountState.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeAnalyticsAccountState.java new file mode 100644 index 000000000000..386852b4859a --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeAnalyticsAccountState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for DataLakeAnalyticsAccountState. */ +public enum DataLakeAnalyticsAccountState { + /** Enum value Active. */ + ACTIVE("Active"), + + /** Enum value Suspended. */ + SUSPENDED("Suspended"); + + /** The actual serialized value for a DataLakeAnalyticsAccountState instance. */ + private final String value; + + DataLakeAnalyticsAccountState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DataLakeAnalyticsAccountState instance. + * + * @param value the serialized value to parse. + * @return the parsed DataLakeAnalyticsAccountState object, or null if unable to parse. + */ + @JsonCreator + public static DataLakeAnalyticsAccountState fromString(String value) { + DataLakeAnalyticsAccountState[] items = DataLakeAnalyticsAccountState.values(); + for (DataLakeAnalyticsAccountState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeAnalyticsAccountStatus.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeAnalyticsAccountStatus.java new file mode 100644 index 000000000000..1a8afdb1d627 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeAnalyticsAccountStatus.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.datalakeanalytics.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for DataLakeAnalyticsAccountStatus. */ +public enum DataLakeAnalyticsAccountStatus { + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value Creating. */ + CREATING("Creating"), + + /** Enum value Running. */ + RUNNING("Running"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Patching. */ + PATCHING("Patching"), + + /** Enum value Suspending. */ + SUSPENDING("Suspending"), + + /** Enum value Resuming. */ + RESUMING("Resuming"), + + /** Enum value Deleting. */ + DELETING("Deleting"), + + /** Enum value Deleted. */ + DELETED("Deleted"), + + /** Enum value Undeleting. */ + UNDELETING("Undeleting"), + + /** Enum value Canceled. */ + CANCELED("Canceled"); + + /** The actual serialized value for a DataLakeAnalyticsAccountStatus instance. */ + private final String value; + + DataLakeAnalyticsAccountStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DataLakeAnalyticsAccountStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed DataLakeAnalyticsAccountStatus object, or null if unable to parse. + */ + @JsonCreator + public static DataLakeAnalyticsAccountStatus fromString(String value) { + DataLakeAnalyticsAccountStatus[] items = DataLakeAnalyticsAccountStatus.values(); + for (DataLakeAnalyticsAccountStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeStoreAccountInformation.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeStoreAccountInformation.java new file mode 100644 index 000000000000..0b8669cad9e9 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeStoreAccountInformation.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.datalakeanalytics.models; + +import com.azure.resourcemanager.datalakeanalytics.fluent.models.DataLakeStoreAccountInformationInner; + +/** An immutable client-side representation of DataLakeStoreAccountInformation. */ +public interface DataLakeStoreAccountInformation { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the suffix property: The optional suffix for the Data Lake Store account. + * + * @return the suffix value. + */ + String suffix(); + + /** + * Gets the name property: The resource name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the inner com.azure.resourcemanager.datalakeanalytics.fluent.models.DataLakeStoreAccountInformationInner + * object. + * + * @return the inner object. + */ + DataLakeStoreAccountInformationInner innerModel(); +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeStoreAccountInformationListResult.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeStoreAccountInformationListResult.java new file mode 100644 index 000000000000..99ca6eef3cf8 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeStoreAccountInformationListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.DataLakeStoreAccountInformationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Data Lake Store account list information. */ +@Immutable +public final class DataLakeStoreAccountInformationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataLakeStoreAccountInformationListResult.class); + + /* + * The results of the list operation. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The results of the list operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link (url) to the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeStoreAccounts.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeStoreAccounts.java new file mode 100644 index 000000000000..a47ddf81572d --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DataLakeStoreAccounts.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.datalakeanalytics.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 DataLakeStoreAccounts. */ +public interface DataLakeStoreAccounts { + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response + * includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. + */ + PagedIterable listByAccount(String resourceGroupName, String accountName); + + /** + * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response + * includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param filter OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. + */ + PagedIterable listByAccount( + String resourceGroupName, + String accountName, + String filter, + Integer top, + Integer skip, + String select, + String orderby, + Boolean count, + Context context); + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 add(String resourceGroupName, String accountName, String dataLakeStoreAccountName); + + /** + * Updates the specified Data Lake Analytics account to include the additional Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to add. + * @param parameters The details of the Data Lake Store account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response addWithResponse( + String resourceGroupName, + String accountName, + String dataLakeStoreAccountName, + AddDataLakeStoreParameters parameters, + Context context); + + /** + * Gets the specified Data Lake Store account details in the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Store account details in the specified Data Lake Analytics account. + */ + DataLakeStoreAccountInformation get(String resourceGroupName, String accountName, String dataLakeStoreAccountName); + + /** + * Gets the specified Data Lake Store account details in the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Store account details in the specified Data Lake Analytics account. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String dataLakeStoreAccountName, Context context); + + /** + * Updates the Data Lake Analytics account specified to remove the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String dataLakeStoreAccountName); + + /** + * Updates the Data Lake Analytics account specified to remove the specified Data Lake Store account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param dataLakeStoreAccountName The name of the Data Lake Store account to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String accountName, String dataLakeStoreAccountName, Context context); +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DebugDataAccessLevel.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DebugDataAccessLevel.java new file mode 100644 index 000000000000..4b1667f21434 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/DebugDataAccessLevel.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.datalakeanalytics.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for DebugDataAccessLevel. */ +public enum DebugDataAccessLevel { + /** Enum value All. */ + ALL("All"), + + /** Enum value Customer. */ + CUSTOMER("Customer"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a DebugDataAccessLevel instance. */ + private final String value; + + DebugDataAccessLevel(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DebugDataAccessLevel instance. + * + * @param value the serialized value to parse. + * @return the parsed DebugDataAccessLevel object, or null if unable to parse. + */ + @JsonCreator + public static DebugDataAccessLevel fromString(String value) { + DebugDataAccessLevel[] items = DebugDataAccessLevel.values(); + for (DebugDataAccessLevel item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/ErrorAdditionalInfo.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/ErrorAdditionalInfo.java new file mode 100644 index 000000000000..56256d94655e --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/ErrorAdditionalInfo.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.datalakeanalytics.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The resource management error additional info. */ +@Immutable +public final class ErrorAdditionalInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ErrorAdditionalInfo.class); + + /* + * The additional info type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The additional info. + */ + @JsonProperty(value = "info", access = JsonProperty.Access.WRITE_ONLY) + private Object info; + + /** + * Get the type property: The additional info type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the info property: The additional info. + * + * @return the info value. + */ + public Object info() { + return this.info; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/FirewallAllowAzureIpsState.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/FirewallAllowAzureIpsState.java new file mode 100644 index 000000000000..f7d9cbf9e84f --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/FirewallAllowAzureIpsState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for FirewallAllowAzureIpsState. */ +public enum FirewallAllowAzureIpsState { + /** Enum value Enabled. */ + ENABLED("Enabled"), + + /** Enum value Disabled. */ + DISABLED("Disabled"); + + /** The actual serialized value for a FirewallAllowAzureIpsState instance. */ + private final String value; + + FirewallAllowAzureIpsState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a FirewallAllowAzureIpsState instance. + * + * @param value the serialized value to parse. + * @return the parsed FirewallAllowAzureIpsState object, or null if unable to parse. + */ + @JsonCreator + public static FirewallAllowAzureIpsState fromString(String value) { + FirewallAllowAzureIpsState[] items = FirewallAllowAzureIpsState.values(); + for (FirewallAllowAzureIpsState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/FirewallRule.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/FirewallRule.java new file mode 100644 index 000000000000..f666c2e06a61 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/FirewallRule.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.FirewallRuleInner; + +/** An immutable client-side representation of FirewallRule. */ +public interface FirewallRule { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the startIpAddress property: The start IP address for the firewall rule. This can be either ipv4 or ipv6. + * Start and End should be in the same protocol. + * + * @return the startIpAddress value. + */ + String startIpAddress(); + + /** + * Gets the endIpAddress property: The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start + * and End should be in the same protocol. + * + * @return the endIpAddress value. + */ + String endIpAddress(); + + /** + * Gets the name property: The resource name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the inner com.azure.resourcemanager.datalakeanalytics.fluent.models.FirewallRuleInner object. + * + * @return the inner object. + */ + FirewallRuleInner innerModel(); + + /** The entirety of the FirewallRule definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithStartIpAddress, + DefinitionStages.WithEndIpAddress, + DefinitionStages.WithCreate { + } + /** The FirewallRule definition stages. */ + interface DefinitionStages { + /** The first stage of the FirewallRule definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the FirewallRule definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @return the next definition stage. + */ + WithStartIpAddress withExistingAccount(String resourceGroupName, String accountName); + } + /** The stage of the FirewallRule definition allowing to specify startIpAddress. */ + interface WithStartIpAddress { + /** + * Specifies the startIpAddress property: The start IP address for the firewall rule. This can be either + * ipv4 or ipv6. Start and End should be in the same protocol.. + * + * @param startIpAddress The start IP address for the firewall rule. This can be either ipv4 or ipv6. Start + * and End should be in the same protocol. + * @return the next definition stage. + */ + WithEndIpAddress withStartIpAddress(String startIpAddress); + } + /** The stage of the FirewallRule definition allowing to specify endIpAddress. */ + interface WithEndIpAddress { + /** + * Specifies the endIpAddress property: The end IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol.. + * + * @param endIpAddress The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and + * End should be in the same protocol. + * @return the next definition stage. + */ + WithCreate withEndIpAddress(String endIpAddress); + } + /** + * The stage of the FirewallRule definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + FirewallRule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FirewallRule create(Context context); + } + } + /** + * Begins update for the FirewallRule resource. + * + * @return the stage of resource update. + */ + FirewallRule.Update update(); + + /** The template for FirewallRule update. */ + interface Update extends UpdateStages.WithStartIpAddress, UpdateStages.WithEndIpAddress { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FirewallRule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FirewallRule apply(Context context); + } + /** The FirewallRule update stages. */ + interface UpdateStages { + /** The stage of the FirewallRule update allowing to specify startIpAddress. */ + interface WithStartIpAddress { + /** + * Specifies the startIpAddress property: The start IP address for the firewall rule. This can be either + * ipv4 or ipv6. Start and End should be in the same protocol.. + * + * @param startIpAddress The start IP address for the firewall rule. This can be either ipv4 or ipv6. Start + * and End should be in the same protocol. + * @return the next definition stage. + */ + Update withStartIpAddress(String startIpAddress); + } + /** The stage of the FirewallRule update allowing to specify endIpAddress. */ + interface WithEndIpAddress { + /** + * Specifies the endIpAddress property: The end IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol.. + * + * @param endIpAddress The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start and + * End should be in the same protocol. + * @return the next definition stage. + */ + Update withEndIpAddress(String endIpAddress); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FirewallRule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FirewallRule refresh(Context context); +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/FirewallRuleListResult.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/FirewallRuleListResult.java new file mode 100644 index 000000000000..0a75685766a1 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/FirewallRuleListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.FirewallRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Data Lake Analytics firewall rule list information. */ +@Immutable +public final class FirewallRuleListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FirewallRuleListResult.class); + + /* + * The results of the list operation. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The results of the list operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link (url) to the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/FirewallRules.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/FirewallRules.java new file mode 100644 index 000000000000..66ac3e57b688 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/FirewallRules.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.datalakeanalytics.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 FirewallRules. */ +public interface FirewallRules { + /** + * Lists the Data Lake Analytics firewall rules within the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics firewall rule list information. + */ + PagedIterable listByAccount(String resourceGroupName, String accountName); + + /** + * Lists the Data Lake Analytics firewall rules within the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Lake Analytics firewall rule list information. + */ + PagedIterable listByAccount(String resourceGroupName, String accountName, Context context); + + /** + * Gets the specified Data Lake Analytics firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Analytics firewall rule. + */ + FirewallRule get(String resourceGroupName, String accountName, String firewallRuleName); + + /** + * Gets the specified Data Lake Analytics firewall rule. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Analytics firewall rule. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String firewallRuleName, Context context); + + /** + * Deletes the specified firewall rule from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String firewallRuleName); + + /** + * Deletes the specified firewall rule from the specified Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param firewallRuleName The name of the firewall rule to delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String accountName, String firewallRuleName, Context context); + + /** + * Gets the specified Data Lake Analytics firewall rule. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Analytics firewall rule. + */ + FirewallRule getById(String id); + + /** + * Gets the specified Data Lake Analytics firewall rule. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Data Lake Analytics firewall rule. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified firewall rule from the specified Data Lake Analytics account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified firewall rule from the specified Data Lake Analytics account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new FirewallRule resource. + * + * @param name resource name. + * @return the first stage of the new FirewallRule definition. + */ + FirewallRule.DefinitionStages.Blank define(String name); +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/FirewallState.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/FirewallState.java new file mode 100644 index 000000000000..58edbc23bffe --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/FirewallState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for FirewallState. */ +public enum FirewallState { + /** Enum value Enabled. */ + ENABLED("Enabled"), + + /** Enum value Disabled. */ + DISABLED("Disabled"); + + /** The actual serialized value for a FirewallState instance. */ + private final String value; + + FirewallState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a FirewallState instance. + * + * @param value the serialized value to parse. + * @return the parsed FirewallState object, or null if unable to parse. + */ + @JsonCreator + public static FirewallState fromString(String value) { + FirewallState[] items = FirewallState.values(); + for (FirewallState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/HiveMetastore.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/HiveMetastore.java new file mode 100644 index 000000000000..cb138091cb80 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/HiveMetastore.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The HiveMetastore model. */ +@JsonFlatten +@Immutable +public class HiveMetastore extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HiveMetastore.class); + + /* + * The serverUri for the Hive MetaStore + */ + @JsonProperty(value = "properties.serverUri", access = JsonProperty.Access.WRITE_ONLY) + private String serverUri; + + /* + * The databaseName for the Hive MetaStore + */ + @JsonProperty(value = "properties.databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /* + * The runtimeVersion for the Hive MetaStore + */ + @JsonProperty(value = "properties.runtimeVersion", access = JsonProperty.Access.WRITE_ONLY) + private String runtimeVersion; + + /* + * The userName for the Hive MetaStore + */ + @JsonProperty(value = "properties.userName", access = JsonProperty.Access.WRITE_ONLY) + private String username; + + /* + * The password for the Hive MetaStore + */ + @JsonProperty(value = "properties.password", access = JsonProperty.Access.WRITE_ONLY) + private String password; + + /* + * The current state of the NestedResource + */ + @JsonProperty(value = "properties.nestedResourceProvisioningState", access = JsonProperty.Access.WRITE_ONLY) + private NestedResourceProvisioningState nestedResourceProvisioningState; + + /* + * The resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the serverUri property: The serverUri for the Hive MetaStore. + * + * @return the serverUri value. + */ + public String serverUri() { + return this.serverUri; + } + + /** + * Get the databaseName property: The databaseName for the Hive MetaStore. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get the runtimeVersion property: The runtimeVersion for the Hive MetaStore. + * + * @return the runtimeVersion value. + */ + public String runtimeVersion() { + return this.runtimeVersion; + } + + /** + * Get the username property: The userName for the Hive MetaStore. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Get the password property: The password for the Hive MetaStore. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Get the nestedResourceProvisioningState property: The current state of the NestedResource. + * + * @return the nestedResourceProvisioningState value. + */ + public NestedResourceProvisioningState nestedResourceProvisioningState() { + return this.nestedResourceProvisioningState; + } + + /** + * Get the name property: The resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** {@inheritDoc} */ + @Override + public HiveMetastore withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/Locations.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/Locations.java new file mode 100644 index 000000000000..5242a7d08a0c --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/Locations.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.datalakeanalytics.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Locations. */ +public interface Locations { + /** + * Gets subscription-level properties and limits for Data Lake Analytics specified by resource location. + * + * @param location The resource location without whitespace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription-level properties and limits for Data Lake Analytics specified by resource location. + */ + CapabilityInformation getCapability(String location); + + /** + * Gets subscription-level properties and limits for Data Lake Analytics specified by resource location. + * + * @param location The resource location without whitespace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription-level properties and limits for Data Lake Analytics specified by resource location. + */ + Response getCapabilityWithResponse(String location, Context context); +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/NameAvailabilityInformation.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/NameAvailabilityInformation.java new file mode 100644 index 000000000000..2514437d8630 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/NameAvailabilityInformation.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.resourcemanager.datalakeanalytics.fluent.models.NameAvailabilityInformationInner; + +/** An immutable client-side representation of NameAvailabilityInformation. */ +public interface NameAvailabilityInformation { + /** + * Gets the nameAvailable property: The Boolean value of true or false to indicate whether the Data Lake Analytics + * account name is available or not. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the reason property: The reason why the Data Lake Analytics account name is not available, if nameAvailable + * is false. + * + * @return the reason value. + */ + String reason(); + + /** + * Gets the message property: The message describing why the Data Lake Analytics account name is not available, if + * nameAvailable is false. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.datalakeanalytics.fluent.models.NameAvailabilityInformationInner object. + * + * @return the inner object. + */ + NameAvailabilityInformationInner innerModel(); +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/NestedResourceProvisioningState.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/NestedResourceProvisioningState.java new file mode 100644 index 000000000000..bbb98595f826 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/NestedResourceProvisioningState.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.datalakeanalytics.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for NestedResourceProvisioningState. */ +public enum NestedResourceProvisioningState { + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Canceled. */ + CANCELED("Canceled"), + + /** Enum value Failed. */ + FAILED("Failed"); + + /** The actual serialized value for a NestedResourceProvisioningState instance. */ + private final String value; + + NestedResourceProvisioningState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a NestedResourceProvisioningState instance. + * + * @param value the serialized value to parse. + * @return the parsed NestedResourceProvisioningState object, or null if unable to parse. + */ + @JsonCreator + public static NestedResourceProvisioningState fromString(String value) { + NestedResourceProvisioningState[] items = NestedResourceProvisioningState.values(); + for (NestedResourceProvisioningState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/Operation.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/Operation.java new file mode 100644 index 000000000000..da9877f6038a --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/Operation.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An available operation for Data Lake Analytics. */ +@Immutable +public final class Operation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Operation.class); + + /* + * The name of the operation. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The display information for the operation. + */ + @JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY) + private OperationDisplay display; + + /* + * The OperationMetaPropertyInfo for the operation. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private OperationMetaPropertyInfo properties; + + /* + * The intended executor of the operation. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private OperationOrigin origin; + + /** + * Get the name property: The name of the operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the display property: The display information for the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Get the properties property: The OperationMetaPropertyInfo for the operation. + * + * @return the properties value. + */ + public OperationMetaPropertyInfo properties() { + return this.properties; + } + + /** + * Get the origin property: The intended executor of the operation. + * + * @return the origin value. + */ + public OperationOrigin origin() { + return this.origin; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/OperationDisplay.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/OperationDisplay.java new file mode 100644 index 000000000000..917b84c85b6c --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/OperationDisplay.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.datalakeanalytics.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The display information for a particular operation. */ +@Immutable +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * The resource provider of the operation. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * The resource type of the operation. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * A friendly name of the operation. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * A friendly description of the operation. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get the provider property: The resource provider of the operation. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The resource type of the operation. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: A friendly name of the operation. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: A friendly description of the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/OperationListResult.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/OperationListResult.java new file mode 100644 index 000000000000..c3cfb62ffe24 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/OperationListResult.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.resourcemanager.datalakeanalytics.fluent.models.OperationListResultInner; +import java.util.List; + +/** An immutable client-side representation of OperationListResult. */ +public interface OperationListResult { + /** + * Gets the value property: The results of the list operation. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The link (url) to the next page of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.datalakeanalytics.fluent.models.OperationListResultInner object. + * + * @return the inner object. + */ + OperationListResultInner innerModel(); +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/OperationMetaLogSpecification.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/OperationMetaLogSpecification.java new file mode 100644 index 000000000000..303fe8719ee3 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/OperationMetaLogSpecification.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The OperationMetaLogSpecification model. */ +@Fluent +public final class OperationMetaLogSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationMetaLogSpecification.class); + + /* + * The name for OperationMetaLogSpecification. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The displayName for OperationMetaLogSpecification. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The blobDuration for OperationMetaLogSpecification. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get the name property: The name for OperationMetaLogSpecification. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name for OperationMetaLogSpecification. + * + * @param name the name value to set. + * @return the OperationMetaLogSpecification object itself. + */ + public OperationMetaLogSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: The displayName for OperationMetaLogSpecification. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The displayName for OperationMetaLogSpecification. + * + * @param displayName the displayName value to set. + * @return the OperationMetaLogSpecification object itself. + */ + public OperationMetaLogSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the blobDuration property: The blobDuration for OperationMetaLogSpecification. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set the blobDuration property: The blobDuration for OperationMetaLogSpecification. + * + * @param blobDuration the blobDuration value to set. + * @return the OperationMetaLogSpecification object itself. + */ + public OperationMetaLogSpecification withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/OperationMetaMetricAvailabilitiesSpecification.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/OperationMetaMetricAvailabilitiesSpecification.java new file mode 100644 index 000000000000..d25c4f9edaf0 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/OperationMetaMetricAvailabilitiesSpecification.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The OperationMetaMetricAvailabilitiesSpecification model. */ +@Fluent +public final class OperationMetaMetricAvailabilitiesSpecification { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(OperationMetaMetricAvailabilitiesSpecification.class); + + /* + * The timegrain for OperationMetaMetricAvailabilitiesSpecification. + */ + @JsonProperty(value = "timeGrain") + private String timeGrain; + + /* + * The blobDuration for OperationMetaMetricAvailabilitiesSpecification. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get the timeGrain property: The timegrain for OperationMetaMetricAvailabilitiesSpecification. + * + * @return the timeGrain value. + */ + public String timeGrain() { + return this.timeGrain; + } + + /** + * Set the timeGrain property: The timegrain for OperationMetaMetricAvailabilitiesSpecification. + * + * @param timeGrain the timeGrain value to set. + * @return the OperationMetaMetricAvailabilitiesSpecification object itself. + */ + public OperationMetaMetricAvailabilitiesSpecification withTimeGrain(String timeGrain) { + this.timeGrain = timeGrain; + return this; + } + + /** + * Get the blobDuration property: The blobDuration for OperationMetaMetricAvailabilitiesSpecification. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set the blobDuration property: The blobDuration for OperationMetaMetricAvailabilitiesSpecification. + * + * @param blobDuration the blobDuration value to set. + * @return the OperationMetaMetricAvailabilitiesSpecification object itself. + */ + public OperationMetaMetricAvailabilitiesSpecification withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/OperationMetaMetricSpecification.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/OperationMetaMetricSpecification.java new file mode 100644 index 000000000000..4b90cb4d87ec --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/OperationMetaMetricSpecification.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The OperationMetaMetricSpecification model. */ +@Fluent +public final class OperationMetaMetricSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationMetaMetricSpecification.class); + + /* + * The name for OperationMetaMetricSpecification. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The displayName for OperationMetaMetricSpecification. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /* + * The displayName for OperationMetaMetricSpecification. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The unit for OperationMetaMetricSpecification. + */ + @JsonProperty(value = "unit") + private String unit; + + /* + * The aggregationType for OperationMetaMetricSpecification. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /* + * The availabilities for OperationMetaMetricSpecification. + */ + @JsonProperty(value = "availabilities") + private List availabilities; + + /** + * Get the name property: The name for OperationMetaMetricSpecification. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name for OperationMetaMetricSpecification. + * + * @param name the name value to set. + * @return the OperationMetaMetricSpecification object itself. + */ + public OperationMetaMetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayDescription property: The displayName for OperationMetaMetricSpecification. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: The displayName for OperationMetaMetricSpecification. + * + * @param displayDescription the displayDescription value to set. + * @return the OperationMetaMetricSpecification object itself. + */ + public OperationMetaMetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get the displayName property: The displayName for OperationMetaMetricSpecification. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The displayName for OperationMetaMetricSpecification. + * + * @param displayName the displayName value to set. + * @return the OperationMetaMetricSpecification object itself. + */ + public OperationMetaMetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the unit property: The unit for OperationMetaMetricSpecification. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: The unit for OperationMetaMetricSpecification. + * + * @param unit the unit value to set. + * @return the OperationMetaMetricSpecification object itself. + */ + public OperationMetaMetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the aggregationType property: The aggregationType for OperationMetaMetricSpecification. + * + * @return the aggregationType value. + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set the aggregationType property: The aggregationType for OperationMetaMetricSpecification. + * + * @param aggregationType the aggregationType value to set. + * @return the OperationMetaMetricSpecification object itself. + */ + public OperationMetaMetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get the availabilities property: The availabilities for OperationMetaMetricSpecification. + * + * @return the availabilities value. + */ + public List availabilities() { + return this.availabilities; + } + + /** + * Set the availabilities property: The availabilities for OperationMetaMetricSpecification. + * + * @param availabilities the availabilities value to set. + * @return the OperationMetaMetricSpecification object itself. + */ + public OperationMetaMetricSpecification withAvailabilities( + List availabilities) { + this.availabilities = availabilities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (availabilities() != null) { + availabilities().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/OperationMetaPropertyInfo.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/OperationMetaPropertyInfo.java new file mode 100644 index 000000000000..7a5a74f72fd8 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/OperationMetaPropertyInfo.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.datalakeanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The OperationMetaPropertyInfo model. */ +@Fluent +public final class OperationMetaPropertyInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationMetaPropertyInfo.class); + + /* + * The operations OperationMetaServiceSpecification. + */ + @JsonProperty(value = "serviceSpecification") + private OperationMetaServiceSpecification serviceSpecification; + + /** + * Get the serviceSpecification property: The operations OperationMetaServiceSpecification. + * + * @return the serviceSpecification value. + */ + public OperationMetaServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the serviceSpecification property: The operations OperationMetaServiceSpecification. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the OperationMetaPropertyInfo object itself. + */ + public OperationMetaPropertyInfo withServiceSpecification(OperationMetaServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/OperationMetaServiceSpecification.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/OperationMetaServiceSpecification.java new file mode 100644 index 000000000000..aba32fd59838 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/OperationMetaServiceSpecification.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The OperationMetaServiceSpecification model. */ +@Fluent +public final class OperationMetaServiceSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationMetaServiceSpecification.class); + + /* + * The metricSpecifications for OperationMetaServiceSpecification. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /* + * The logSpecifications for OperationMetaServiceSpecification. + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /** + * Get the metricSpecifications property: The metricSpecifications for OperationMetaServiceSpecification. + * + * @return the metricSpecifications value. + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set the metricSpecifications property: The metricSpecifications for OperationMetaServiceSpecification. + * + * @param metricSpecifications the metricSpecifications value to set. + * @return the OperationMetaServiceSpecification object itself. + */ + public OperationMetaServiceSpecification withMetricSpecifications( + List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + + /** + * Get the logSpecifications property: The logSpecifications for OperationMetaServiceSpecification. + * + * @return the logSpecifications value. + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set the logSpecifications property: The logSpecifications for OperationMetaServiceSpecification. + * + * @param logSpecifications the logSpecifications value to set. + * @return the OperationMetaServiceSpecification object itself. + */ + public OperationMetaServiceSpecification withLogSpecifications( + List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metricSpecifications() != null) { + metricSpecifications().forEach(e -> e.validate()); + } + if (logSpecifications() != null) { + logSpecifications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/OperationOrigin.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/OperationOrigin.java new file mode 100644 index 000000000000..35d49d1c07d2 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/OperationOrigin.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OperationOrigin. */ +public final class OperationOrigin extends ExpandableStringEnum { + /** Static value user for OperationOrigin. */ + public static final OperationOrigin USER = fromString("user"); + + /** Static value system for OperationOrigin. */ + public static final OperationOrigin SYSTEM = fromString("system"); + + /** Static value user,system for OperationOrigin. */ + public static final OperationOrigin USER_SYSTEM = fromString("user,system"); + + /** + * Creates or finds a OperationOrigin from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationOrigin. + */ + @JsonCreator + public static OperationOrigin fromString(String name) { + return fromString(name, OperationOrigin.class); + } + + /** @return known OperationOrigin values. */ + public static Collection values() { + return values(OperationOrigin.class); + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/Operations.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/Operations.java new file mode 100644 index 000000000000..d7343b622abc --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/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.datalakeanalytics.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available Data Lake Analytics REST API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available operations for Data Lake Analytics. + */ + OperationListResult list(); + + /** + * Lists all of the available Data Lake Analytics REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available operations for Data Lake Analytics. + */ + Response listWithResponse(Context context); +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/SasTokenInformation.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/SasTokenInformation.java new file mode 100644 index 000000000000..04bc17f91d9d --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/SasTokenInformation.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.resourcemanager.datalakeanalytics.fluent.models.SasTokenInformationInner; + +/** An immutable client-side representation of SasTokenInformation. */ +public interface SasTokenInformation { + /** + * Gets the accessToken property: The access token for the associated Azure Storage Container. + * + * @return the accessToken value. + */ + String accessToken(); + + /** + * Gets the inner com.azure.resourcemanager.datalakeanalytics.fluent.models.SasTokenInformationInner object. + * + * @return the inner object. + */ + SasTokenInformationInner innerModel(); +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/SasTokenInformationListResult.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/SasTokenInformationListResult.java new file mode 100644 index 000000000000..9b7380c0195a --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/SasTokenInformationListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.SasTokenInformationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The SAS response that contains the storage account, container and associated SAS token for connection use. */ +@Immutable +public final class SasTokenInformationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SasTokenInformationListResult.class); + + /* + * The results of the list operation. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The results of the list operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link (url) to the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/StorageAccountInformation.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/StorageAccountInformation.java new file mode 100644 index 000000000000..57487810663d --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/StorageAccountInformation.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.datalakeanalytics.models; + +import com.azure.resourcemanager.datalakeanalytics.fluent.models.StorageAccountInformationInner; + +/** An immutable client-side representation of StorageAccountInformation. */ +public interface StorageAccountInformation { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the suffix property: The optional suffix for the storage account. + * + * @return the suffix value. + */ + String suffix(); + + /** + * Gets the name property: The resource name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the inner com.azure.resourcemanager.datalakeanalytics.fluent.models.StorageAccountInformationInner object. + * + * @return the inner object. + */ + StorageAccountInformationInner innerModel(); +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/StorageAccountInformationListResult.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/StorageAccountInformationListResult.java new file mode 100644 index 000000000000..dccc2295cc60 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/StorageAccountInformationListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.StorageAccountInformationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Azure Storage account list information. */ +@Immutable +public final class StorageAccountInformationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountInformationListResult.class); + + /* + * The results of the list operation. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The results of the list operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link (url) to the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/StorageAccounts.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/StorageAccounts.java new file mode 100644 index 000000000000..3852afc45fd5 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/StorageAccounts.java @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of StorageAccounts. */ +public interface StorageAccounts { + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The + * response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. + */ + PagedIterable listByAccount(String resourceGroupName, String accountName); + + /** + * Gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. The + * response includes a link to the next page, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param filter The OData filter. Optional. + * @param top The number of items to return. Optional. + * @param skip The number of items to skip over before returning elements. Optional. + * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. + * Categories?$select=CategoryName,Description. Optional. + * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or + * "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. + * Optional. + * @param count The Boolean value of true or false to request a count of the matching resources included with the + * resources in the response, e.g. Categories?$count=true. Optional. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the first page of Azure Storage accounts, if any, linked to the specified Data Lake Analytics account. + */ + PagedIterable listByAccount( + String resourceGroupName, + String accountName, + String filter, + Integer top, + Integer skip, + String select, + String orderby, + Boolean count, + Context context); + + /** + * Updates the specified Data Lake Analytics account to add an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to add. + * @param parameters The parameters containing the access key and optional suffix for the Azure Storage Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void add( + String resourceGroupName, + String accountName, + String storageAccountName, + AddStorageAccountParameters parameters); + + /** + * Updates the specified Data Lake Analytics account to add an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to add. + * @param parameters The parameters containing the access key and optional suffix for the Azure Storage Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response addWithResponse( + String resourceGroupName, + String accountName, + String storageAccountName, + AddStorageAccountParameters parameters, + Context context); + + /** + * Gets the specified Azure Storage account linked to the given Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account for which to retrieve the details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Storage account linked to the given Data Lake Analytics account. + */ + StorageAccountInformation get(String resourceGroupName, String accountName, String storageAccountName); + + /** + * Gets the specified Azure Storage account linked to the given Data Lake Analytics account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account for which to retrieve the details. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Storage account linked to the given Data Lake Analytics account. + */ + Response getWithResponse( + String resourceGroupName, String accountName, String storageAccountName, Context context); + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key + * and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The Azure Storage account to modify. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 update(String resourceGroupName, String accountName, String storageAccountName); + + /** + * Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key + * and/or suffix. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The Azure Storage account to modify. + * @param parameters The parameters containing the access key and suffix to update the storage account with, if any. + * Passing nothing results in no change. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response updateWithResponse( + String resourceGroupName, + String accountName, + String storageAccountName, + UpdateStorageAccountParameters parameters, + Context context); + + /** + * Updates the specified Data Lake Analytics account to remove an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String storageAccountName); + + /** + * Updates the specified Data Lake Analytics account to remove an Azure Storage account. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure Storage account to remove. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String accountName, String storageAccountName, Context context); + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage + * account combination. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to list blob containers. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of blob containers associated with the storage account attached to the Data Lake Analytics + * account. + */ + PagedIterable listStorageContainers( + String resourceGroupName, String accountName, String storageAccountName); + + /** + * Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage + * account combination. The response includes a link to the next page of results, if any. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to list blob containers. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of blob containers associated with the storage account attached to the Data Lake Analytics + * account. + */ + PagedIterable listStorageContainers( + String resourceGroupName, String accountName, String storageAccountName, Context context); + + /** + * Gets the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage + * accounts. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to retrieve the blob container. + * @param containerName The name of the Azure storage container to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage + * accounts. + */ + StorageContainer getStorageContainer( + String resourceGroupName, String accountName, String storageAccountName, String containerName); + + /** + * Gets the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage + * accounts. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account from which to retrieve the blob container. + * @param containerName The name of the Azure storage container to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure Storage container associated with the given Data Lake Analytics and Azure Storage + * accounts. + */ + Response getStorageContainerWithResponse( + String resourceGroupName, String accountName, String storageAccountName, String containerName, Context context); + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container + * combination. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account for which the SAS token is being requested. + * @param containerName The name of the Azure storage container for which the SAS token is being requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container + * combination. + */ + PagedIterable listSasTokens( + String resourceGroupName, String accountName, String storageAccountName, String containerName); + + /** + * Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container + * combination. + * + * @param resourceGroupName The name of the Azure resource group. + * @param accountName The name of the Data Lake Analytics account. + * @param storageAccountName The name of the Azure storage account for which the SAS token is being requested. + * @param containerName The name of the Azure storage container for which the SAS token is being requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container + * combination. + */ + PagedIterable listSasTokens( + String resourceGroupName, String accountName, String storageAccountName, String containerName, Context context); +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/StorageContainer.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/StorageContainer.java new file mode 100644 index 000000000000..1dc466dd7b4a --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/StorageContainer.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.datalakeanalytics.models; + +import com.azure.resourcemanager.datalakeanalytics.fluent.models.StorageContainerInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of StorageContainer. */ +public interface StorageContainer { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the lastModifiedTime property: The last modified time of the blob container. + * + * @return the lastModifiedTime value. + */ + OffsetDateTime lastModifiedTime(); + + /** + * Gets the name property: The resource name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the inner com.azure.resourcemanager.datalakeanalytics.fluent.models.StorageContainerInner object. + * + * @return the inner object. + */ + StorageContainerInner innerModel(); +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/StorageContainerListResult.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/StorageContainerListResult.java new file mode 100644 index 000000000000..57f8134961bb --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/StorageContainerListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datalakeanalytics.fluent.models.StorageContainerInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of blob containers associated with the storage account attached to the Data Lake Analytics account. */ +@Immutable +public final class StorageContainerListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageContainerListResult.class); + + /* + * The results of the list operation. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The results of the list operation. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link (url) to the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/SubscriptionState.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/SubscriptionState.java new file mode 100644 index 000000000000..0e6110b2c662 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/SubscriptionState.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SubscriptionState. */ +public final class SubscriptionState extends ExpandableStringEnum { + /** Static value Registered for SubscriptionState. */ + public static final SubscriptionState REGISTERED = fromString("Registered"); + + /** Static value Suspended for SubscriptionState. */ + public static final SubscriptionState SUSPENDED = fromString("Suspended"); + + /** Static value Deleted for SubscriptionState. */ + public static final SubscriptionState DELETED = fromString("Deleted"); + + /** Static value Unregistered for SubscriptionState. */ + public static final SubscriptionState UNREGISTERED = fromString("Unregistered"); + + /** Static value Warned for SubscriptionState. */ + public static final SubscriptionState WARNED = fromString("Warned"); + + /** + * Creates or finds a SubscriptionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding SubscriptionState. + */ + @JsonCreator + public static SubscriptionState fromString(String name) { + return fromString(name, SubscriptionState.class); + } + + /** @return known SubscriptionState values. */ + public static Collection values() { + return values(SubscriptionState.class); + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/TierType.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/TierType.java new file mode 100644 index 000000000000..41986cc12a9c --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/TierType.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for TierType. */ +public enum TierType { + /** Enum value Consumption. */ + CONSUMPTION("Consumption"), + + /** Enum value Commitment_100AUHours. */ + COMMITMENT_100AUHOURS("Commitment_100AUHours"), + + /** Enum value Commitment_500AUHours. */ + COMMITMENT_500AUHOURS("Commitment_500AUHours"), + + /** Enum value Commitment_1000AUHours. */ + COMMITMENT_1000AUHOURS("Commitment_1000AUHours"), + + /** Enum value Commitment_5000AUHours. */ + COMMITMENT_5000AUHOURS("Commitment_5000AUHours"), + + /** Enum value Commitment_10000AUHours. */ + COMMITMENT_10000AUHOURS("Commitment_10000AUHours"), + + /** Enum value Commitment_50000AUHours. */ + COMMITMENT_50000AUHOURS("Commitment_50000AUHours"), + + /** Enum value Commitment_100000AUHours. */ + COMMITMENT_100000AUHOURS("Commitment_100000AUHours"), + + /** Enum value Commitment_500000AUHours. */ + COMMITMENT_500000AUHOURS("Commitment_500000AUHours"); + + /** The actual serialized value for a TierType instance. */ + private final String value; + + TierType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a TierType instance. + * + * @param value the serialized value to parse. + * @return the parsed TierType object, or null if unable to parse. + */ + @JsonCreator + public static TierType fromString(String value) { + TierType[] items = TierType.values(); + for (TierType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/UpdateComputePolicyParameters.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/UpdateComputePolicyParameters.java new file mode 100644 index 000000000000..53b7f8aa994a --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/UpdateComputePolicyParameters.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.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.UUID; + +/** The parameters used to update a compute policy. */ +@JsonFlatten +@Fluent +public class UpdateComputePolicyParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateComputePolicyParameters.class); + + /* + * The AAD object identifier for the entity to create a policy for. + */ + @JsonProperty(value = "properties.objectId") + private UUID objectId; + + /* + * The type of AAD object the object identifier refers to. + */ + @JsonProperty(value = "properties.objectType") + private AadObjectType objectType; + + /* + * The maximum degree of parallelism per job this user can use to submit + * jobs. This property, the min priority per job property, or both must be + * passed. + */ + @JsonProperty(value = "properties.maxDegreeOfParallelismPerJob") + private Integer maxDegreeOfParallelismPerJob; + + /* + * The minimum priority per job this user can use to submit jobs. This + * property, the max degree of parallelism per job property, or both must + * be passed. + */ + @JsonProperty(value = "properties.minPriorityPerJob") + private Integer minPriorityPerJob; + + /** + * Get the objectId property: The AAD object identifier for the entity to create a policy for. + * + * @return the objectId value. + */ + public UUID objectId() { + return this.objectId; + } + + /** + * Set the objectId property: The AAD object identifier for the entity to create a policy for. + * + * @param objectId the objectId value to set. + * @return the UpdateComputePolicyParameters object itself. + */ + public UpdateComputePolicyParameters withObjectId(UUID objectId) { + this.objectId = objectId; + return this; + } + + /** + * Get the objectType property: The type of AAD object the object identifier refers to. + * + * @return the objectType value. + */ + public AadObjectType objectType() { + return this.objectType; + } + + /** + * Set the objectType property: The type of AAD object the object identifier refers to. + * + * @param objectType the objectType value to set. + * @return the UpdateComputePolicyParameters object itself. + */ + public UpdateComputePolicyParameters withObjectType(AadObjectType objectType) { + this.objectType = objectType; + return this; + } + + /** + * Get the maxDegreeOfParallelismPerJob property: The maximum degree of parallelism per job this user can use to + * submit jobs. This property, the min priority per job property, or both must be passed. + * + * @return the maxDegreeOfParallelismPerJob value. + */ + public Integer maxDegreeOfParallelismPerJob() { + return this.maxDegreeOfParallelismPerJob; + } + + /** + * Set the maxDegreeOfParallelismPerJob property: The maximum degree of parallelism per job this user can use to + * submit jobs. This property, the min priority per job property, or both must be passed. + * + * @param maxDegreeOfParallelismPerJob the maxDegreeOfParallelismPerJob value to set. + * @return the UpdateComputePolicyParameters object itself. + */ + public UpdateComputePolicyParameters withMaxDegreeOfParallelismPerJob(Integer maxDegreeOfParallelismPerJob) { + this.maxDegreeOfParallelismPerJob = maxDegreeOfParallelismPerJob; + return this; + } + + /** + * Get the minPriorityPerJob property: The minimum priority per job this user can use to submit jobs. This property, + * the max degree of parallelism per job property, or both must be passed. + * + * @return the minPriorityPerJob value. + */ + public Integer minPriorityPerJob() { + return this.minPriorityPerJob; + } + + /** + * Set the minPriorityPerJob property: The minimum priority per job this user can use to submit jobs. This property, + * the max degree of parallelism per job property, or both must be passed. + * + * @param minPriorityPerJob the minPriorityPerJob value to set. + * @return the UpdateComputePolicyParameters object itself. + */ + public UpdateComputePolicyParameters withMinPriorityPerJob(Integer minPriorityPerJob) { + this.minPriorityPerJob = minPriorityPerJob; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/UpdateComputePolicyWithAccountParameters.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/UpdateComputePolicyWithAccountParameters.java new file mode 100644 index 000000000000..87134ceaa890 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/UpdateComputePolicyWithAccountParameters.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.datalakeanalytics.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.UUID; + +/** The parameters used to update a compute policy while updating a Data Lake Analytics account. */ +@JsonFlatten +@Fluent +public class UpdateComputePolicyWithAccountParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateComputePolicyWithAccountParameters.class); + + /* + * The unique name of the compute policy to update. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The AAD object identifier for the entity to create a policy for. + */ + @JsonProperty(value = "properties.objectId") + private UUID objectId; + + /* + * The type of AAD object the object identifier refers to. + */ + @JsonProperty(value = "properties.objectType") + private AadObjectType objectType; + + /* + * The maximum degree of parallelism per job this user can use to submit + * jobs. This property, the min priority per job property, or both must be + * passed. + */ + @JsonProperty(value = "properties.maxDegreeOfParallelismPerJob") + private Integer maxDegreeOfParallelismPerJob; + + /* + * The minimum priority per job this user can use to submit jobs. This + * property, the max degree of parallelism per job property, or both must + * be passed. + */ + @JsonProperty(value = "properties.minPriorityPerJob") + private Integer minPriorityPerJob; + + /** + * Get the name property: The unique name of the compute policy to update. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The unique name of the compute policy to update. + * + * @param name the name value to set. + * @return the UpdateComputePolicyWithAccountParameters object itself. + */ + public UpdateComputePolicyWithAccountParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the objectId property: The AAD object identifier for the entity to create a policy for. + * + * @return the objectId value. + */ + public UUID objectId() { + return this.objectId; + } + + /** + * Set the objectId property: The AAD object identifier for the entity to create a policy for. + * + * @param objectId the objectId value to set. + * @return the UpdateComputePolicyWithAccountParameters object itself. + */ + public UpdateComputePolicyWithAccountParameters withObjectId(UUID objectId) { + this.objectId = objectId; + return this; + } + + /** + * Get the objectType property: The type of AAD object the object identifier refers to. + * + * @return the objectType value. + */ + public AadObjectType objectType() { + return this.objectType; + } + + /** + * Set the objectType property: The type of AAD object the object identifier refers to. + * + * @param objectType the objectType value to set. + * @return the UpdateComputePolicyWithAccountParameters object itself. + */ + public UpdateComputePolicyWithAccountParameters withObjectType(AadObjectType objectType) { + this.objectType = objectType; + return this; + } + + /** + * Get the maxDegreeOfParallelismPerJob property: The maximum degree of parallelism per job this user can use to + * submit jobs. This property, the min priority per job property, or both must be passed. + * + * @return the maxDegreeOfParallelismPerJob value. + */ + public Integer maxDegreeOfParallelismPerJob() { + return this.maxDegreeOfParallelismPerJob; + } + + /** + * Set the maxDegreeOfParallelismPerJob property: The maximum degree of parallelism per job this user can use to + * submit jobs. This property, the min priority per job property, or both must be passed. + * + * @param maxDegreeOfParallelismPerJob the maxDegreeOfParallelismPerJob value to set. + * @return the UpdateComputePolicyWithAccountParameters object itself. + */ + public UpdateComputePolicyWithAccountParameters withMaxDegreeOfParallelismPerJob( + Integer maxDegreeOfParallelismPerJob) { + this.maxDegreeOfParallelismPerJob = maxDegreeOfParallelismPerJob; + return this; + } + + /** + * Get the minPriorityPerJob property: The minimum priority per job this user can use to submit jobs. This property, + * the max degree of parallelism per job property, or both must be passed. + * + * @return the minPriorityPerJob value. + */ + public Integer minPriorityPerJob() { + return this.minPriorityPerJob; + } + + /** + * Set the minPriorityPerJob property: The minimum priority per job this user can use to submit jobs. This property, + * the max degree of parallelism per job property, or both must be passed. + * + * @param minPriorityPerJob the minPriorityPerJob value to set. + * @return the UpdateComputePolicyWithAccountParameters object itself. + */ + public UpdateComputePolicyWithAccountParameters withMinPriorityPerJob(Integer minPriorityPerJob) { + this.minPriorityPerJob = minPriorityPerJob; + 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 UpdateComputePolicyWithAccountParameters")); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/UpdateDataLakeAnalyticsAccountParameters.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/UpdateDataLakeAnalyticsAccountParameters.java new file mode 100644 index 000000000000..454c278f8518 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/UpdateDataLakeAnalyticsAccountParameters.java @@ -0,0 +1,394 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.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; + +/** The parameters that can be used to update an existing Data Lake Analytics account. */ +@JsonFlatten +@Fluent +public class UpdateDataLakeAnalyticsAccountParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateDataLakeAnalyticsAccountParameters.class); + + /* + * The resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * The list of Data Lake Store accounts associated with this account. + */ + @JsonProperty(value = "properties.dataLakeStoreAccounts") + private List dataLakeStoreAccounts; + + /* + * The list of Azure Blob storage accounts associated with this account. + */ + @JsonProperty(value = "properties.storageAccounts") + private List storageAccounts; + + /* + * The list of compute policies associated with this account. + */ + @JsonProperty(value = "properties.computePolicies") + private List computePolicies; + + /* + * The list of firewall rules associated with this account. + */ + @JsonProperty(value = "properties.firewallRules") + private List firewallRules; + + /* + * The current state of the IP address firewall for this account. Disabling + * the firewall does not remove existing rules, they will just be ignored + * until the firewall is re-enabled. + */ + @JsonProperty(value = "properties.firewallState") + private FirewallState firewallState; + + /* + * The current state of allowing or disallowing IPs originating within + * Azure through the firewall. If the firewall is disabled, this is not + * enforced. + */ + @JsonProperty(value = "properties.firewallAllowAzureIps") + private FirewallAllowAzureIpsState firewallAllowAzureIps; + + /* + * The commitment tier to use for next month. + */ + @JsonProperty(value = "properties.newTier") + private TierType newTier; + + /* + * The maximum supported jobs running under the account at the same time. + */ + @JsonProperty(value = "properties.maxJobCount") + private Integer maxJobCount; + + /* + * The maximum supported degree of parallelism for this account. + */ + @JsonProperty(value = "properties.maxDegreeOfParallelism") + private Integer maxDegreeOfParallelism; + + /* + * The maximum supported degree of parallelism per job for this account. + */ + @JsonProperty(value = "properties.maxDegreeOfParallelismPerJob") + private Integer maxDegreeOfParallelismPerJob; + + /* + * The minimum supported priority per job for this account. + */ + @JsonProperty(value = "properties.minPriorityPerJob") + private Integer minPriorityPerJob; + + /* + * The number of days that job metadata is retained. + */ + @JsonProperty(value = "properties.queryStoreRetention") + private Integer queryStoreRetention; + + /** + * Get the tags property: The resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The resource tags. + * + * @param tags the tags value to set. + * @return the UpdateDataLakeAnalyticsAccountParameters object itself. + */ + public UpdateDataLakeAnalyticsAccountParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the dataLakeStoreAccounts property: The list of Data Lake Store accounts associated with this account. + * + * @return the dataLakeStoreAccounts value. + */ + public List dataLakeStoreAccounts() { + return this.dataLakeStoreAccounts; + } + + /** + * Set the dataLakeStoreAccounts property: The list of Data Lake Store accounts associated with this account. + * + * @param dataLakeStoreAccounts the dataLakeStoreAccounts value to set. + * @return the UpdateDataLakeAnalyticsAccountParameters object itself. + */ + public UpdateDataLakeAnalyticsAccountParameters withDataLakeStoreAccounts( + List dataLakeStoreAccounts) { + this.dataLakeStoreAccounts = dataLakeStoreAccounts; + return this; + } + + /** + * Get the storageAccounts property: The list of Azure Blob storage accounts associated with this account. + * + * @return the storageAccounts value. + */ + public List storageAccounts() { + return this.storageAccounts; + } + + /** + * Set the storageAccounts property: The list of Azure Blob storage accounts associated with this account. + * + * @param storageAccounts the storageAccounts value to set. + * @return the UpdateDataLakeAnalyticsAccountParameters object itself. + */ + public UpdateDataLakeAnalyticsAccountParameters withStorageAccounts( + List storageAccounts) { + this.storageAccounts = storageAccounts; + return this; + } + + /** + * Get the computePolicies property: The list of compute policies associated with this account. + * + * @return the computePolicies value. + */ + public List computePolicies() { + return this.computePolicies; + } + + /** + * Set the computePolicies property: The list of compute policies associated with this account. + * + * @param computePolicies the computePolicies value to set. + * @return the UpdateDataLakeAnalyticsAccountParameters object itself. + */ + public UpdateDataLakeAnalyticsAccountParameters withComputePolicies( + List computePolicies) { + this.computePolicies = computePolicies; + return this; + } + + /** + * Get the firewallRules property: The list of firewall rules associated with this account. + * + * @return the firewallRules value. + */ + public List firewallRules() { + return this.firewallRules; + } + + /** + * Set the firewallRules property: The list of firewall rules associated with this account. + * + * @param firewallRules the firewallRules value to set. + * @return the UpdateDataLakeAnalyticsAccountParameters object itself. + */ + public UpdateDataLakeAnalyticsAccountParameters withFirewallRules( + List firewallRules) { + this.firewallRules = firewallRules; + return this; + } + + /** + * Get the firewallState property: The current state of the IP address firewall for this account. Disabling the + * firewall does not remove existing rules, they will just be ignored until the firewall is re-enabled. + * + * @return the firewallState value. + */ + public FirewallState firewallState() { + return this.firewallState; + } + + /** + * Set the firewallState property: The current state of the IP address firewall for this account. Disabling the + * firewall does not remove existing rules, they will just be ignored until the firewall is re-enabled. + * + * @param firewallState the firewallState value to set. + * @return the UpdateDataLakeAnalyticsAccountParameters object itself. + */ + public UpdateDataLakeAnalyticsAccountParameters withFirewallState(FirewallState firewallState) { + this.firewallState = firewallState; + return this; + } + + /** + * Get the firewallAllowAzureIps property: The current state of allowing or disallowing IPs originating within Azure + * through the firewall. If the firewall is disabled, this is not enforced. + * + * @return the firewallAllowAzureIps value. + */ + public FirewallAllowAzureIpsState firewallAllowAzureIps() { + return this.firewallAllowAzureIps; + } + + /** + * Set the firewallAllowAzureIps property: The current state of allowing or disallowing IPs originating within Azure + * through the firewall. If the firewall is disabled, this is not enforced. + * + * @param firewallAllowAzureIps the firewallAllowAzureIps value to set. + * @return the UpdateDataLakeAnalyticsAccountParameters object itself. + */ + public UpdateDataLakeAnalyticsAccountParameters withFirewallAllowAzureIps( + FirewallAllowAzureIpsState firewallAllowAzureIps) { + this.firewallAllowAzureIps = firewallAllowAzureIps; + return this; + } + + /** + * Get the newTier property: The commitment tier to use for next month. + * + * @return the newTier value. + */ + public TierType newTier() { + return this.newTier; + } + + /** + * Set the newTier property: The commitment tier to use for next month. + * + * @param newTier the newTier value to set. + * @return the UpdateDataLakeAnalyticsAccountParameters object itself. + */ + public UpdateDataLakeAnalyticsAccountParameters withNewTier(TierType newTier) { + this.newTier = newTier; + return this; + } + + /** + * Get the maxJobCount property: The maximum supported jobs running under the account at the same time. + * + * @return the maxJobCount value. + */ + public Integer maxJobCount() { + return this.maxJobCount; + } + + /** + * Set the maxJobCount property: The maximum supported jobs running under the account at the same time. + * + * @param maxJobCount the maxJobCount value to set. + * @return the UpdateDataLakeAnalyticsAccountParameters object itself. + */ + public UpdateDataLakeAnalyticsAccountParameters withMaxJobCount(Integer maxJobCount) { + this.maxJobCount = maxJobCount; + return this; + } + + /** + * Get the maxDegreeOfParallelism property: The maximum supported degree of parallelism for this account. + * + * @return the maxDegreeOfParallelism value. + */ + public Integer maxDegreeOfParallelism() { + return this.maxDegreeOfParallelism; + } + + /** + * Set the maxDegreeOfParallelism property: The maximum supported degree of parallelism for this account. + * + * @param maxDegreeOfParallelism the maxDegreeOfParallelism value to set. + * @return the UpdateDataLakeAnalyticsAccountParameters object itself. + */ + public UpdateDataLakeAnalyticsAccountParameters withMaxDegreeOfParallelism(Integer maxDegreeOfParallelism) { + this.maxDegreeOfParallelism = maxDegreeOfParallelism; + return this; + } + + /** + * Get the maxDegreeOfParallelismPerJob property: The maximum supported degree of parallelism per job for this + * account. + * + * @return the maxDegreeOfParallelismPerJob value. + */ + public Integer maxDegreeOfParallelismPerJob() { + return this.maxDegreeOfParallelismPerJob; + } + + /** + * Set the maxDegreeOfParallelismPerJob property: The maximum supported degree of parallelism per job for this + * account. + * + * @param maxDegreeOfParallelismPerJob the maxDegreeOfParallelismPerJob value to set. + * @return the UpdateDataLakeAnalyticsAccountParameters object itself. + */ + public UpdateDataLakeAnalyticsAccountParameters withMaxDegreeOfParallelismPerJob( + Integer maxDegreeOfParallelismPerJob) { + this.maxDegreeOfParallelismPerJob = maxDegreeOfParallelismPerJob; + return this; + } + + /** + * Get the minPriorityPerJob property: The minimum supported priority per job for this account. + * + * @return the minPriorityPerJob value. + */ + public Integer minPriorityPerJob() { + return this.minPriorityPerJob; + } + + /** + * Set the minPriorityPerJob property: The minimum supported priority per job for this account. + * + * @param minPriorityPerJob the minPriorityPerJob value to set. + * @return the UpdateDataLakeAnalyticsAccountParameters object itself. + */ + public UpdateDataLakeAnalyticsAccountParameters withMinPriorityPerJob(Integer minPriorityPerJob) { + this.minPriorityPerJob = minPriorityPerJob; + return this; + } + + /** + * Get the queryStoreRetention property: The number of days that job metadata is retained. + * + * @return the queryStoreRetention value. + */ + public Integer queryStoreRetention() { + return this.queryStoreRetention; + } + + /** + * Set the queryStoreRetention property: The number of days that job metadata is retained. + * + * @param queryStoreRetention the queryStoreRetention value to set. + * @return the UpdateDataLakeAnalyticsAccountParameters object itself. + */ + public UpdateDataLakeAnalyticsAccountParameters withQueryStoreRetention(Integer queryStoreRetention) { + this.queryStoreRetention = queryStoreRetention; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dataLakeStoreAccounts() != null) { + dataLakeStoreAccounts().forEach(e -> e.validate()); + } + if (storageAccounts() != null) { + storageAccounts().forEach(e -> e.validate()); + } + if (computePolicies() != null) { + computePolicies().forEach(e -> e.validate()); + } + if (firewallRules() != null) { + firewallRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/UpdateDataLakeStoreWithAccountParameters.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/UpdateDataLakeStoreWithAccountParameters.java new file mode 100644 index 000000000000..a37ce0a0e21f --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/UpdateDataLakeStoreWithAccountParameters.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.datalakeanalytics.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; + +/** The parameters used to update a Data Lake Store account while updating a Data Lake Analytics account. */ +@JsonFlatten +@Fluent +public class UpdateDataLakeStoreWithAccountParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateDataLakeStoreWithAccountParameters.class); + + /* + * The unique name of the Data Lake Store account to update. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The optional suffix for the Data Lake Store account. + */ + @JsonProperty(value = "properties.suffix") + private String suffix; + + /** + * Get the name property: The unique name of the Data Lake Store account to update. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The unique name of the Data Lake Store account to update. + * + * @param name the name value to set. + * @return the UpdateDataLakeStoreWithAccountParameters object itself. + */ + public UpdateDataLakeStoreWithAccountParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the suffix property: The optional suffix for the Data Lake Store account. + * + * @return the suffix value. + */ + public String suffix() { + return this.suffix; + } + + /** + * Set the suffix property: The optional suffix for the Data Lake Store account. + * + * @param suffix the suffix value to set. + * @return the UpdateDataLakeStoreWithAccountParameters object itself. + */ + public UpdateDataLakeStoreWithAccountParameters withSuffix(String suffix) { + this.suffix = suffix; + 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 UpdateDataLakeStoreWithAccountParameters")); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/UpdateFirewallRuleParameters.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/UpdateFirewallRuleParameters.java new file mode 100644 index 000000000000..5c28f130b899 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/UpdateFirewallRuleParameters.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.datalakeanalytics.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; + +/** The parameters used to update a firewall rule. */ +@JsonFlatten +@Fluent +public class UpdateFirewallRuleParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateFirewallRuleParameters.class); + + /* + * The start IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.startIpAddress") + private String startIpAddress; + + /* + * The end IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.endIpAddress") + private String endIpAddress; + + /** + * Get the startIpAddress property: The start IP address for the firewall rule. This can be either ipv4 or ipv6. + * Start and End should be in the same protocol. + * + * @return the startIpAddress value. + */ + public String startIpAddress() { + return this.startIpAddress; + } + + /** + * Set the startIpAddress property: The start IP address for the firewall rule. This can be either ipv4 or ipv6. + * Start and End should be in the same protocol. + * + * @param startIpAddress the startIpAddress value to set. + * @return the UpdateFirewallRuleParameters object itself. + */ + public UpdateFirewallRuleParameters withStartIpAddress(String startIpAddress) { + this.startIpAddress = startIpAddress; + return this; + } + + /** + * Get the endIpAddress property: The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start + * and End should be in the same protocol. + * + * @return the endIpAddress value. + */ + public String endIpAddress() { + return this.endIpAddress; + } + + /** + * Set the endIpAddress property: The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start + * and End should be in the same protocol. + * + * @param endIpAddress the endIpAddress value to set. + * @return the UpdateFirewallRuleParameters object itself. + */ + public UpdateFirewallRuleParameters withEndIpAddress(String endIpAddress) { + this.endIpAddress = endIpAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/UpdateFirewallRuleWithAccountParameters.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/UpdateFirewallRuleWithAccountParameters.java new file mode 100644 index 000000000000..1fc07d964552 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/UpdateFirewallRuleWithAccountParameters.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.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; + +/** The parameters used to update a firewall rule while updating a Data Lake Analytics account. */ +@JsonFlatten +@Fluent +public class UpdateFirewallRuleWithAccountParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateFirewallRuleWithAccountParameters.class); + + /* + * The unique name of the firewall rule to update. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The start IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.startIpAddress") + private String startIpAddress; + + /* + * The end IP address for the firewall rule. This can be either ipv4 or + * ipv6. Start and End should be in the same protocol. + */ + @JsonProperty(value = "properties.endIpAddress") + private String endIpAddress; + + /** + * Get the name property: The unique name of the firewall rule to update. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The unique name of the firewall rule to update. + * + * @param name the name value to set. + * @return the UpdateFirewallRuleWithAccountParameters object itself. + */ + public UpdateFirewallRuleWithAccountParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the startIpAddress property: The start IP address for the firewall rule. This can be either ipv4 or ipv6. + * Start and End should be in the same protocol. + * + * @return the startIpAddress value. + */ + public String startIpAddress() { + return this.startIpAddress; + } + + /** + * Set the startIpAddress property: The start IP address for the firewall rule. This can be either ipv4 or ipv6. + * Start and End should be in the same protocol. + * + * @param startIpAddress the startIpAddress value to set. + * @return the UpdateFirewallRuleWithAccountParameters object itself. + */ + public UpdateFirewallRuleWithAccountParameters withStartIpAddress(String startIpAddress) { + this.startIpAddress = startIpAddress; + return this; + } + + /** + * Get the endIpAddress property: The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start + * and End should be in the same protocol. + * + * @return the endIpAddress value. + */ + public String endIpAddress() { + return this.endIpAddress; + } + + /** + * Set the endIpAddress property: The end IP address for the firewall rule. This can be either ipv4 or ipv6. Start + * and End should be in the same protocol. + * + * @param endIpAddress the endIpAddress value to set. + * @return the UpdateFirewallRuleWithAccountParameters object itself. + */ + public UpdateFirewallRuleWithAccountParameters withEndIpAddress(String endIpAddress) { + this.endIpAddress = endIpAddress; + 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 UpdateFirewallRuleWithAccountParameters")); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/UpdateStorageAccountParameters.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/UpdateStorageAccountParameters.java new file mode 100644 index 000000000000..135057c4ed08 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/UpdateStorageAccountParameters.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.datalakeanalytics.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; + +/** The parameters used to update an Azure Storage account. */ +@JsonFlatten +@Fluent +public class UpdateStorageAccountParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateStorageAccountParameters.class); + + /* + * The updated access key associated with this Azure Storage account that + * will be used to connect to it. + */ + @JsonProperty(value = "properties.accessKey") + private String accessKey; + + /* + * The optional suffix for the storage account. + */ + @JsonProperty(value = "properties.suffix") + private String suffix; + + /** + * Get the accessKey property: The updated access key associated with this Azure Storage account that will be used + * to connect to it. + * + * @return the accessKey value. + */ + public String accessKey() { + return this.accessKey; + } + + /** + * Set the accessKey property: The updated access key associated with this Azure Storage account that will be used + * to connect to it. + * + * @param accessKey the accessKey value to set. + * @return the UpdateStorageAccountParameters object itself. + */ + public UpdateStorageAccountParameters withAccessKey(String accessKey) { + this.accessKey = accessKey; + return this; + } + + /** + * Get the suffix property: The optional suffix for the storage account. + * + * @return the suffix value. + */ + public String suffix() { + return this.suffix; + } + + /** + * Set the suffix property: The optional suffix for the storage account. + * + * @param suffix the suffix value to set. + * @return the UpdateStorageAccountParameters object itself. + */ + public UpdateStorageAccountParameters withSuffix(String suffix) { + this.suffix = suffix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/UpdateStorageAccountWithAccountParameters.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/UpdateStorageAccountWithAccountParameters.java new file mode 100644 index 000000000000..0e8cdf4dde94 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/UpdateStorageAccountWithAccountParameters.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.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; + +/** The parameters used to update an Azure Storage account while updating a Data Lake Analytics account. */ +@JsonFlatten +@Fluent +public class UpdateStorageAccountWithAccountParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateStorageAccountWithAccountParameters.class); + + /* + * The unique name of the Azure Storage account to update. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The updated access key associated with this Azure Storage account that + * will be used to connect to it. + */ + @JsonProperty(value = "properties.accessKey") + private String accessKey; + + /* + * The optional suffix for the storage account. + */ + @JsonProperty(value = "properties.suffix") + private String suffix; + + /** + * Get the name property: The unique name of the Azure Storage account to update. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The unique name of the Azure Storage account to update. + * + * @param name the name value to set. + * @return the UpdateStorageAccountWithAccountParameters object itself. + */ + public UpdateStorageAccountWithAccountParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the accessKey property: The updated access key associated with this Azure Storage account that will be used + * to connect to it. + * + * @return the accessKey value. + */ + public String accessKey() { + return this.accessKey; + } + + /** + * Set the accessKey property: The updated access key associated with this Azure Storage account that will be used + * to connect to it. + * + * @param accessKey the accessKey value to set. + * @return the UpdateStorageAccountWithAccountParameters object itself. + */ + public UpdateStorageAccountWithAccountParameters withAccessKey(String accessKey) { + this.accessKey = accessKey; + return this; + } + + /** + * Get the suffix property: The optional suffix for the storage account. + * + * @return the suffix value. + */ + public String suffix() { + return this.suffix; + } + + /** + * Set the suffix property: The optional suffix for the storage account. + * + * @param suffix the suffix value to set. + * @return the UpdateStorageAccountWithAccountParameters object itself. + */ + public UpdateStorageAccountWithAccountParameters withSuffix(String suffix) { + this.suffix = suffix; + 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 UpdateStorageAccountWithAccountParameters")); + } + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/VirtualNetworkRule.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/VirtualNetworkRule.java new file mode 100644 index 000000000000..e8a314d78737 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/VirtualNetworkRule.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datalakeanalytics.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Data Lake Analytics VirtualNetwork Rule information. */ +@JsonFlatten +@Immutable +public class VirtualNetworkRule extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkRule.class); + + /* + * The resource identifier for the subnet + */ + @JsonProperty(value = "properties.subnetId", access = JsonProperty.Access.WRITE_ONLY) + private String subnetId; + + /* + * The current state of the VirtualNetwork Rule + */ + @JsonProperty(value = "properties.virtualNetworkRuleState", access = JsonProperty.Access.WRITE_ONLY) + private VirtualNetworkRuleState virtualNetworkRuleState; + + /* + * The resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the subnetId property: The resource identifier for the subnet. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Get the virtualNetworkRuleState property: The current state of the VirtualNetwork Rule. + * + * @return the virtualNetworkRuleState value. + */ + public VirtualNetworkRuleState virtualNetworkRuleState() { + return this.virtualNetworkRuleState; + } + + /** + * Get the name property: The resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** {@inheritDoc} */ + @Override + public VirtualNetworkRule withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/VirtualNetworkRuleState.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/VirtualNetworkRuleState.java new file mode 100644 index 000000000000..e02f3f33c31c --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/VirtualNetworkRuleState.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.datalakeanalytics.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for VirtualNetworkRuleState. */ +public enum VirtualNetworkRuleState { + /** Enum value Active. */ + ACTIVE("Active"), + + /** Enum value NetworkSourceDeleted. */ + NETWORK_SOURCE_DELETED("NetworkSourceDeleted"), + + /** Enum value Failed. */ + FAILED("Failed"); + + /** The actual serialized value for a VirtualNetworkRuleState instance. */ + private final String value; + + VirtualNetworkRuleState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a VirtualNetworkRuleState instance. + * + * @param value the serialized value to parse. + * @return the parsed VirtualNetworkRuleState object, or null if unable to parse. + */ + @JsonCreator + public static VirtualNetworkRuleState fromString(String value) { + VirtualNetworkRuleState[] items = VirtualNetworkRuleState.values(); + for (VirtualNetworkRuleState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/package-info.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/package-info.java new file mode 100644 index 000000000000..9a0c2a4ebc4e --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the data models for DataLakeAnalyticsAccountManagementClient. Creates an Azure Data Lake Analytics + * account management client. + */ +package com.azure.resourcemanager.datalakeanalytics.models; diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/package-info.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/package-info.java new file mode 100644 index 000000000000..2a429d4b2137 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for DataLakeAnalyticsAccountManagementClient. Creates an Azure Data Lake Analytics + * account management client. + */ +package com.azure.resourcemanager.datalakeanalytics; diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/module-info.java b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/module-info.java new file mode 100644 index 000000000000..96c86675e3f2 --- /dev/null +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/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.datalakeanalytics { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.datalakeanalytics; + exports com.azure.resourcemanager.datalakeanalytics.fluent; + exports com.azure.resourcemanager.datalakeanalytics.fluent.models; + exports com.azure.resourcemanager.datalakeanalytics.models; + + opens com.azure.resourcemanager.datalakeanalytics.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.datalakeanalytics.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/datalakeanalytics/ci.yml b/sdk/datalakeanalytics/ci.yml new file mode 100644 index 000000000000..cc24d4f970ce --- /dev/null +++ b/sdk/datalakeanalytics/ci.yml @@ -0,0 +1,31 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - master + - hotfix/* + - release/* + paths: + include: + - sdk/datalakeanalytics/ + +pr: + branches: + include: + - master + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datalakeanalytics/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: datalakeanalytics + Artifacts: + - name: azure-resourcemanager-datalakeanalytics + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerdatalakeanalytics diff --git a/sdk/datalakeanalytics/pom.xml b/sdk/datalakeanalytics/pom.xml new file mode 100644 index 000000000000..39f251e24b54 --- /dev/null +++ b/sdk/datalakeanalytics/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-datalakeanalytics-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-datalakeanalytics + + + +