diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 9c6aad1ca5d17..bf3cdb5bdcd67 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -200,6 +200,7 @@ com.azure.resourcemanager:azure-resourcemanager-loganalytics;1.0.0-beta.1;1.0.0- com.azure.resourcemanager:azure-resourcemanager-eventgrid;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-healthbot;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-confluent;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-databoxedge;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 3d84dd84ceb34..d5e2a877c2d68 100644 --- a/pom.xml +++ b/pom.xml @@ -568,6 +568,7 @@ sdk/core sdk/cosmos sdk/costmanagement + sdk/databoxedge sdk/digitaltwins sdk/eventgrid sdk/eventhubs diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/CHANGELOG.md b/sdk/databoxedge/azure-resourcemanager-databoxedge/CHANGELOG.md new file mode 100644 index 0000000000000..0889b2e7e19e5 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-02-03) + +- Azure Resource Manager DataBoxEdge client library for Java. This package contains Microsoft Azure SDK for DataBoxEdge Management SDK. Package tag package-2019-08. 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/databoxedge/azure-resourcemanager-databoxedge/README.md b/sdk/databoxedge/azure-resourcemanager-databoxedge/README.md new file mode 100644 index 0000000000000..efc40dcfa3c75 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/README.md @@ -0,0 +1,99 @@ +# Azure Resource Manager DataBoxEdge client library for Java + +Azure Resource Manager DataBoxEdge client library for Java. + +This package contains Microsoft Azure SDK for DataBoxEdge Management SDK. Package tag package-2019-08. 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-databoxedge;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-databoxedge + 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(); +DataBoxEdgeManager manager = DataBoxEdgeManager + .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/databoxedge/azure-resourcemanager-databoxedge/pom.xml b/sdk/databoxedge/azure-resourcemanager-databoxedge/pom.xml new file mode 100644 index 0000000000000..ac6e87f477fbf --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/pom.xml @@ -0,0 +1,62 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-databoxedge + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for DataBoxEdge Management + This package contains Microsoft Azure SDK for DataBoxEdge Management SDK. Package tag package-2019-08. 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-management + 1.1.0 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + + diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/DataBoxEdgeManager.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/DataBoxEdgeManager.java new file mode 100644 index 0000000000000..cd2bb38e0f2e7 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/DataBoxEdgeManager.java @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge; + +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.databoxedge.fluent.DataBoxEdgeManagementClient; +import com.azure.resourcemanager.databoxedge.implementation.AlertsImpl; +import com.azure.resourcemanager.databoxedge.implementation.BandwidthSchedulesImpl; +import com.azure.resourcemanager.databoxedge.implementation.ContainersImpl; +import com.azure.resourcemanager.databoxedge.implementation.DataBoxEdgeManagementClientBuilder; +import com.azure.resourcemanager.databoxedge.implementation.DevicesImpl; +import com.azure.resourcemanager.databoxedge.implementation.JobsImpl; +import com.azure.resourcemanager.databoxedge.implementation.NodesImpl; +import com.azure.resourcemanager.databoxedge.implementation.OperationsImpl; +import com.azure.resourcemanager.databoxedge.implementation.OperationsStatusImpl; +import com.azure.resourcemanager.databoxedge.implementation.OrdersImpl; +import com.azure.resourcemanager.databoxedge.implementation.RolesImpl; +import com.azure.resourcemanager.databoxedge.implementation.SharesImpl; +import com.azure.resourcemanager.databoxedge.implementation.SkusImpl; +import com.azure.resourcemanager.databoxedge.implementation.StorageAccountCredentialsImpl; +import com.azure.resourcemanager.databoxedge.implementation.StorageAccountsImpl; +import com.azure.resourcemanager.databoxedge.implementation.TriggersImpl; +import com.azure.resourcemanager.databoxedge.implementation.UsersImpl; +import com.azure.resourcemanager.databoxedge.models.Alerts; +import com.azure.resourcemanager.databoxedge.models.BandwidthSchedules; +import com.azure.resourcemanager.databoxedge.models.Containers; +import com.azure.resourcemanager.databoxedge.models.Devices; +import com.azure.resourcemanager.databoxedge.models.Jobs; +import com.azure.resourcemanager.databoxedge.models.Nodes; +import com.azure.resourcemanager.databoxedge.models.Operations; +import com.azure.resourcemanager.databoxedge.models.OperationsStatus; +import com.azure.resourcemanager.databoxedge.models.Orders; +import com.azure.resourcemanager.databoxedge.models.Roles; +import com.azure.resourcemanager.databoxedge.models.Shares; +import com.azure.resourcemanager.databoxedge.models.Skus; +import com.azure.resourcemanager.databoxedge.models.StorageAccountCredentials; +import com.azure.resourcemanager.databoxedge.models.StorageAccounts; +import com.azure.resourcemanager.databoxedge.models.Triggers; +import com.azure.resourcemanager.databoxedge.models.Users; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to DataBoxEdgeManager. */ +public final class DataBoxEdgeManager { + private Operations operations; + + private Devices devices; + + private Alerts alerts; + + private BandwidthSchedules bandwidthSchedules; + + private Jobs jobs; + + private Nodes nodes; + + private OperationsStatus operationsStatus; + + private Orders orders; + + private Roles roles; + + private Shares shares; + + private StorageAccountCredentials storageAccountCredentials; + + private StorageAccounts storageAccounts; + + private Containers containers; + + private Triggers triggers; + + private Users users; + + private Skus skus; + + private final DataBoxEdgeManagementClient clientObject; + + private DataBoxEdgeManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new DataBoxEdgeManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of DataBoxEdge service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the DataBoxEdge service API instance. + */ + public static DataBoxEdgeManager 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 DataBoxEdgeManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new DataBoxEdgeManager.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 DataBoxEdge service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the DataBoxEdge service API instance. + */ + public DataBoxEdgeManager 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.databoxedge") + .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 DataBoxEdgeManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of Devices. */ + public Devices devices() { + if (this.devices == null) { + this.devices = new DevicesImpl(clientObject.getDevices(), this); + } + return devices; + } + + /** @return Resource collection API of Alerts. */ + public Alerts alerts() { + if (this.alerts == null) { + this.alerts = new AlertsImpl(clientObject.getAlerts(), this); + } + return alerts; + } + + /** @return Resource collection API of BandwidthSchedules. */ + public BandwidthSchedules bandwidthSchedules() { + if (this.bandwidthSchedules == null) { + this.bandwidthSchedules = new BandwidthSchedulesImpl(clientObject.getBandwidthSchedules(), this); + } + return bandwidthSchedules; + } + + /** @return Resource collection API of Jobs. */ + public Jobs jobs() { + if (this.jobs == null) { + this.jobs = new JobsImpl(clientObject.getJobs(), this); + } + return jobs; + } + + /** @return Resource collection API of Nodes. */ + public Nodes nodes() { + if (this.nodes == null) { + this.nodes = new NodesImpl(clientObject.getNodes(), this); + } + return nodes; + } + + /** @return Resource collection API of OperationsStatus. */ + public OperationsStatus operationsStatus() { + if (this.operationsStatus == null) { + this.operationsStatus = new OperationsStatusImpl(clientObject.getOperationsStatus(), this); + } + return operationsStatus; + } + + /** @return Resource collection API of Orders. */ + public Orders orders() { + if (this.orders == null) { + this.orders = new OrdersImpl(clientObject.getOrders(), this); + } + return orders; + } + + /** @return Resource collection API of Roles. */ + public Roles roles() { + if (this.roles == null) { + this.roles = new RolesImpl(clientObject.getRoles(), this); + } + return roles; + } + + /** @return Resource collection API of Shares. */ + public Shares shares() { + if (this.shares == null) { + this.shares = new SharesImpl(clientObject.getShares(), this); + } + return shares; + } + + /** @return Resource collection API of StorageAccountCredentials. */ + public StorageAccountCredentials storageAccountCredentials() { + if (this.storageAccountCredentials == null) { + this.storageAccountCredentials = + new StorageAccountCredentialsImpl(clientObject.getStorageAccountCredentials(), this); + } + return storageAccountCredentials; + } + + /** @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 Containers. */ + public Containers containers() { + if (this.containers == null) { + this.containers = new ContainersImpl(clientObject.getContainers(), this); + } + return containers; + } + + /** @return Resource collection API of Triggers. */ + public Triggers triggers() { + if (this.triggers == null) { + this.triggers = new TriggersImpl(clientObject.getTriggers(), this); + } + return triggers; + } + + /** @return Resource collection API of Users. */ + public Users users() { + if (this.users == null) { + this.users = new UsersImpl(clientObject.getUsers(), this); + } + return users; + } + + /** @return Resource collection API of Skus. */ + public Skus skus() { + if (this.skus == null) { + this.skus = new SkusImpl(clientObject.getSkus(), this); + } + return skus; + } + + /** + * @return Wrapped service client DataBoxEdgeManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public DataBoxEdgeManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/AlertsClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/AlertsClient.java new file mode 100644 index 0000000000000..334d594b50827 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/AlertsClient.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.databoxedge.fluent.models.AlertInner; + +/** An instance of this class provides access to all the operations defined in AlertsClient. */ +public interface AlertsClient { + /** + * Gets all the alerts for a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the alerts for a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + + /** + * Gets all the alerts for a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the alerts for a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context); + + /** + * Gets an alert by name. + * + * @param deviceName The device name. + * @param name The alert name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an alert by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AlertInner get(String deviceName, String name, String resourceGroupName); + + /** + * Gets an alert by name. + * + * @param deviceName The device name. + * @param name The alert name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an alert by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/BandwidthSchedulesClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/BandwidthSchedulesClient.java new file mode 100644 index 0000000000000..bf68720bc8fec --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/BandwidthSchedulesClient.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.databoxedge.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.databoxedge.fluent.models.BandwidthScheduleInner; + +/** An instance of this class provides access to all the operations defined in BandwidthSchedulesClient. */ +public interface BandwidthSchedulesClient { + /** + * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + + /** + * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice( + String deviceName, String resourceGroupName, Context context); + + /** + * Gets the properties of the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified bandwidth schedule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BandwidthScheduleInner get(String deviceName, String name, String resourceGroupName); + + /** + * Gets the properties of the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified bandwidth schedule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String deviceName, String name, String resourceGroupName, Context context); + + /** + * Creates or updates a bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param parameters The bandwidth schedule to be added or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the bandwidth schedule details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, BandwidthScheduleInner> beginCreateOrUpdate( + String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters); + + /** + * Creates or updates a bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param parameters The bandwidth schedule to be added or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the bandwidth schedule details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, BandwidthScheduleInner> beginCreateOrUpdate( + String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters, Context context); + + /** + * Creates or updates a bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param parameters The bandwidth schedule to be added or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the bandwidth schedule details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BandwidthScheduleInner createOrUpdate( + String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters); + + /** + * Creates or updates a bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param parameters The bandwidth schedule to be added or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the bandwidth schedule details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BandwidthScheduleInner createOrUpdate( + String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters, Context context); + + /** + * Deletes the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 deviceName, String name, String resourceGroupName); + + /** + * Deletes the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 deviceName, String name, String resourceGroupName, Context context); + + /** + * Deletes the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String name, String resourceGroupName); + + /** + * Deletes the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String name, String resourceGroupName, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/ContainersClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/ContainersClient.java new file mode 100644 index 0000000000000..1122c177d346d --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/ContainersClient.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.databoxedge.fluent.models.ContainerInner; + +/** An instance of this class provides access to all the operations defined in ContainersClient. */ +public interface ContainersClient { + /** + * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The storage Account name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the containers on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByStorageAccount( + String deviceName, String storageAccountName, String resourceGroupName); + + /** + * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The storage Account name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the containers on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByStorageAccount( + String deviceName, String storageAccountName, String resourceGroupName, Context context); + + /** + * Gets a container by name. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container Name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 container by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerInner get(String deviceName, String storageAccountName, String containerName, String resourceGroupName); + + /** + * Gets a container by name. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container Name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 container by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String deviceName, String storageAccountName, String containerName, String resourceGroupName, Context context); + + /** + * Creates a new container or updates an existing container on the device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param container The container properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a container on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ContainerInner> beginCreateOrUpdate( + String deviceName, + String storageAccountName, + String containerName, + String resourceGroupName, + ContainerInner container); + + /** + * Creates a new container or updates an existing container on the device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param container The container properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a container on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ContainerInner> beginCreateOrUpdate( + String deviceName, + String storageAccountName, + String containerName, + String resourceGroupName, + ContainerInner container, + Context context); + + /** + * Creates a new container or updates an existing container on the device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param container The container properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a container on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerInner createOrUpdate( + String deviceName, + String storageAccountName, + String containerName, + String resourceGroupName, + ContainerInner container); + + /** + * Creates a new container or updates an existing container on the device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param container The container properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a container on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerInner createOrUpdate( + String deviceName, + String storageAccountName, + String containerName, + String resourceGroupName, + ContainerInner container, + Context context); + + /** + * Deletes the container on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 deviceName, String storageAccountName, String containerName, String resourceGroupName); + + /** + * Deletes the container on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 deviceName, String storageAccountName, String containerName, String resourceGroupName, Context context); + + /** + * Deletes the container on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String storageAccountName, String containerName, String resourceGroupName); + + /** + * Deletes the container on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String storageAccountName, String containerName, String resourceGroupName, Context context); + + /** + * Refreshes the container metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginRefresh( + String deviceName, String storageAccountName, String containerName, String resourceGroupName); + + /** + * Refreshes the container metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginRefresh( + String deviceName, String storageAccountName, String containerName, String resourceGroupName, Context context); + + /** + * Refreshes the container metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 refresh(String deviceName, String storageAccountName, String containerName, String resourceGroupName); + + /** + * Refreshes the container metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 refresh( + String deviceName, String storageAccountName, String containerName, String resourceGroupName, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/DataBoxEdgeManagementClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/DataBoxEdgeManagementClient.java new file mode 100644 index 0000000000000..d3ea0cb32538e --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/DataBoxEdgeManagementClient.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.databoxedge.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for DataBoxEdgeManagementClient class. */ +public interface DataBoxEdgeManagementClient { + /** + * Gets The subscription ID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the DevicesClient object to access its operations. + * + * @return the DevicesClient object. + */ + DevicesClient getDevices(); + + /** + * Gets the AlertsClient object to access its operations. + * + * @return the AlertsClient object. + */ + AlertsClient getAlerts(); + + /** + * Gets the BandwidthSchedulesClient object to access its operations. + * + * @return the BandwidthSchedulesClient object. + */ + BandwidthSchedulesClient getBandwidthSchedules(); + + /** + * Gets the JobsClient object to access its operations. + * + * @return the JobsClient object. + */ + JobsClient getJobs(); + + /** + * Gets the NodesClient object to access its operations. + * + * @return the NodesClient object. + */ + NodesClient getNodes(); + + /** + * Gets the OperationsStatusClient object to access its operations. + * + * @return the OperationsStatusClient object. + */ + OperationsStatusClient getOperationsStatus(); + + /** + * Gets the OrdersClient object to access its operations. + * + * @return the OrdersClient object. + */ + OrdersClient getOrders(); + + /** + * Gets the RolesClient object to access its operations. + * + * @return the RolesClient object. + */ + RolesClient getRoles(); + + /** + * Gets the SharesClient object to access its operations. + * + * @return the SharesClient object. + */ + SharesClient getShares(); + + /** + * Gets the StorageAccountCredentialsClient object to access its operations. + * + * @return the StorageAccountCredentialsClient object. + */ + StorageAccountCredentialsClient getStorageAccountCredentials(); + + /** + * Gets the StorageAccountsClient object to access its operations. + * + * @return the StorageAccountsClient object. + */ + StorageAccountsClient getStorageAccounts(); + + /** + * Gets the ContainersClient object to access its operations. + * + * @return the ContainersClient object. + */ + ContainersClient getContainers(); + + /** + * Gets the TriggersClient object to access its operations. + * + * @return the TriggersClient object. + */ + TriggersClient getTriggers(); + + /** + * Gets the UsersClient object to access its operations. + * + * @return the UsersClient object. + */ + UsersClient getUsers(); + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + SkusClient getSkus(); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/DevicesClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/DevicesClient.java new file mode 100644 index 0000000000000..44aa91941334e --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/DevicesClient.java @@ -0,0 +1,582 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.databoxedge.fluent.models.DataBoxEdgeDeviceExtendedInfoInner; +import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceInner; +import com.azure.resourcemanager.databoxedge.fluent.models.NetworkSettingsInner; +import com.azure.resourcemanager.databoxedge.fluent.models.UpdateSummaryInner; +import com.azure.resourcemanager.databoxedge.fluent.models.UploadCertificateResponseInner; +import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDevicePatch; +import com.azure.resourcemanager.databoxedge.models.SecuritySettings; +import com.azure.resourcemanager.databoxedge.models.UploadCertificateRequest; + +/** An instance of this class provides access to all the operations defined in DevicesClient. */ +public interface DevicesClient { + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Data Box Edge/Data Box Gateway devices in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + * + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the list. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Data Box Edge/Data Box Gateway devices in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String expand, Context context); + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + * + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Data Box Edge/Data Box Gateway devices in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + * + * @param resourceGroupName The resource group name. + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the list. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Data Box Edge/Data Box Gateway devices in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, String expand, Context context); + + /** + * Gets the properties of the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The resource group name. + * @param deviceName The device name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataBoxEdgeDeviceInner getByResourceGroup(String resourceGroupName, String deviceName); + + /** + * Gets the properties of the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The resource group name. + * @param deviceName The device name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String deviceName, Context context); + + /** + * Creates or updates a Data Box Edge/Data Box Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param dataBoxEdgeDevice The resource object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataBoxEdgeDeviceInner> beginCreateOrUpdate( + String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice); + + /** + * Creates or updates a Data Box Edge/Data Box Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param dataBoxEdgeDevice The resource object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataBoxEdgeDeviceInner> beginCreateOrUpdate( + String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice, Context context); + + /** + * Creates or updates a Data Box Edge/Data Box Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param dataBoxEdgeDevice The resource object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataBoxEdgeDeviceInner createOrUpdate( + String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice); + + /** + * Creates or updates a Data Box Edge/Data Box Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param dataBoxEdgeDevice The resource object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataBoxEdgeDeviceInner createOrUpdate( + String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice, Context context); + + /** + * Deletes the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The resource group name. + * @param deviceName The device name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 deviceName); + + /** + * Deletes the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The resource group name. + * @param deviceName The device name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 deviceName, Context context); + + /** + * Deletes the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The resource group name. + * @param deviceName The device name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName); + + /** + * Deletes the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The resource group name. + * @param deviceName The device name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, Context context); + + /** + * Modifies a Data Box Edge/Data Box Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The resource parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataBoxEdgeDeviceInner update(String deviceName, String resourceGroupName, DataBoxEdgeDevicePatch parameters); + + /** + * Modifies a Data Box Edge/Data Box Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The resource parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String deviceName, String resourceGroupName, DataBoxEdgeDevicePatch parameters, Context context); + + /** + * Downloads the updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginDownloadUpdates(String deviceName, String resourceGroupName); + + /** + * Downloads the updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginDownloadUpdates( + String deviceName, String resourceGroupName, Context context); + + /** + * Downloads the updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 downloadUpdates(String deviceName, String resourceGroupName); + + /** + * Downloads the updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 downloadUpdates(String deviceName, String resourceGroupName, Context context); + + /** + * Gets additional information for the specified Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return additional information for the specified Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataBoxEdgeDeviceExtendedInfoInner getExtendedInformation(String deviceName, String resourceGroupName); + + /** + * Gets additional information for the specified Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return additional information for the specified Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getExtendedInformationWithResponse( + String deviceName, String resourceGroupName, Context context); + + /** + * Installs the updates on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginInstallUpdates(String deviceName, String resourceGroupName); + + /** + * Installs the updates on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginInstallUpdates( + String deviceName, String resourceGroupName, Context context); + + /** + * Installs the updates on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 installUpdates(String deviceName, String resourceGroupName); + + /** + * Installs the updates on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 installUpdates(String deviceName, String resourceGroupName, Context context); + + /** + * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network settings of the specified Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkSettingsInner getNetworkSettings(String deviceName, String resourceGroupName); + + /** + * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network settings of the specified Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getNetworkSettingsWithResponse( + String deviceName, String resourceGroupName, Context context); + + /** + * Scans for updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginScanForUpdates(String deviceName, String resourceGroupName); + + /** + * Scans for updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginScanForUpdates( + String deviceName, String resourceGroupName, Context context); + + /** + * Scans for updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 scanForUpdates(String deviceName, String resourceGroupName); + + /** + * Scans for updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 scanForUpdates(String deviceName, String resourceGroupName, Context context); + + /** + * Updates the security settings on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginCreateOrUpdateSecuritySettings( + String deviceName, String resourceGroupName, SecuritySettings securitySettings); + + /** + * Updates the security settings on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginCreateOrUpdateSecuritySettings( + String deviceName, String resourceGroupName, SecuritySettings securitySettings, Context context); + + /** + * Updates the security settings on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 createOrUpdateSecuritySettings(String deviceName, String resourceGroupName, SecuritySettings securitySettings); + + /** + * Updates the security settings on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 createOrUpdateSecuritySettings( + String deviceName, String resourceGroupName, SecuritySettings securitySettings, Context context); + + /** + * Gets information about the availability of updates based on the last scan of the device. It also gets information + * about any ongoing download or install jobs on the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the availability of updates based on the last scan of the device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UpdateSummaryInner getUpdateSummary(String deviceName, String resourceGroupName); + + /** + * Gets information about the availability of updates based on the last scan of the device. It also gets information + * about any ongoing download or install jobs on the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the availability of updates based on the last scan of the device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getUpdateSummaryWithResponse( + String deviceName, String resourceGroupName, Context context); + + /** + * Uploads registration certificate for the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload registration certificate response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UploadCertificateResponseInner uploadCertificate( + String deviceName, String resourceGroupName, UploadCertificateRequest parameters); + + /** + * Uploads registration certificate for the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The upload certificate request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload registration certificate response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response uploadCertificateWithResponse( + String deviceName, String resourceGroupName, UploadCertificateRequest parameters, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/JobsClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/JobsClient.java new file mode 100644 index 0000000000000..640570ef6745d --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/JobsClient.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.databoxedge.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.databoxedge.fluent.models.JobInner; + +/** An instance of this class provides access to all the operations defined in JobsClient. */ +public interface JobsClient { + /** + * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a specified job on a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner get(String deviceName, String name, String resourceGroupName); + + /** + * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a specified job on a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/NodesClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/NodesClient.java new file mode 100644 index 0000000000000..47241df8e08d2 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/NodesClient.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.databoxedge.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.databoxedge.fluent.models.NodeInner; + +/** An instance of this class provides access to all the operations defined in NodesClient. */ +public interface NodesClient { + /** + * Gets all the nodes currently configured under this Data Box Edge device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the nodes currently configured under this Data Box Edge device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + + /** + * Gets all the nodes currently configured under this Data Box Edge device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the nodes currently configured under this Data Box Edge device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/OperationsClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/OperationsClient.java new file mode 100644 index 0000000000000..04b9c37132d4e --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/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.databoxedge.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.databoxedge.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * List all the supported 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 operations used for the discovery of available provider operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List all the supported 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 operations used for the discovery of available provider operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/OperationsStatusClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/OperationsStatusClient.java new file mode 100644 index 0000000000000..1cc20e96c6227 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/OperationsStatusClient.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.databoxedge.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.databoxedge.fluent.models.JobInner; + +/** An instance of this class provides access to all the operations defined in OperationsStatusClient. */ +public interface OperationsStatusClient { + /** + * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a specified job on a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner get(String deviceName, String name, String resourceGroupName); + + /** + * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a specified job on a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/OrdersClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/OrdersClient.java new file mode 100644 index 0000000000000..6f7bc753adbd0 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/OrdersClient.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.databoxedge.fluent.models.OrderInner; + +/** An instance of this class provides access to all the operations defined in OrdersClient. */ +public interface OrdersClient { + /** + * Lists all the orders related to a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order entities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + + /** + * Lists all the orders related to a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order entities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context); + + /** + * Gets a specific order by name. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 specific order by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrderInner get(String deviceName, String resourceGroupName); + + /** + * Gets a specific order by name. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 specific order by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String deviceName, String resourceGroupName, Context context); + + /** + * Creates or updates an order. + * + * @param deviceName The order details of a device. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the order details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OrderInner> beginCreateOrUpdate( + String deviceName, String resourceGroupName, OrderInner order); + + /** + * Creates or updates an order. + * + * @param deviceName The order details of a device. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the order details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OrderInner> beginCreateOrUpdate( + String deviceName, String resourceGroupName, OrderInner order, Context context); + + /** + * Creates or updates an order. + * + * @param deviceName The order details of a device. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the order details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrderInner createOrUpdate(String deviceName, String resourceGroupName, OrderInner order); + + /** + * Creates or updates an order. + * + * @param deviceName The order details of a device. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the order details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrderInner createOrUpdate(String deviceName, String resourceGroupName, OrderInner order, Context context); + + /** + * Deletes the order related to the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 deviceName, String resourceGroupName); + + /** + * Deletes the order related to the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 deviceName, String resourceGroupName, Context context); + + /** + * Deletes the order related to the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String resourceGroupName); + + /** + * Deletes the order related to the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String resourceGroupName, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/RolesClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/RolesClient.java new file mode 100644 index 0000000000000..cef88cc8ea6e4 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/RolesClient.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.databoxedge.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.databoxedge.fluent.models.RoleInner; + +/** An instance of this class provides access to all the operations defined in RolesClient. */ +public interface RolesClient { + /** + * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the roles on the Data Box Edge device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + + /** + * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the roles on the Data Box Edge device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context); + + /** + * Gets a specific role by name. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 specific role by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleInner get(String deviceName, String name, String resourceGroupName); + + /** + * Gets a specific role by name. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 specific role by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); + + /** + * Create or update a role. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param role The role properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return compute role. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RoleInner> beginCreateOrUpdate( + String deviceName, String name, String resourceGroupName, RoleInner role); + + /** + * Create or update a role. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param role The role properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return compute role. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RoleInner> beginCreateOrUpdate( + String deviceName, String name, String resourceGroupName, RoleInner role, Context context); + + /** + * Create or update a role. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param role The role properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return compute role. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleInner createOrUpdate(String deviceName, String name, String resourceGroupName, RoleInner role); + + /** + * Create or update a role. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param role The role properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return compute role. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleInner createOrUpdate(String deviceName, String name, String resourceGroupName, RoleInner role, Context context); + + /** + * Deletes the role on the device. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 deviceName, String name, String resourceGroupName); + + /** + * Deletes the role on the device. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 deviceName, String name, String resourceGroupName, Context context); + + /** + * Deletes the role on the device. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String name, String resourceGroupName); + + /** + * Deletes the role on the device. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String name, String resourceGroupName, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/SharesClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/SharesClient.java new file mode 100644 index 0000000000000..e1a33e0771fc3 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/SharesClient.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.databoxedge.fluent.models.ShareInner; + +/** An instance of this class provides access to all the operations defined in SharesClient. */ +public interface SharesClient { + /** + * Lists all the shares in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the shares on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + + /** + * Lists all the shares in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the shares on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context); + + /** + * Gets a share by name. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 share by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ShareInner get(String deviceName, String name, String resourceGroupName); + + /** + * Gets a share by name. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 share by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); + + /** + * Creates a new share or updates an existing share on the device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param share The share properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a share on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ShareInner> beginCreateOrUpdate( + String deviceName, String name, String resourceGroupName, ShareInner share); + + /** + * Creates a new share or updates an existing share on the device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param share The share properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a share on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ShareInner> beginCreateOrUpdate( + String deviceName, String name, String resourceGroupName, ShareInner share, Context context); + + /** + * Creates a new share or updates an existing share on the device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param share The share properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a share on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ShareInner createOrUpdate(String deviceName, String name, String resourceGroupName, ShareInner share); + + /** + * Creates a new share or updates an existing share on the device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param share The share properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a share on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ShareInner createOrUpdate( + String deviceName, String name, String resourceGroupName, ShareInner share, Context context); + + /** + * Deletes the share on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 deviceName, String name, String resourceGroupName); + + /** + * Deletes the share on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 deviceName, String name, String resourceGroupName, Context context); + + /** + * Deletes the share on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String name, String resourceGroupName); + + /** + * Deletes the share on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String name, String resourceGroupName, Context context); + + /** + * Refreshes the share metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginRefresh(String deviceName, String name, String resourceGroupName); + + /** + * Refreshes the share metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginRefresh( + String deviceName, String name, String resourceGroupName, Context context); + + /** + * Refreshes the share metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 refresh(String deviceName, String name, String resourceGroupName); + + /** + * Refreshes the share metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 refresh(String deviceName, String name, String resourceGroupName, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/SkusClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/SkusClient.java new file mode 100644 index 0000000000000..73dc0b3417259 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/SkusClient.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.databoxedge.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.databoxedge.fluent.models.ResourceTypeSkuInner; + +/** An instance of this class provides access to all the operations defined in SkusClient. */ +public interface SkusClient { + /** + * List all the available Skus in the region and information related to them. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU Information objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List all the available Skus in the region and information related to them. + * + * @param filter Specify $filter='location eq <location>' to filter on location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU Information objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/StorageAccountCredentialsClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/StorageAccountCredentialsClient.java new file mode 100644 index 0000000000000..435bc27ffad7f --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/StorageAccountCredentialsClient.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.databoxedge.fluent.models.StorageAccountCredentialInner; + +/** An instance of this class provides access to all the operations defined in StorageAccountCredentialsClient. */ +public interface StorageAccountCredentialsClient { + /** + * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the storage account credentials in a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + + /** + * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the storage account credentials in a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice( + String deviceName, String resourceGroupName, Context context); + + /** + * Gets the properties of the specified storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified storage account credential. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageAccountCredentialInner get(String deviceName, String name, String resourceGroupName); + + /** + * Gets the properties of the specified storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified storage account credential. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String deviceName, String name, String resourceGroupName, Context context); + + /** + * Creates or updates the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account credential. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, StorageAccountCredentialInner> beginCreateOrUpdate( + String deviceName, + String name, + String resourceGroupName, + StorageAccountCredentialInner storageAccountCredential); + + /** + * Creates or updates the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account credential. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, StorageAccountCredentialInner> beginCreateOrUpdate( + String deviceName, + String name, + String resourceGroupName, + StorageAccountCredentialInner storageAccountCredential, + Context context); + + /** + * Creates or updates the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account credential. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageAccountCredentialInner createOrUpdate( + String deviceName, + String name, + String resourceGroupName, + StorageAccountCredentialInner storageAccountCredential); + + /** + * Creates or updates the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account credential. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageAccountCredentialInner createOrUpdate( + String deviceName, + String name, + String resourceGroupName, + StorageAccountCredentialInner storageAccountCredential, + Context context); + + /** + * Deletes the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 deviceName, String name, String resourceGroupName); + + /** + * Deletes the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 deviceName, String name, String resourceGroupName, Context context); + + /** + * Deletes the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String name, String resourceGroupName); + + /** + * Deletes the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String name, String resourceGroupName, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/StorageAccountsClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/StorageAccountsClient.java new file mode 100644 index 0000000000000..9badd639ba648 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/StorageAccountsClient.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.databoxedge.fluent.models.StorageAccountInner; + +/** An instance of this class provides access to all the operations defined in StorageAccountsClient. */ +public interface StorageAccountsClient { + /** + * Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the Storage Accounts on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + + /** + * Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the Storage Accounts on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice( + String deviceName, String resourceGroupName, Context context); + + /** + * Gets a StorageAccount by name. + * + * @param deviceName The device name. + * @param storageAccountName The storage account name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 StorageAccount by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageAccountInner get(String deviceName, String storageAccountName, String resourceGroupName); + + /** + * Gets a StorageAccount by name. + * + * @param deviceName The device name. + * @param storageAccountName The storage account name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 StorageAccount by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String deviceName, String storageAccountName, String resourceGroupName, Context context); + + /** + * Creates a new StorageAccount or updates an existing StorageAccount on the device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @param storageAccount The StorageAccount properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Storage Account on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, StorageAccountInner> beginCreateOrUpdate( + String deviceName, String storageAccountName, String resourceGroupName, StorageAccountInner storageAccount); + + /** + * Creates a new StorageAccount or updates an existing StorageAccount on the device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @param storageAccount The StorageAccount properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Storage Account on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, StorageAccountInner> beginCreateOrUpdate( + String deviceName, + String storageAccountName, + String resourceGroupName, + StorageAccountInner storageAccount, + Context context); + + /** + * Creates a new StorageAccount or updates an existing StorageAccount on the device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @param storageAccount The StorageAccount properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Storage Account on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageAccountInner createOrUpdate( + String deviceName, String storageAccountName, String resourceGroupName, StorageAccountInner storageAccount); + + /** + * Creates a new StorageAccount or updates an existing StorageAccount on the device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @param storageAccount The StorageAccount properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Storage Account on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageAccountInner createOrUpdate( + String deviceName, + String storageAccountName, + String resourceGroupName, + StorageAccountInner storageAccount, + Context context); + + /** + * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 deviceName, String storageAccountName, String resourceGroupName); + + /** + * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 deviceName, String storageAccountName, String resourceGroupName, Context context); + + /** + * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String storageAccountName, String resourceGroupName); + + /** + * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String storageAccountName, String resourceGroupName, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/TriggersClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/TriggersClient.java new file mode 100644 index 0000000000000..7eb9230930692 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/TriggersClient.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.databoxedge.fluent.models.TriggerInner; + +/** An instance of this class provides access to all the operations defined in TriggersClient. */ +public interface TriggersClient { + /** + * Lists all the triggers configured in the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all trigger on the data box edge device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + + /** + * Lists all the triggers configured in the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param filter Specify $filter='CustomContextTag eq <tag>' to filter on custom context tag property. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all trigger on the data box edge device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice( + String deviceName, String resourceGroupName, String filter, Context context); + + /** + * Get a specific trigger by name. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 specific trigger by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TriggerInner get(String deviceName, String name, String resourceGroupName); + + /** + * Get a specific trigger by name. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 specific trigger by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); + + /** + * Creates or updates a trigger. + * + * @param deviceName Creates or updates a trigger. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param trigger The trigger. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return trigger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, TriggerInner> beginCreateOrUpdate( + String deviceName, String name, String resourceGroupName, TriggerInner trigger); + + /** + * Creates or updates a trigger. + * + * @param deviceName Creates or updates a trigger. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param trigger The trigger. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return trigger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, TriggerInner> beginCreateOrUpdate( + String deviceName, String name, String resourceGroupName, TriggerInner trigger, Context context); + + /** + * Creates or updates a trigger. + * + * @param deviceName Creates or updates a trigger. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param trigger The trigger. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return trigger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TriggerInner createOrUpdate(String deviceName, String name, String resourceGroupName, TriggerInner trigger); + + /** + * Creates or updates a trigger. + * + * @param deviceName Creates or updates a trigger. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param trigger The trigger. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return trigger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TriggerInner createOrUpdate( + String deviceName, String name, String resourceGroupName, TriggerInner trigger, Context context); + + /** + * Deletes the trigger on the gateway device. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 deviceName, String name, String resourceGroupName); + + /** + * Deletes the trigger on the gateway device. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 deviceName, String name, String resourceGroupName, Context context); + + /** + * Deletes the trigger on the gateway device. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String name, String resourceGroupName); + + /** + * Deletes the trigger on the gateway device. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String name, String resourceGroupName, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/UsersClient.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/UsersClient.java new file mode 100644 index 0000000000000..6fc2a24cfbdc3 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/UsersClient.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.databoxedge.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.databoxedge.fluent.models.UserInner; + +/** An instance of this class provides access to all the operations defined in UsersClient. */ +public interface UsersClient { + /** + * Gets all the users registered on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the users registered on a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + + /** + * Gets all the users registered on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param filter Specify $filter='UserType eq <type>' to filter on user type property. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the users registered on a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDataBoxEdgeDevice( + String deviceName, String resourceGroupName, String filter, Context context); + + /** + * Gets the properties of the specified user. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified user. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UserInner get(String deviceName, String name, String resourceGroupName); + + /** + * Gets the properties of the specified user. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified user. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); + + /** + * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param user The user 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 represents a user who has access to one or more shares on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, UserInner> beginCreateOrUpdate( + String deviceName, String name, String resourceGroupName, UserInner user); + + /** + * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param user The user 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 represents a user who has access to one or more shares on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, UserInner> beginCreateOrUpdate( + String deviceName, String name, String resourceGroupName, UserInner user, Context context); + + /** + * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param user The user 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 represents a user who has access to one or more shares on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UserInner createOrUpdate(String deviceName, String name, String resourceGroupName, UserInner user); + + /** + * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param user The user 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 represents a user who has access to one or more shares on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UserInner createOrUpdate(String deviceName, String name, String resourceGroupName, UserInner user, Context context); + + /** + * Deletes the user on a databox edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 deviceName, String name, String resourceGroupName); + + /** + * Deletes the user on a databox edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 deviceName, String name, String resourceGroupName, Context context); + + /** + * Deletes the user on a databox edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String name, String resourceGroupName); + + /** + * Deletes the user on a databox edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String name, String resourceGroupName, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/AlertInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/AlertInner.java new file mode 100644 index 0000000000000..1cf1a3fc5eccc --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/AlertInner.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.models.AlertErrorDetails; +import com.azure.resourcemanager.databoxedge.models.AlertSeverity; +import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Alert on the data box edge/gateway device. */ +@JsonFlatten +@Immutable +public class AlertInner extends ArmBaseModel { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertInner.class); + + /* + * Alert title. + */ + @JsonProperty(value = "properties.title", access = JsonProperty.Access.WRITE_ONLY) + private String title; + + /* + * Alert type. + */ + @JsonProperty(value = "properties.alertType", access = JsonProperty.Access.WRITE_ONLY) + private String alertType; + + /* + * UTC time when the alert appeared. + */ + @JsonProperty(value = "properties.appearedAtDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime appearedAtDateTime; + + /* + * Alert recommendation. + */ + @JsonProperty(value = "properties.recommendation", access = JsonProperty.Access.WRITE_ONLY) + private String recommendation; + + /* + * Severity of the alert. + */ + @JsonProperty(value = "properties.severity", access = JsonProperty.Access.WRITE_ONLY) + private AlertSeverity severity; + + /* + * Error details of the alert. + */ + @JsonProperty(value = "properties.errorDetails", access = JsonProperty.Access.WRITE_ONLY) + private AlertErrorDetails errorDetails; + + /* + * Alert details. + */ + @JsonProperty(value = "properties.detailedInformation", access = JsonProperty.Access.WRITE_ONLY) + private Map detailedInformation; + + /** + * Get the title property: Alert title. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Get the alertType property: Alert type. + * + * @return the alertType value. + */ + public String alertType() { + return this.alertType; + } + + /** + * Get the appearedAtDateTime property: UTC time when the alert appeared. + * + * @return the appearedAtDateTime value. + */ + public OffsetDateTime appearedAtDateTime() { + return this.appearedAtDateTime; + } + + /** + * Get the recommendation property: Alert recommendation. + * + * @return the recommendation value. + */ + public String recommendation() { + return this.recommendation; + } + + /** + * Get the severity property: Severity of the alert. + * + * @return the severity value. + */ + public AlertSeverity severity() { + return this.severity; + } + + /** + * Get the errorDetails property: Error details of the alert. + * + * @return the errorDetails value. + */ + public AlertErrorDetails errorDetails() { + return this.errorDetails; + } + + /** + * Get the detailedInformation property: Alert details. + * + * @return the detailedInformation value. + */ + public Map detailedInformation() { + return this.detailedInformation; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (errorDetails() != null) { + errorDetails().validate(); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/BandwidthScheduleInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/BandwidthScheduleInner.java new file mode 100644 index 0000000000000..3bd2fdf8f7c6e --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/BandwidthScheduleInner.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; +import com.azure.resourcemanager.databoxedge.models.DayOfWeek; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The bandwidth schedule details. */ +@JsonFlatten +@Fluent +public class BandwidthScheduleInner extends ArmBaseModel { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BandwidthScheduleInner.class); + + /* + * The start time of the schedule in UTC. + */ + @JsonProperty(value = "properties.start", required = true) + private String start; + + /* + * The stop time of the schedule in UTC. + */ + @JsonProperty(value = "properties.stop", required = true) + private String stop; + + /* + * The bandwidth rate in Mbps. + */ + @JsonProperty(value = "properties.rateInMbps", required = true) + private int rateInMbps; + + /* + * The days of the week when this schedule is applicable. + */ + @JsonProperty(value = "properties.days", required = true) + private List days; + + /** + * Get the start property: The start time of the schedule in UTC. + * + * @return the start value. + */ + public String start() { + return this.start; + } + + /** + * Set the start property: The start time of the schedule in UTC. + * + * @param start the start value to set. + * @return the BandwidthScheduleInner object itself. + */ + public BandwidthScheduleInner withStart(String start) { + this.start = start; + return this; + } + + /** + * Get the stop property: The stop time of the schedule in UTC. + * + * @return the stop value. + */ + public String stop() { + return this.stop; + } + + /** + * Set the stop property: The stop time of the schedule in UTC. + * + * @param stop the stop value to set. + * @return the BandwidthScheduleInner object itself. + */ + public BandwidthScheduleInner withStop(String stop) { + this.stop = stop; + return this; + } + + /** + * Get the rateInMbps property: The bandwidth rate in Mbps. + * + * @return the rateInMbps value. + */ + public int rateInMbps() { + return this.rateInMbps; + } + + /** + * Set the rateInMbps property: The bandwidth rate in Mbps. + * + * @param rateInMbps the rateInMbps value to set. + * @return the BandwidthScheduleInner object itself. + */ + public BandwidthScheduleInner withRateInMbps(int rateInMbps) { + this.rateInMbps = rateInMbps; + return this; + } + + /** + * Get the days property: The days of the week when this schedule is applicable. + * + * @return the days value. + */ + public List days() { + return this.days; + } + + /** + * Set the days property: The days of the week when this schedule is applicable. + * + * @param days the days value to set. + * @return the BandwidthScheduleInner object itself. + */ + public BandwidthScheduleInner withDays(List days) { + this.days = days; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (start() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property start in model BandwidthScheduleInner")); + } + if (stop() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property stop in model BandwidthScheduleInner")); + } + if (days() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property days in model BandwidthScheduleInner")); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ContainerInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ContainerInner.java new file mode 100644 index 0000000000000..d4c2952aa00fd --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ContainerInner.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; +import com.azure.resourcemanager.databoxedge.models.AzureContainerDataFormat; +import com.azure.resourcemanager.databoxedge.models.ContainerStatus; +import com.azure.resourcemanager.databoxedge.models.RefreshDetails; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Represents a container on the Data Box Edge/Gateway device. */ +@JsonFlatten +@Fluent +public class ContainerInner extends ArmBaseModel { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerInner.class); + + /* + * Current status of the container. + */ + @JsonProperty(value = "properties.containerStatus", access = JsonProperty.Access.WRITE_ONLY) + private ContainerStatus containerStatus; + + /* + * DataFormat for Container + */ + @JsonProperty(value = "properties.dataFormat", required = true) + private AzureContainerDataFormat dataFormat; + + /* + * Details of the refresh job on this container. + */ + @JsonProperty(value = "properties.refreshDetails", access = JsonProperty.Access.WRITE_ONLY) + private RefreshDetails refreshDetails; + + /* + * The UTC time when container got created. + */ + @JsonProperty(value = "properties.createdDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDateTime; + + /** + * Get the containerStatus property: Current status of the container. + * + * @return the containerStatus value. + */ + public ContainerStatus containerStatus() { + return this.containerStatus; + } + + /** + * Get the dataFormat property: DataFormat for Container. + * + * @return the dataFormat value. + */ + public AzureContainerDataFormat dataFormat() { + return this.dataFormat; + } + + /** + * Set the dataFormat property: DataFormat for Container. + * + * @param dataFormat the dataFormat value to set. + * @return the ContainerInner object itself. + */ + public ContainerInner withDataFormat(AzureContainerDataFormat dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Get the refreshDetails property: Details of the refresh job on this container. + * + * @return the refreshDetails value. + */ + public RefreshDetails refreshDetails() { + return this.refreshDetails; + } + + /** + * Get the createdDateTime property: The UTC time when container got created. + * + * @return the createdDateTime value. + */ + public OffsetDateTime createdDateTime() { + return this.createdDateTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dataFormat() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property dataFormat in model ContainerInner")); + } + if (refreshDetails() != null) { + refreshDetails().validate(); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDeviceExtendedInfoInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDeviceExtendedInfoInner.java new file mode 100644 index 0000000000000..e748fb08dbf44 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDeviceExtendedInfoInner.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The extended Info of the Data Box Edge/Gateway device. */ +@JsonFlatten +@Fluent +public class DataBoxEdgeDeviceExtendedInfoInner extends ArmBaseModel { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataBoxEdgeDeviceExtendedInfoInner.class); + + /* + * The digital signature of encrypted certificate. + */ + @JsonProperty(value = "properties.encryptionKeyThumbprint") + private String encryptionKeyThumbprint; + + /* + * The public part of the encryption certificate. Client uses this to + * encrypt any secret. + */ + @JsonProperty(value = "properties.encryptionKey") + private String encryptionKey; + + /* + * The Resource ID of the Resource. + */ + @JsonProperty(value = "properties.resourceKey", access = JsonProperty.Access.WRITE_ONLY) + private String resourceKey; + + /** + * Get the encryptionKeyThumbprint property: The digital signature of encrypted certificate. + * + * @return the encryptionKeyThumbprint value. + */ + public String encryptionKeyThumbprint() { + return this.encryptionKeyThumbprint; + } + + /** + * Set the encryptionKeyThumbprint property: The digital signature of encrypted certificate. + * + * @param encryptionKeyThumbprint the encryptionKeyThumbprint value to set. + * @return the DataBoxEdgeDeviceExtendedInfoInner object itself. + */ + public DataBoxEdgeDeviceExtendedInfoInner withEncryptionKeyThumbprint(String encryptionKeyThumbprint) { + this.encryptionKeyThumbprint = encryptionKeyThumbprint; + return this; + } + + /** + * Get the encryptionKey property: The public part of the encryption certificate. Client uses this to encrypt any + * secret. + * + * @return the encryptionKey value. + */ + public String encryptionKey() { + return this.encryptionKey; + } + + /** + * Set the encryptionKey property: The public part of the encryption certificate. Client uses this to encrypt any + * secret. + * + * @param encryptionKey the encryptionKey value to set. + * @return the DataBoxEdgeDeviceExtendedInfoInner object itself. + */ + public DataBoxEdgeDeviceExtendedInfoInner withEncryptionKey(String encryptionKey) { + this.encryptionKey = encryptionKey; + return this; + } + + /** + * Get the resourceKey property: The Resource ID of the Resource. + * + * @return the resourceKey value. + */ + public String resourceKey() { + return this.resourceKey; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDeviceInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDeviceInner.java new file mode 100644 index 0000000000000..37f660791285d --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/DataBoxEdgeDeviceInner.java @@ -0,0 +1,412 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; +import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceStatus; +import com.azure.resourcemanager.databoxedge.models.DeviceType; +import com.azure.resourcemanager.databoxedge.models.RoleTypes; +import com.azure.resourcemanager.databoxedge.models.Sku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The Data Box Edge/Gateway device. */ +@JsonFlatten +@Fluent +public class DataBoxEdgeDeviceInner extends ArmBaseModel { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataBoxEdgeDeviceInner.class); + + /* + * The location of the device. This is a supported and registered Azure + * geographical region (for example, West US, East US, or Southeast Asia). + * The geographical region of a device cannot be changed once it is + * created, but if an identical geographical region is specified on update, + * the request will succeed. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /* + * The list of tags that describe the device. These tags can be used to + * view and group this device (across resource groups). + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * The SKU type. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * The etag for the devices. + */ + @JsonProperty(value = "etag") + private String etag; + + /* + * The status of the Data Box Edge/Gateway device. + */ + @JsonProperty(value = "properties.dataBoxEdgeDeviceStatus") + private DataBoxEdgeDeviceStatus dataBoxEdgeDeviceStatus; + + /* + * The Serial Number of Data Box Edge/Gateway device. + */ + @JsonProperty(value = "properties.serialNumber", access = JsonProperty.Access.WRITE_ONLY) + private String serialNumber; + + /* + * The Description of the Data Box Edge/Gateway device. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * The description of the Data Box Edge/Gateway device model. + */ + @JsonProperty(value = "properties.modelDescription") + private String modelDescription; + + /* + * The type of the Data Box Edge/Gateway device. + */ + @JsonProperty(value = "properties.deviceType", access = JsonProperty.Access.WRITE_ONLY) + private DeviceType deviceType; + + /* + * The Data Box Edge/Gateway device name. + */ + @JsonProperty(value = "properties.friendlyName") + private String friendlyName; + + /* + * The Data Box Edge/Gateway device culture. + */ + @JsonProperty(value = "properties.culture", access = JsonProperty.Access.WRITE_ONLY) + private String culture; + + /* + * The Data Box Edge/Gateway device model. + */ + @JsonProperty(value = "properties.deviceModel", access = JsonProperty.Access.WRITE_ONLY) + private String deviceModel; + + /* + * The Data Box Edge/Gateway device software version. + */ + @JsonProperty(value = "properties.deviceSoftwareVersion", access = JsonProperty.Access.WRITE_ONLY) + private String deviceSoftwareVersion; + + /* + * The Data Box Edge/Gateway device local capacity in MB. + */ + @JsonProperty(value = "properties.deviceLocalCapacity", access = JsonProperty.Access.WRITE_ONLY) + private Long deviceLocalCapacity; + + /* + * The Data Box Edge/Gateway device timezone. + */ + @JsonProperty(value = "properties.timeZone", access = JsonProperty.Access.WRITE_ONLY) + private String timeZone; + + /* + * The device software version number of the device (eg: 1.2.18105.6). + */ + @JsonProperty(value = "properties.deviceHcsVersion", access = JsonProperty.Access.WRITE_ONLY) + private String deviceHcsVersion; + + /* + * Type of compute roles configured. + */ + @JsonProperty(value = "properties.configuredRoleTypes", access = JsonProperty.Access.WRITE_ONLY) + private List configuredRoleTypes; + + /* + * The number of nodes in the cluster. + */ + @JsonProperty(value = "properties.nodeCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer nodeCount; + + /** + * Get the location property: The location of the device. This is a supported and registered Azure geographical + * region (for example, West US, East US, or Southeast Asia). The geographical region of a device cannot be changed + * once it is created, but if an identical geographical region is specified on update, the request will succeed. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location of the device. This is a supported and registered Azure geographical + * region (for example, West US, East US, or Southeast Asia). The geographical region of a device cannot be changed + * once it is created, but if an identical geographical region is specified on update, the request will succeed. + * + * @param location the location value to set. + * @return the DataBoxEdgeDeviceInner object itself. + */ + public DataBoxEdgeDeviceInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags property: The list of tags that describe the device. These tags can be used to view and group this + * device (across resource groups). + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The list of tags that describe the device. These tags can be used to view and group this + * device (across resource groups). + * + * @param tags the tags value to set. + * @return the DataBoxEdgeDeviceInner object itself. + */ + public DataBoxEdgeDeviceInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sku property: The SKU type. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU type. + * + * @param sku the sku value to set. + * @return the DataBoxEdgeDeviceInner object itself. + */ + public DataBoxEdgeDeviceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the etag property: The etag for the devices. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The etag for the devices. + * + * @param etag the etag value to set. + * @return the DataBoxEdgeDeviceInner object itself. + */ + public DataBoxEdgeDeviceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the dataBoxEdgeDeviceStatus property: The status of the Data Box Edge/Gateway device. + * + * @return the dataBoxEdgeDeviceStatus value. + */ + public DataBoxEdgeDeviceStatus dataBoxEdgeDeviceStatus() { + return this.dataBoxEdgeDeviceStatus; + } + + /** + * Set the dataBoxEdgeDeviceStatus property: The status of the Data Box Edge/Gateway device. + * + * @param dataBoxEdgeDeviceStatus the dataBoxEdgeDeviceStatus value to set. + * @return the DataBoxEdgeDeviceInner object itself. + */ + public DataBoxEdgeDeviceInner withDataBoxEdgeDeviceStatus(DataBoxEdgeDeviceStatus dataBoxEdgeDeviceStatus) { + this.dataBoxEdgeDeviceStatus = dataBoxEdgeDeviceStatus; + return this; + } + + /** + * Get the serialNumber property: The Serial Number of Data Box Edge/Gateway device. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Get the description property: The Description of the Data Box Edge/Gateway device. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The Description of the Data Box Edge/Gateway device. + * + * @param description the description value to set. + * @return the DataBoxEdgeDeviceInner object itself. + */ + public DataBoxEdgeDeviceInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the modelDescription property: The description of the Data Box Edge/Gateway device model. + * + * @return the modelDescription value. + */ + public String modelDescription() { + return this.modelDescription; + } + + /** + * Set the modelDescription property: The description of the Data Box Edge/Gateway device model. + * + * @param modelDescription the modelDescription value to set. + * @return the DataBoxEdgeDeviceInner object itself. + */ + public DataBoxEdgeDeviceInner withModelDescription(String modelDescription) { + this.modelDescription = modelDescription; + return this; + } + + /** + * Get the deviceType property: The type of the Data Box Edge/Gateway device. + * + * @return the deviceType value. + */ + public DeviceType deviceType() { + return this.deviceType; + } + + /** + * Get the friendlyName property: The Data Box Edge/Gateway device name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: The Data Box Edge/Gateway device name. + * + * @param friendlyName the friendlyName value to set. + * @return the DataBoxEdgeDeviceInner object itself. + */ + public DataBoxEdgeDeviceInner withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the culture property: The Data Box Edge/Gateway device culture. + * + * @return the culture value. + */ + public String culture() { + return this.culture; + } + + /** + * Get the deviceModel property: The Data Box Edge/Gateway device model. + * + * @return the deviceModel value. + */ + public String deviceModel() { + return this.deviceModel; + } + + /** + * Get the deviceSoftwareVersion property: The Data Box Edge/Gateway device software version. + * + * @return the deviceSoftwareVersion value. + */ + public String deviceSoftwareVersion() { + return this.deviceSoftwareVersion; + } + + /** + * Get the deviceLocalCapacity property: The Data Box Edge/Gateway device local capacity in MB. + * + * @return the deviceLocalCapacity value. + */ + public Long deviceLocalCapacity() { + return this.deviceLocalCapacity; + } + + /** + * Get the timeZone property: The Data Box Edge/Gateway device timezone. + * + * @return the timeZone value. + */ + public String timeZone() { + return this.timeZone; + } + + /** + * Get the deviceHcsVersion property: The device software version number of the device (eg: 1.2.18105.6). + * + * @return the deviceHcsVersion value. + */ + public String deviceHcsVersion() { + return this.deviceHcsVersion; + } + + /** + * Get the configuredRoleTypes property: Type of compute roles configured. + * + * @return the configuredRoleTypes value. + */ + public List configuredRoleTypes() { + return this.configuredRoleTypes; + } + + /** + * Get the nodeCount property: The number of nodes in the cluster. + * + * @return the nodeCount value. + */ + public Integer nodeCount() { + return this.nodeCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (location() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property location in model DataBoxEdgeDeviceInner")); + } + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/JobInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/JobInner.java new file mode 100644 index 0000000000000..b1714c488b56c --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/JobInner.java @@ -0,0 +1,298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.models.JobErrorDetails; +import com.azure.resourcemanager.databoxedge.models.JobStatus; +import com.azure.resourcemanager.databoxedge.models.JobType; +import com.azure.resourcemanager.databoxedge.models.UpdateDownloadProgress; +import com.azure.resourcemanager.databoxedge.models.UpdateInstallProgress; +import com.azure.resourcemanager.databoxedge.models.UpdateOperationStage; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** A device job. */ +@JsonFlatten +@Fluent +public class JobInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobInner.class); + + /* + * The path ID that uniquely identifies the object. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The name of the object. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The hierarchical type of the object. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The current status of the job. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private JobStatus status; + + /* + * The UTC date and time at which the job started. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /* + * The UTC date and time at which the job completed. + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endTime; + + /* + * The percentage of the job that is complete. + */ + @JsonProperty(value = "percentComplete", access = JsonProperty.Access.WRITE_ONLY) + private Integer percentComplete; + + /* + * The error details. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private JobErrorDetails error; + + /* + * The type of the job. + */ + @JsonProperty(value = "properties.jobType", access = JsonProperty.Access.WRITE_ONLY) + private JobType jobType; + + /* + * Current stage of the update operation. + */ + @JsonProperty(value = "properties.currentStage", access = JsonProperty.Access.WRITE_ONLY) + private UpdateOperationStage currentStage; + + /* + * The download progress. + */ + @JsonProperty(value = "properties.downloadProgress", access = JsonProperty.Access.WRITE_ONLY) + private UpdateDownloadProgress downloadProgress; + + /* + * The install progress. + */ + @JsonProperty(value = "properties.installProgress", access = JsonProperty.Access.WRITE_ONLY) + private UpdateInstallProgress installProgress; + + /* + * Total number of errors encountered during the refresh process. + */ + @JsonProperty(value = "properties.totalRefreshErrors", access = JsonProperty.Access.WRITE_ONLY) + private Integer totalRefreshErrors; + + /* + * Local share/remote container relative path to the error manifest file of + * the refresh. + */ + @JsonProperty(value = "properties.errorManifestFile", access = JsonProperty.Access.WRITE_ONLY) + private String errorManifestFile; + + /* + * ARM ID of the entity that was refreshed. + */ + @JsonProperty(value = "properties.refreshedEntityId", access = JsonProperty.Access.WRITE_ONLY) + private String refreshedEntityId; + + /* + * If only subfolders need to be refreshed, then the subfolder path inside + * the share or container. (The path is empty if there are no subfolders.) + */ + @JsonProperty(value = "properties.folder") + private String folder; + + /** + * Get the id property: The path ID that uniquely identifies the object. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the object. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The hierarchical type of the object. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the status property: The current status of the job. + * + * @return the status value. + */ + public JobStatus status() { + return this.status; + } + + /** + * Get the startTime property: The UTC date and time at which the job started. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: The UTC date and time at which the job completed. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the percentComplete property: The percentage of the job that is complete. + * + * @return the percentComplete value. + */ + public Integer percentComplete() { + return this.percentComplete; + } + + /** + * Get the error property: The error details. + * + * @return the error value. + */ + public JobErrorDetails error() { + return this.error; + } + + /** + * Get the jobType property: The type of the job. + * + * @return the jobType value. + */ + public JobType jobType() { + return this.jobType; + } + + /** + * Get the currentStage property: Current stage of the update operation. + * + * @return the currentStage value. + */ + public UpdateOperationStage currentStage() { + return this.currentStage; + } + + /** + * Get the downloadProgress property: The download progress. + * + * @return the downloadProgress value. + */ + public UpdateDownloadProgress downloadProgress() { + return this.downloadProgress; + } + + /** + * Get the installProgress property: The install progress. + * + * @return the installProgress value. + */ + public UpdateInstallProgress installProgress() { + return this.installProgress; + } + + /** + * Get the totalRefreshErrors property: Total number of errors encountered during the refresh process. + * + * @return the totalRefreshErrors value. + */ + public Integer totalRefreshErrors() { + return this.totalRefreshErrors; + } + + /** + * Get the errorManifestFile property: Local share/remote container relative path to the error manifest file of the + * refresh. + * + * @return the errorManifestFile value. + */ + public String errorManifestFile() { + return this.errorManifestFile; + } + + /** + * Get the refreshedEntityId property: ARM ID of the entity that was refreshed. + * + * @return the refreshedEntityId value. + */ + public String refreshedEntityId() { + return this.refreshedEntityId; + } + + /** + * Get the folder property: If only subfolders need to be refreshed, then the subfolder path inside the share or + * container. (The path is empty if there are no subfolders.). + * + * @return the folder value. + */ + public String folder() { + return this.folder; + } + + /** + * Set the folder property: If only subfolders need to be refreshed, then the subfolder path inside the share or + * container. (The path is empty if there are no subfolders.). + * + * @param folder the folder value to set. + * @return the JobInner object itself. + */ + public JobInner withFolder(String folder) { + this.folder = folder; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (error() != null) { + error().validate(); + } + if (downloadProgress() != null) { + downloadProgress().validate(); + } + if (installProgress() != null) { + installProgress().validate(); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/NetworkSettingsInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/NetworkSettingsInner.java new file mode 100644 index 0000000000000..3812339ecb2ab --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/NetworkSettingsInner.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; +import com.azure.resourcemanager.databoxedge.models.NetworkAdapter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The network settings of a device. */ +@JsonFlatten +@Immutable +public class NetworkSettingsInner extends ArmBaseModel { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkSettingsInner.class); + + /* + * The network adapter list on the device. + */ + @JsonProperty(value = "properties.networkAdapters", access = JsonProperty.Access.WRITE_ONLY) + private List networkAdapters; + + /** + * Get the networkAdapters property: The network adapter list on the device. + * + * @return the networkAdapters value. + */ + public List networkAdapters() { + return this.networkAdapters; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (networkAdapters() != null) { + networkAdapters().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/NodeInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/NodeInner.java new file mode 100644 index 0000000000000..c294abf52db42 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/NodeInner.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.databoxedge.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; +import com.azure.resourcemanager.databoxedge.models.NodeStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a single node in a Data box Edge/Gateway device Gateway devices, standalone Edge devices and a single node + * cluster Edge device will all have 1 node Multi-node Edge devices will have more than 1 nodes. + */ +@JsonFlatten +@Immutable +public class NodeInner extends ArmBaseModel { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NodeInner.class); + + /* + * The current status of the individual node + */ + @JsonProperty(value = "properties.nodeStatus", access = JsonProperty.Access.WRITE_ONLY) + private NodeStatus nodeStatus; + + /* + * Serial number of the Chassis + */ + @JsonProperty(value = "properties.nodeChassisSerialNumber", access = JsonProperty.Access.WRITE_ONLY) + private String nodeChassisSerialNumber; + + /* + * Serial number of the individual node + */ + @JsonProperty(value = "properties.nodeSerialNumber", access = JsonProperty.Access.WRITE_ONLY) + private String nodeSerialNumber; + + /* + * Display Name of the individual node + */ + @JsonProperty(value = "properties.nodeDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String nodeDisplayName; + + /* + * Friendly software version name that is currently installed on the node + */ + @JsonProperty(value = "properties.nodeFriendlySoftwareVersion", access = JsonProperty.Access.WRITE_ONLY) + private String nodeFriendlySoftwareVersion; + + /* + * HCS version that is currently installed on the node + */ + @JsonProperty(value = "properties.nodeHcsVersion", access = JsonProperty.Access.WRITE_ONLY) + private String nodeHcsVersion; + + /* + * Guid instance id of the node + */ + @JsonProperty(value = "properties.nodeInstanceId", access = JsonProperty.Access.WRITE_ONLY) + private String nodeInstanceId; + + /** + * Get the nodeStatus property: The current status of the individual node. + * + * @return the nodeStatus value. + */ + public NodeStatus nodeStatus() { + return this.nodeStatus; + } + + /** + * Get the nodeChassisSerialNumber property: Serial number of the Chassis. + * + * @return the nodeChassisSerialNumber value. + */ + public String nodeChassisSerialNumber() { + return this.nodeChassisSerialNumber; + } + + /** + * Get the nodeSerialNumber property: Serial number of the individual node. + * + * @return the nodeSerialNumber value. + */ + public String nodeSerialNumber() { + return this.nodeSerialNumber; + } + + /** + * Get the nodeDisplayName property: Display Name of the individual node. + * + * @return the nodeDisplayName value. + */ + public String nodeDisplayName() { + return this.nodeDisplayName; + } + + /** + * Get the nodeFriendlySoftwareVersion property: Friendly software version name that is currently installed on the + * node. + * + * @return the nodeFriendlySoftwareVersion value. + */ + public String nodeFriendlySoftwareVersion() { + return this.nodeFriendlySoftwareVersion; + } + + /** + * Get the nodeHcsVersion property: HCS version that is currently installed on the node. + * + * @return the nodeHcsVersion value. + */ + public String nodeHcsVersion() { + return this.nodeHcsVersion; + } + + /** + * Get the nodeInstanceId property: Guid instance id of the node. + * + * @return the nodeInstanceId value. + */ + public String nodeInstanceId() { + return this.nodeInstanceId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/OperationInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..e534c0cf2f7ae --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/OperationInner.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.models.OperationDisplay; +import com.azure.resourcemanager.databoxedge.models.ServiceSpecification; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Operations. */ +@JsonFlatten +@Fluent +public class OperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); + + /* + * Name of the operation. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Properties displayed for the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * Origin of the operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * Service specification. + */ + @JsonProperty(value = "properties.serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** + * Get the name property: Name of the operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the operation. + * + * @param name the name value to set. + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display property: Properties displayed for the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Properties displayed for the operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: Origin of the operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: Origin of the operation. + * + * @param origin the origin value to set. + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the serviceSpecification property: Service specification. + * + * @return the serviceSpecification value. + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the serviceSpecification property: Service specification. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the OperationInner object itself. + */ + public OperationInner withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/OrderInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/OrderInner.java new file mode 100644 index 0000000000000..34ff53e2c15fd --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/OrderInner.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.databoxedge.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.models.Address; +import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; +import com.azure.resourcemanager.databoxedge.models.ContactDetails; +import com.azure.resourcemanager.databoxedge.models.OrderStatus; +import com.azure.resourcemanager.databoxedge.models.TrackingInfo; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The order details. */ +@JsonFlatten +@Fluent +public class OrderInner extends ArmBaseModel { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OrderInner.class); + + /* + * The contact details. + */ + @JsonProperty(value = "properties.contactInformation") + private ContactDetails contactInformation; + + /* + * The shipping address. + */ + @JsonProperty(value = "properties.shippingAddress") + private Address shippingAddress; + + /* + * Current status of the order. + */ + @JsonProperty(value = "properties.currentStatus") + private OrderStatus currentStatus; + + /* + * List of status changes in the order. + */ + @JsonProperty(value = "properties.orderHistory", access = JsonProperty.Access.WRITE_ONLY) + private List orderHistory; + + /* + * Serial number of the device. + */ + @JsonProperty(value = "properties.serialNumber", access = JsonProperty.Access.WRITE_ONLY) + private String serialNumber; + + /* + * Tracking information for the package delivered to the customer whether + * it has an original or a replacement device. + */ + @JsonProperty(value = "properties.deliveryTrackingInfo", access = JsonProperty.Access.WRITE_ONLY) + private List deliveryTrackingInfo; + + /* + * Tracking information for the package returned from the customer whether + * it has an original or a replacement device. + */ + @JsonProperty(value = "properties.returnTrackingInfo", access = JsonProperty.Access.WRITE_ONLY) + private List returnTrackingInfo; + + /** + * Get the contactInformation property: The contact details. + * + * @return the contactInformation value. + */ + public ContactDetails contactInformation() { + return this.contactInformation; + } + + /** + * Set the contactInformation property: The contact details. + * + * @param contactInformation the contactInformation value to set. + * @return the OrderInner object itself. + */ + public OrderInner withContactInformation(ContactDetails contactInformation) { + this.contactInformation = contactInformation; + return this; + } + + /** + * Get the shippingAddress property: The shipping address. + * + * @return the shippingAddress value. + */ + public Address shippingAddress() { + return this.shippingAddress; + } + + /** + * Set the shippingAddress property: The shipping address. + * + * @param shippingAddress the shippingAddress value to set. + * @return the OrderInner object itself. + */ + public OrderInner withShippingAddress(Address shippingAddress) { + this.shippingAddress = shippingAddress; + return this; + } + + /** + * Get the currentStatus property: Current status of the order. + * + * @return the currentStatus value. + */ + public OrderStatus currentStatus() { + return this.currentStatus; + } + + /** + * Set the currentStatus property: Current status of the order. + * + * @param currentStatus the currentStatus value to set. + * @return the OrderInner object itself. + */ + public OrderInner withCurrentStatus(OrderStatus currentStatus) { + this.currentStatus = currentStatus; + return this; + } + + /** + * Get the orderHistory property: List of status changes in the order. + * + * @return the orderHistory value. + */ + public List orderHistory() { + return this.orderHistory; + } + + /** + * Get the serialNumber property: Serial number of the device. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Get the deliveryTrackingInfo property: Tracking information for the package delivered to the customer whether it + * has an original or a replacement device. + * + * @return the deliveryTrackingInfo value. + */ + public List deliveryTrackingInfo() { + return this.deliveryTrackingInfo; + } + + /** + * Get the returnTrackingInfo property: Tracking information for the package returned from the customer whether it + * has an original or a replacement device. + * + * @return the returnTrackingInfo value. + */ + public List returnTrackingInfo() { + return this.returnTrackingInfo; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (contactInformation() != null) { + contactInformation().validate(); + } + if (shippingAddress() != null) { + shippingAddress().validate(); + } + if (currentStatus() != null) { + currentStatus().validate(); + } + if (orderHistory() != null) { + orderHistory().forEach(e -> e.validate()); + } + if (deliveryTrackingInfo() != null) { + deliveryTrackingInfo().forEach(e -> e.validate()); + } + if (returnTrackingInfo() != null) { + returnTrackingInfo().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ResourceTypeSkuInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ResourceTypeSkuInner.java new file mode 100644 index 0000000000000..7cdc781fa7801 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ResourceTypeSkuInner.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.models.SkuCost; +import com.azure.resourcemanager.databoxedge.models.SkuLocationInfo; +import com.azure.resourcemanager.databoxedge.models.SkuName; +import com.azure.resourcemanager.databoxedge.models.SkuRestriction; +import com.azure.resourcemanager.databoxedge.models.SkuTier; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SkuInformation object. */ +@Immutable +public final class ResourceTypeSkuInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceTypeSkuInner.class); + + /* + * The type of the resource + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /* + * The Sku name + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private SkuName name; + + /* + * The Sku kind + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private String kind; + + /* + * The Sku tier + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private SkuTier tier; + + /* + * The Sku family + */ + @JsonProperty(value = "family", access = JsonProperty.Access.WRITE_ONLY) + private String family; + + /* + * Availability of the SKU for the region + */ + @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) + private List locations; + + /* + * The API versions in which SKU is available + */ + @JsonProperty(value = "apiVersions", access = JsonProperty.Access.WRITE_ONLY) + private List apiVersions; + + /* + * Availability of the SKU for the location/zone + */ + @JsonProperty(value = "locationInfo", access = JsonProperty.Access.WRITE_ONLY) + private List locationInfo; + + /* + * The pricing info of the Sku. + */ + @JsonProperty(value = "costs", access = JsonProperty.Access.WRITE_ONLY) + private List costs; + + /* + * Restrictions of the SKU availability. + */ + @JsonProperty(value = "restrictions", access = JsonProperty.Access.WRITE_ONLY) + private List restrictions; + + /** + * Get the resourceType property: The type of the resource. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the name property: The Sku name. + * + * @return the name value. + */ + public SkuName name() { + return this.name; + } + + /** + * Get the kind property: The Sku kind. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Get the tier property: The Sku tier. + * + * @return the tier value. + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Get the family property: The Sku family. + * + * @return the family value. + */ + public String family() { + return this.family; + } + + /** + * Get the locations property: Availability of the SKU for the region. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Get the apiVersions property: The API versions in which SKU is available. + * + * @return the apiVersions value. + */ + public List apiVersions() { + return this.apiVersions; + } + + /** + * Get the locationInfo property: Availability of the SKU for the location/zone. + * + * @return the locationInfo value. + */ + public List locationInfo() { + return this.locationInfo; + } + + /** + * Get the costs property: The pricing info of the Sku. + * + * @return the costs value. + */ + public List costs() { + return this.costs; + } + + /** + * Get the restrictions property: Restrictions of the SKU availability. + * + * @return the restrictions value. + */ + public List restrictions() { + return this.restrictions; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (locationInfo() != null) { + locationInfo().forEach(e -> e.validate()); + } + if (costs() != null) { + costs().forEach(e -> e.validate()); + } + if (restrictions() != null) { + restrictions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/RoleInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/RoleInner.java new file mode 100644 index 0000000000000..06f52481c0a6a --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/RoleInner.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.databoxedge.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; +import com.azure.resourcemanager.databoxedge.models.IoTRole; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Compute role. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = RoleInner.class) +@JsonTypeName("Role") +@JsonSubTypes({@JsonSubTypes.Type(name = "IOT", value = IoTRole.class)}) +@Immutable +public class RoleInner extends ArmBaseModel { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RoleInner.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ShareInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ShareInner.java new file mode 100644 index 0000000000000..280d6bc637031 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/ShareInner.java @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; +import com.azure.resourcemanager.databoxedge.models.AzureContainerInfo; +import com.azure.resourcemanager.databoxedge.models.ClientAccessRight; +import com.azure.resourcemanager.databoxedge.models.DataPolicy; +import com.azure.resourcemanager.databoxedge.models.MonitoringStatus; +import com.azure.resourcemanager.databoxedge.models.MountPointMap; +import com.azure.resourcemanager.databoxedge.models.RefreshDetails; +import com.azure.resourcemanager.databoxedge.models.ShareAccessProtocol; +import com.azure.resourcemanager.databoxedge.models.ShareStatus; +import com.azure.resourcemanager.databoxedge.models.UserAccessRight; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents a share on the Data Box Edge/Gateway device. */ +@JsonFlatten +@Fluent +public class ShareInner extends ArmBaseModel { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ShareInner.class); + + /* + * Description for the share. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Current status of the share. + */ + @JsonProperty(value = "properties.shareStatus", required = true) + private ShareStatus shareStatus; + + /* + * Current monitoring status of the share. + */ + @JsonProperty(value = "properties.monitoringStatus", required = true) + private MonitoringStatus monitoringStatus; + + /* + * Azure container mapping for the share. + */ + @JsonProperty(value = "properties.azureContainerInfo") + private AzureContainerInfo azureContainerInfo; + + /* + * Access protocol to be used by the share. + */ + @JsonProperty(value = "properties.accessProtocol", required = true) + private ShareAccessProtocol accessProtocol; + + /* + * Mapping of users and corresponding access rights on the share (required + * for SMB protocol). + */ + @JsonProperty(value = "properties.userAccessRights") + private List userAccessRights; + + /* + * List of IP addresses and corresponding access rights on the + * share(required for NFS protocol). + */ + @JsonProperty(value = "properties.clientAccessRights") + private List clientAccessRights; + + /* + * Details of the refresh job on this share. + */ + @JsonProperty(value = "properties.refreshDetails") + private RefreshDetails refreshDetails; + + /* + * Share mount point to the role. + */ + @JsonProperty(value = "properties.shareMappings", access = JsonProperty.Access.WRITE_ONLY) + private List shareMappings; + + /* + * Data policy of the share. + */ + @JsonProperty(value = "properties.dataPolicy") + private DataPolicy dataPolicy; + + /** + * Get the description property: Description for the share. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description for the share. + * + * @param description the description value to set. + * @return the ShareInner object itself. + */ + public ShareInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the shareStatus property: Current status of the share. + * + * @return the shareStatus value. + */ + public ShareStatus shareStatus() { + return this.shareStatus; + } + + /** + * Set the shareStatus property: Current status of the share. + * + * @param shareStatus the shareStatus value to set. + * @return the ShareInner object itself. + */ + public ShareInner withShareStatus(ShareStatus shareStatus) { + this.shareStatus = shareStatus; + return this; + } + + /** + * Get the monitoringStatus property: Current monitoring status of the share. + * + * @return the monitoringStatus value. + */ + public MonitoringStatus monitoringStatus() { + return this.monitoringStatus; + } + + /** + * Set the monitoringStatus property: Current monitoring status of the share. + * + * @param monitoringStatus the monitoringStatus value to set. + * @return the ShareInner object itself. + */ + public ShareInner withMonitoringStatus(MonitoringStatus monitoringStatus) { + this.monitoringStatus = monitoringStatus; + return this; + } + + /** + * Get the azureContainerInfo property: Azure container mapping for the share. + * + * @return the azureContainerInfo value. + */ + public AzureContainerInfo azureContainerInfo() { + return this.azureContainerInfo; + } + + /** + * Set the azureContainerInfo property: Azure container mapping for the share. + * + * @param azureContainerInfo the azureContainerInfo value to set. + * @return the ShareInner object itself. + */ + public ShareInner withAzureContainerInfo(AzureContainerInfo azureContainerInfo) { + this.azureContainerInfo = azureContainerInfo; + return this; + } + + /** + * Get the accessProtocol property: Access protocol to be used by the share. + * + * @return the accessProtocol value. + */ + public ShareAccessProtocol accessProtocol() { + return this.accessProtocol; + } + + /** + * Set the accessProtocol property: Access protocol to be used by the share. + * + * @param accessProtocol the accessProtocol value to set. + * @return the ShareInner object itself. + */ + public ShareInner withAccessProtocol(ShareAccessProtocol accessProtocol) { + this.accessProtocol = accessProtocol; + return this; + } + + /** + * Get the userAccessRights property: Mapping of users and corresponding access rights on the share (required for + * SMB protocol). + * + * @return the userAccessRights value. + */ + public List userAccessRights() { + return this.userAccessRights; + } + + /** + * Set the userAccessRights property: Mapping of users and corresponding access rights on the share (required for + * SMB protocol). + * + * @param userAccessRights the userAccessRights value to set. + * @return the ShareInner object itself. + */ + public ShareInner withUserAccessRights(List userAccessRights) { + this.userAccessRights = userAccessRights; + return this; + } + + /** + * Get the clientAccessRights property: List of IP addresses and corresponding access rights on the share(required + * for NFS protocol). + * + * @return the clientAccessRights value. + */ + public List clientAccessRights() { + return this.clientAccessRights; + } + + /** + * Set the clientAccessRights property: List of IP addresses and corresponding access rights on the share(required + * for NFS protocol). + * + * @param clientAccessRights the clientAccessRights value to set. + * @return the ShareInner object itself. + */ + public ShareInner withClientAccessRights(List clientAccessRights) { + this.clientAccessRights = clientAccessRights; + return this; + } + + /** + * Get the refreshDetails property: Details of the refresh job on this share. + * + * @return the refreshDetails value. + */ + public RefreshDetails refreshDetails() { + return this.refreshDetails; + } + + /** + * Set the refreshDetails property: Details of the refresh job on this share. + * + * @param refreshDetails the refreshDetails value to set. + * @return the ShareInner object itself. + */ + public ShareInner withRefreshDetails(RefreshDetails refreshDetails) { + this.refreshDetails = refreshDetails; + return this; + } + + /** + * Get the shareMappings property: Share mount point to the role. + * + * @return the shareMappings value. + */ + public List shareMappings() { + return this.shareMappings; + } + + /** + * Get the dataPolicy property: Data policy of the share. + * + * @return the dataPolicy value. + */ + public DataPolicy dataPolicy() { + return this.dataPolicy; + } + + /** + * Set the dataPolicy property: Data policy of the share. + * + * @param dataPolicy the dataPolicy value to set. + * @return the ShareInner object itself. + */ + public ShareInner withDataPolicy(DataPolicy dataPolicy) { + this.dataPolicy = dataPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (shareStatus() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property shareStatus in model ShareInner")); + } + if (monitoringStatus() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property monitoringStatus in model ShareInner")); + } + if (azureContainerInfo() != null) { + azureContainerInfo().validate(); + } + if (accessProtocol() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property accessProtocol in model ShareInner")); + } + if (userAccessRights() != null) { + userAccessRights().forEach(e -> e.validate()); + } + if (clientAccessRights() != null) { + clientAccessRights().forEach(e -> e.validate()); + } + if (refreshDetails() != null) { + refreshDetails().validate(); + } + if (shareMappings() != null) { + shareMappings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/StorageAccountCredentialInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/StorageAccountCredentialInner.java new file mode 100644 index 0000000000000..734b0483e59f4 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/StorageAccountCredentialInner.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.models.AccountType; +import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; +import com.azure.resourcemanager.databoxedge.models.AsymmetricEncryptedSecret; +import com.azure.resourcemanager.databoxedge.models.SslStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The storage account credential. */ +@JsonFlatten +@Fluent +public class StorageAccountCredentialInner extends ArmBaseModel { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountCredentialInner.class); + + /* + * Alias for the storage account. + */ + @JsonProperty(value = "properties.alias", required = true) + private String alias; + + /* + * Username for the storage account. + */ + @JsonProperty(value = "properties.userName") + private String username; + + /* + * Encrypted storage key. + */ + @JsonProperty(value = "properties.accountKey") + private AsymmetricEncryptedSecret accountKey; + + /* + * Connection string for the storage account. Use this string if username + * and account key are not specified. + */ + @JsonProperty(value = "properties.connectionString") + private String connectionString; + + /* + * Signifies whether SSL needs to be enabled or not. + */ + @JsonProperty(value = "properties.sslStatus", required = true) + private SslStatus sslStatus; + + /* + * Blob end point for private clouds. + */ + @JsonProperty(value = "properties.blobDomainName") + private String blobDomainName; + + /* + * Type of storage accessed on the storage account. + */ + @JsonProperty(value = "properties.accountType", required = true) + private AccountType accountType; + + /* + * Id of the storage account. + */ + @JsonProperty(value = "properties.storageAccountId") + private String storageAccountId; + + /** + * Get the alias property: Alias for the storage account. + * + * @return the alias value. + */ + public String alias() { + return this.alias; + } + + /** + * Set the alias property: Alias for the storage account. + * + * @param alias the alias value to set. + * @return the StorageAccountCredentialInner object itself. + */ + public StorageAccountCredentialInner withAlias(String alias) { + this.alias = alias; + return this; + } + + /** + * Get the username property: Username for the storage account. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Username for the storage account. + * + * @param username the username value to set. + * @return the StorageAccountCredentialInner object itself. + */ + public StorageAccountCredentialInner withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the accountKey property: Encrypted storage key. + * + * @return the accountKey value. + */ + public AsymmetricEncryptedSecret accountKey() { + return this.accountKey; + } + + /** + * Set the accountKey property: Encrypted storage key. + * + * @param accountKey the accountKey value to set. + * @return the StorageAccountCredentialInner object itself. + */ + public StorageAccountCredentialInner withAccountKey(AsymmetricEncryptedSecret accountKey) { + this.accountKey = accountKey; + return this; + } + + /** + * Get the connectionString property: Connection string for the storage account. Use this string if username and + * account key are not specified. + * + * @return the connectionString value. + */ + public String connectionString() { + return this.connectionString; + } + + /** + * Set the connectionString property: Connection string for the storage account. Use this string if username and + * account key are not specified. + * + * @param connectionString the connectionString value to set. + * @return the StorageAccountCredentialInner object itself. + */ + public StorageAccountCredentialInner withConnectionString(String connectionString) { + this.connectionString = connectionString; + return this; + } + + /** + * Get the sslStatus property: Signifies whether SSL needs to be enabled or not. + * + * @return the sslStatus value. + */ + public SslStatus sslStatus() { + return this.sslStatus; + } + + /** + * Set the sslStatus property: Signifies whether SSL needs to be enabled or not. + * + * @param sslStatus the sslStatus value to set. + * @return the StorageAccountCredentialInner object itself. + */ + public StorageAccountCredentialInner withSslStatus(SslStatus sslStatus) { + this.sslStatus = sslStatus; + return this; + } + + /** + * Get the blobDomainName property: Blob end point for private clouds. + * + * @return the blobDomainName value. + */ + public String blobDomainName() { + return this.blobDomainName; + } + + /** + * Set the blobDomainName property: Blob end point for private clouds. + * + * @param blobDomainName the blobDomainName value to set. + * @return the StorageAccountCredentialInner object itself. + */ + public StorageAccountCredentialInner withBlobDomainName(String blobDomainName) { + this.blobDomainName = blobDomainName; + return this; + } + + /** + * Get the accountType property: Type of storage accessed on the storage account. + * + * @return the accountType value. + */ + public AccountType accountType() { + return this.accountType; + } + + /** + * Set the accountType property: Type of storage accessed on the storage account. + * + * @param accountType the accountType value to set. + * @return the StorageAccountCredentialInner object itself. + */ + public StorageAccountCredentialInner withAccountType(AccountType accountType) { + this.accountType = accountType; + return this; + } + + /** + * Get the storageAccountId property: Id of the storage account. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Set the storageAccountId property: Id of the storage account. + * + * @param storageAccountId the storageAccountId value to set. + * @return the StorageAccountCredentialInner object itself. + */ + public StorageAccountCredentialInner withStorageAccountId(String storageAccountId) { + this.storageAccountId = storageAccountId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (alias() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property alias in model StorageAccountCredentialInner")); + } + if (accountKey() != null) { + accountKey().validate(); + } + if (sslStatus() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sslStatus in model StorageAccountCredentialInner")); + } + if (accountType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property accountType in model StorageAccountCredentialInner")); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/StorageAccountInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/StorageAccountInner.java new file mode 100644 index 0000000000000..dabe5c653d0fa --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/StorageAccountInner.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.databoxedge.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; +import com.azure.resourcemanager.databoxedge.models.DataPolicy; +import com.azure.resourcemanager.databoxedge.models.StorageAccountStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Represents a Storage Account on the Data Box Edge/Gateway device. */ +@JsonFlatten +@Fluent +public class StorageAccountInner extends ArmBaseModel { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountInner.class); + + /* + * Description for the storage Account. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * Current status of the storage account + */ + @JsonProperty(value = "properties.storageAccountStatus") + private StorageAccountStatus storageAccountStatus; + + /* + * Data policy of the storage Account. + */ + @JsonProperty(value = "properties.dataPolicy") + private DataPolicy dataPolicy; + + /* + * Storage Account Credential Id + */ + @JsonProperty(value = "properties.storageAccountCredentialId") + private String storageAccountCredentialId; + + /* + * BlobEndpoint of Storage Account + */ + @JsonProperty(value = "properties.blobEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String blobEndpoint; + + /* + * The Container Count. Present only for Storage Accounts with DataPolicy + * set to Cloud. + */ + @JsonProperty(value = "properties.containerCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer containerCount; + + /** + * Get the description property: Description for the storage Account. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description for the storage Account. + * + * @param description the description value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the storageAccountStatus property: Current status of the storage account. + * + * @return the storageAccountStatus value. + */ + public StorageAccountStatus storageAccountStatus() { + return this.storageAccountStatus; + } + + /** + * Set the storageAccountStatus property: Current status of the storage account. + * + * @param storageAccountStatus the storageAccountStatus value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withStorageAccountStatus(StorageAccountStatus storageAccountStatus) { + this.storageAccountStatus = storageAccountStatus; + return this; + } + + /** + * Get the dataPolicy property: Data policy of the storage Account. + * + * @return the dataPolicy value. + */ + public DataPolicy dataPolicy() { + return this.dataPolicy; + } + + /** + * Set the dataPolicy property: Data policy of the storage Account. + * + * @param dataPolicy the dataPolicy value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withDataPolicy(DataPolicy dataPolicy) { + this.dataPolicy = dataPolicy; + return this; + } + + /** + * Get the storageAccountCredentialId property: Storage Account Credential Id. + * + * @return the storageAccountCredentialId value. + */ + public String storageAccountCredentialId() { + return this.storageAccountCredentialId; + } + + /** + * Set the storageAccountCredentialId property: Storage Account Credential Id. + * + * @param storageAccountCredentialId the storageAccountCredentialId value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withStorageAccountCredentialId(String storageAccountCredentialId) { + this.storageAccountCredentialId = storageAccountCredentialId; + return this; + } + + /** + * Get the blobEndpoint property: BlobEndpoint of Storage Account. + * + * @return the blobEndpoint value. + */ + public String blobEndpoint() { + return this.blobEndpoint; + } + + /** + * Get the containerCount property: The Container Count. Present only for Storage Accounts with DataPolicy set to + * Cloud. + * + * @return the containerCount value. + */ + public Integer containerCount() { + return this.containerCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/TriggerInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/TriggerInner.java new file mode 100644 index 0000000000000..6104763e1583c --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/TriggerInner.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.databoxedge.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; +import com.azure.resourcemanager.databoxedge.models.FileEventTrigger; +import com.azure.resourcemanager.databoxedge.models.PeriodicTimerEventTrigger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Trigger details. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = TriggerInner.class) +@JsonTypeName("Trigger") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "FileEvent", value = FileEventTrigger.class), + @JsonSubTypes.Type(name = "PeriodicTimerEvent", value = PeriodicTimerEventTrigger.class) +}) +@Immutable +public class TriggerInner extends ArmBaseModel { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TriggerInner.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UpdateSummaryInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UpdateSummaryInner.java new file mode 100644 index 0000000000000..b5be1f31758cf --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UpdateSummaryInner.java @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; +import com.azure.resourcemanager.databoxedge.models.InstallRebootBehavior; +import com.azure.resourcemanager.databoxedge.models.UpdateOperation; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Details about ongoing updates and availability of updates on the device. */ +@JsonFlatten +@Fluent +public class UpdateSummaryInner extends ArmBaseModel { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateSummaryInner.class); + + /* + * The current version of the device in format: 1.2.17312.13.", + */ + @JsonProperty(value = "properties.deviceVersionNumber") + private String deviceVersionNumber; + + /* + * The current version of the device in text format. + */ + @JsonProperty(value = "properties.friendlyDeviceVersionName") + private String friendlyDeviceVersionName; + + /* + * The last time when a scan was done on the device. + */ + @JsonProperty(value = "properties.deviceLastScannedDateTime") + private OffsetDateTime deviceLastScannedDateTime; + + /* + * The time when the last scan job was completed (success/cancelled/failed) + * on the appliance. + */ + @JsonProperty(value = "properties.lastCompletedScanJobDateTime") + private OffsetDateTime lastCompletedScanJobDateTime; + + /* + * The time when the last Download job was completed + * (success/cancelled/failed) on the appliance. + */ + @JsonProperty(value = "properties.lastCompletedDownloadJobDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastCompletedDownloadJobDateTime; + + /* + * The time when the last Install job was completed + * (success/cancelled/failed) on the appliance. + */ + @JsonProperty(value = "properties.lastCompletedInstallJobDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastCompletedInstallJobDateTime; + + /* + * The number of updates available for the current device version as per + * the last device scan. + */ + @JsonProperty(value = "properties.totalNumberOfUpdatesAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Integer totalNumberOfUpdatesAvailable; + + /* + * The total number of items pending download. + */ + @JsonProperty(value = "properties.totalNumberOfUpdatesPendingDownload", access = JsonProperty.Access.WRITE_ONLY) + private Integer totalNumberOfUpdatesPendingDownload; + + /* + * The total number of items pending install. + */ + @JsonProperty(value = "properties.totalNumberOfUpdatesPendingInstall", access = JsonProperty.Access.WRITE_ONLY) + private Integer totalNumberOfUpdatesPendingInstall; + + /* + * Indicates if updates are available and at least one of the updates needs + * a reboot. + */ + @JsonProperty(value = "properties.rebootBehavior", access = JsonProperty.Access.WRITE_ONLY) + private InstallRebootBehavior rebootBehavior; + + /* + * The current update operation. + */ + @JsonProperty(value = "properties.ongoingUpdateOperation", access = JsonProperty.Access.WRITE_ONLY) + private UpdateOperation ongoingUpdateOperation; + + /* + * The job ID of the download job in progress. + */ + @JsonProperty(value = "properties.inProgressDownloadJobId", access = JsonProperty.Access.WRITE_ONLY) + private String inProgressDownloadJobId; + + /* + * The job ID of the install job in progress. + */ + @JsonProperty(value = "properties.inProgressInstallJobId", access = JsonProperty.Access.WRITE_ONLY) + private String inProgressInstallJobId; + + /* + * The time when the currently running download (if any) started. + */ + @JsonProperty(value = "properties.inProgressDownloadJobStartedDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime inProgressDownloadJobStartedDateTime; + + /* + * The time when the currently running install (if any) started. + */ + @JsonProperty(value = "properties.inProgressInstallJobStartedDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime inProgressInstallJobStartedDateTime; + + /* + * The list of updates available for install. + */ + @JsonProperty(value = "properties.updateTitles", access = JsonProperty.Access.WRITE_ONLY) + private List updateTitles; + + /* + * The total size of updates available for download in bytes. + */ + @JsonProperty(value = "properties.totalUpdateSizeInBytes", access = JsonProperty.Access.WRITE_ONLY) + private Double totalUpdateSizeInBytes; + + /** + * Get the deviceVersionNumber property: The current version of the device in format: 1.2.17312.13.",. + * + * @return the deviceVersionNumber value. + */ + public String deviceVersionNumber() { + return this.deviceVersionNumber; + } + + /** + * Set the deviceVersionNumber property: The current version of the device in format: 1.2.17312.13.",. + * + * @param deviceVersionNumber the deviceVersionNumber value to set. + * @return the UpdateSummaryInner object itself. + */ + public UpdateSummaryInner withDeviceVersionNumber(String deviceVersionNumber) { + this.deviceVersionNumber = deviceVersionNumber; + return this; + } + + /** + * Get the friendlyDeviceVersionName property: The current version of the device in text format. + * + * @return the friendlyDeviceVersionName value. + */ + public String friendlyDeviceVersionName() { + return this.friendlyDeviceVersionName; + } + + /** + * Set the friendlyDeviceVersionName property: The current version of the device in text format. + * + * @param friendlyDeviceVersionName the friendlyDeviceVersionName value to set. + * @return the UpdateSummaryInner object itself. + */ + public UpdateSummaryInner withFriendlyDeviceVersionName(String friendlyDeviceVersionName) { + this.friendlyDeviceVersionName = friendlyDeviceVersionName; + return this; + } + + /** + * Get the deviceLastScannedDateTime property: The last time when a scan was done on the device. + * + * @return the deviceLastScannedDateTime value. + */ + public OffsetDateTime deviceLastScannedDateTime() { + return this.deviceLastScannedDateTime; + } + + /** + * Set the deviceLastScannedDateTime property: The last time when a scan was done on the device. + * + * @param deviceLastScannedDateTime the deviceLastScannedDateTime value to set. + * @return the UpdateSummaryInner object itself. + */ + public UpdateSummaryInner withDeviceLastScannedDateTime(OffsetDateTime deviceLastScannedDateTime) { + this.deviceLastScannedDateTime = deviceLastScannedDateTime; + return this; + } + + /** + * Get the lastCompletedScanJobDateTime property: The time when the last scan job was completed + * (success/cancelled/failed) on the appliance. + * + * @return the lastCompletedScanJobDateTime value. + */ + public OffsetDateTime lastCompletedScanJobDateTime() { + return this.lastCompletedScanJobDateTime; + } + + /** + * Set the lastCompletedScanJobDateTime property: The time when the last scan job was completed + * (success/cancelled/failed) on the appliance. + * + * @param lastCompletedScanJobDateTime the lastCompletedScanJobDateTime value to set. + * @return the UpdateSummaryInner object itself. + */ + public UpdateSummaryInner withLastCompletedScanJobDateTime(OffsetDateTime lastCompletedScanJobDateTime) { + this.lastCompletedScanJobDateTime = lastCompletedScanJobDateTime; + return this; + } + + /** + * Get the lastCompletedDownloadJobDateTime property: The time when the last Download job was completed + * (success/cancelled/failed) on the appliance. + * + * @return the lastCompletedDownloadJobDateTime value. + */ + public OffsetDateTime lastCompletedDownloadJobDateTime() { + return this.lastCompletedDownloadJobDateTime; + } + + /** + * Get the lastCompletedInstallJobDateTime property: The time when the last Install job was completed + * (success/cancelled/failed) on the appliance. + * + * @return the lastCompletedInstallJobDateTime value. + */ + public OffsetDateTime lastCompletedInstallJobDateTime() { + return this.lastCompletedInstallJobDateTime; + } + + /** + * Get the totalNumberOfUpdatesAvailable property: The number of updates available for the current device version as + * per the last device scan. + * + * @return the totalNumberOfUpdatesAvailable value. + */ + public Integer totalNumberOfUpdatesAvailable() { + return this.totalNumberOfUpdatesAvailable; + } + + /** + * Get the totalNumberOfUpdatesPendingDownload property: The total number of items pending download. + * + * @return the totalNumberOfUpdatesPendingDownload value. + */ + public Integer totalNumberOfUpdatesPendingDownload() { + return this.totalNumberOfUpdatesPendingDownload; + } + + /** + * Get the totalNumberOfUpdatesPendingInstall property: The total number of items pending install. + * + * @return the totalNumberOfUpdatesPendingInstall value. + */ + public Integer totalNumberOfUpdatesPendingInstall() { + return this.totalNumberOfUpdatesPendingInstall; + } + + /** + * Get the rebootBehavior property: Indicates if updates are available and at least one of the updates needs a + * reboot. + * + * @return the rebootBehavior value. + */ + public InstallRebootBehavior rebootBehavior() { + return this.rebootBehavior; + } + + /** + * Get the ongoingUpdateOperation property: The current update operation. + * + * @return the ongoingUpdateOperation value. + */ + public UpdateOperation ongoingUpdateOperation() { + return this.ongoingUpdateOperation; + } + + /** + * Get the inProgressDownloadJobId property: The job ID of the download job in progress. + * + * @return the inProgressDownloadJobId value. + */ + public String inProgressDownloadJobId() { + return this.inProgressDownloadJobId; + } + + /** + * Get the inProgressInstallJobId property: The job ID of the install job in progress. + * + * @return the inProgressInstallJobId value. + */ + public String inProgressInstallJobId() { + return this.inProgressInstallJobId; + } + + /** + * Get the inProgressDownloadJobStartedDateTime property: The time when the currently running download (if any) + * started. + * + * @return the inProgressDownloadJobStartedDateTime value. + */ + public OffsetDateTime inProgressDownloadJobStartedDateTime() { + return this.inProgressDownloadJobStartedDateTime; + } + + /** + * Get the inProgressInstallJobStartedDateTime property: The time when the currently running install (if any) + * started. + * + * @return the inProgressInstallJobStartedDateTime value. + */ + public OffsetDateTime inProgressInstallJobStartedDateTime() { + return this.inProgressInstallJobStartedDateTime; + } + + /** + * Get the updateTitles property: The list of updates available for install. + * + * @return the updateTitles value. + */ + public List updateTitles() { + return this.updateTitles; + } + + /** + * Get the totalUpdateSizeInBytes property: The total size of updates available for download in bytes. + * + * @return the totalUpdateSizeInBytes value. + */ + public Double totalUpdateSizeInBytes() { + return this.totalUpdateSizeInBytes; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UploadCertificateResponseInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UploadCertificateResponseInner.java new file mode 100644 index 0000000000000..fb10dfc34f1d3 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UploadCertificateResponseInner.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.models.AuthenticationType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The upload registration certificate response. */ +@Fluent +public final class UploadCertificateResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UploadCertificateResponseInner.class); + + /* + * Specifies authentication type. + */ + @JsonProperty(value = "authType") + private AuthenticationType authType; + + /* + * The resource ID of the Data Box Edge/Gateway device. + */ + @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) + private String resourceId; + + /* + * Azure Active Directory tenant authority. + */ + @JsonProperty(value = "aadAuthority", access = JsonProperty.Access.WRITE_ONLY) + private String aadAuthority; + + /* + * Azure Active Directory tenant ID. + */ + @JsonProperty(value = "aadTenantId", access = JsonProperty.Access.WRITE_ONLY) + private String aadTenantId; + + /* + * Azure Active Directory service principal client ID. + */ + @JsonProperty(value = "servicePrincipalClientId", access = JsonProperty.Access.WRITE_ONLY) + private String servicePrincipalClientId; + + /* + * Azure Active Directory service principal object ID. + */ + @JsonProperty(value = "servicePrincipalObjectId", access = JsonProperty.Access.WRITE_ONLY) + private String servicePrincipalObjectId; + + /* + * The azure management endpoint audience. + */ + @JsonProperty(value = "azureManagementEndpointAudience", access = JsonProperty.Access.WRITE_ONLY) + private String azureManagementEndpointAudience; + + /* + * Identifier of the target resource that is the recipient of the requested + * token. + */ + @JsonProperty(value = "aadAudience", access = JsonProperty.Access.WRITE_ONLY) + private String aadAudience; + + /** + * Get the authType property: Specifies authentication type. + * + * @return the authType value. + */ + public AuthenticationType authType() { + return this.authType; + } + + /** + * Set the authType property: Specifies authentication type. + * + * @param authType the authType value to set. + * @return the UploadCertificateResponseInner object itself. + */ + public UploadCertificateResponseInner withAuthType(AuthenticationType authType) { + this.authType = authType; + return this; + } + + /** + * Get the resourceId property: The resource ID of the Data Box Edge/Gateway device. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get the aadAuthority property: Azure Active Directory tenant authority. + * + * @return the aadAuthority value. + */ + public String aadAuthority() { + return this.aadAuthority; + } + + /** + * Get the aadTenantId property: Azure Active Directory tenant ID. + * + * @return the aadTenantId value. + */ + public String aadTenantId() { + return this.aadTenantId; + } + + /** + * Get the servicePrincipalClientId property: Azure Active Directory service principal client ID. + * + * @return the servicePrincipalClientId value. + */ + public String servicePrincipalClientId() { + return this.servicePrincipalClientId; + } + + /** + * Get the servicePrincipalObjectId property: Azure Active Directory service principal object ID. + * + * @return the servicePrincipalObjectId value. + */ + public String servicePrincipalObjectId() { + return this.servicePrincipalObjectId; + } + + /** + * Get the azureManagementEndpointAudience property: The azure management endpoint audience. + * + * @return the azureManagementEndpointAudience value. + */ + public String azureManagementEndpointAudience() { + return this.azureManagementEndpointAudience; + } + + /** + * Get the aadAudience property: Identifier of the target resource that is the recipient of the requested token. + * + * @return the aadAudience value. + */ + public String aadAudience() { + return this.aadAudience; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UserInner.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UserInner.java new file mode 100644 index 0000000000000..13a4f25dbe378 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/UserInner.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.models.ArmBaseModel; +import com.azure.resourcemanager.databoxedge.models.AsymmetricEncryptedSecret; +import com.azure.resourcemanager.databoxedge.models.ShareAccessRight; +import com.azure.resourcemanager.databoxedge.models.UserType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents a user who has access to one or more shares on the Data Box Edge/Gateway device. */ +@JsonFlatten +@Fluent +public class UserInner extends ArmBaseModel { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserInner.class); + + /* + * The password details. + */ + @JsonProperty(value = "properties.encryptedPassword") + private AsymmetricEncryptedSecret encryptedPassword; + + /* + * List of shares that the user has rights on. This field should not be + * specified during user creation. + */ + @JsonProperty(value = "properties.shareAccessRights") + private List shareAccessRights; + + /* + * Type of the user. + */ + @JsonProperty(value = "properties.userType", required = true) + private UserType userType; + + /** + * Get the encryptedPassword property: The password details. + * + * @return the encryptedPassword value. + */ + public AsymmetricEncryptedSecret encryptedPassword() { + return this.encryptedPassword; + } + + /** + * Set the encryptedPassword property: The password details. + * + * @param encryptedPassword the encryptedPassword value to set. + * @return the UserInner object itself. + */ + public UserInner withEncryptedPassword(AsymmetricEncryptedSecret encryptedPassword) { + this.encryptedPassword = encryptedPassword; + return this; + } + + /** + * Get the shareAccessRights property: List of shares that the user has rights on. This field should not be + * specified during user creation. + * + * @return the shareAccessRights value. + */ + public List shareAccessRights() { + return this.shareAccessRights; + } + + /** + * Set the shareAccessRights property: List of shares that the user has rights on. This field should not be + * specified during user creation. + * + * @param shareAccessRights the shareAccessRights value to set. + * @return the UserInner object itself. + */ + public UserInner withShareAccessRights(List shareAccessRights) { + this.shareAccessRights = shareAccessRights; + return this; + } + + /** + * Get the userType property: Type of the user. + * + * @return the userType value. + */ + public UserType userType() { + return this.userType; + } + + /** + * Set the userType property: Type of the user. + * + * @param userType the userType value to set. + * @return the UserInner object itself. + */ + public UserInner withUserType(UserType userType) { + this.userType = userType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (encryptedPassword() != null) { + encryptedPassword().validate(); + } + if (shareAccessRights() != null) { + shareAccessRights().forEach(e -> e.validate()); + } + if (userType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property userType in model UserInner")); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/package-info.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/package-info.java new file mode 100644 index 0000000000000..6bea273323778 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for DataBoxEdgeManagementClient. null. */ +package com.azure.resourcemanager.databoxedge.fluent.models; diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/package-info.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/package-info.java new file mode 100644 index 0000000000000..e46bc16508437 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for DataBoxEdgeManagementClient. null. */ +package com.azure.resourcemanager.databoxedge.fluent; diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AlertImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AlertImpl.java new file mode 100644 index 0000000000000..a37624d5710b2 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AlertImpl.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.models.AlertInner; +import com.azure.resourcemanager.databoxedge.models.Alert; +import com.azure.resourcemanager.databoxedge.models.AlertErrorDetails; +import com.azure.resourcemanager.databoxedge.models.AlertSeverity; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Map; + +public final class AlertImpl implements Alert { + private AlertInner innerObject; + + private final DataBoxEdgeManager serviceManager; + + AlertImpl(AlertInner innerObject, DataBoxEdgeManager 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 title() { + return this.innerModel().title(); + } + + public String alertType() { + return this.innerModel().alertType(); + } + + public OffsetDateTime appearedAtDateTime() { + return this.innerModel().appearedAtDateTime(); + } + + public String recommendation() { + return this.innerModel().recommendation(); + } + + public AlertSeverity severity() { + return this.innerModel().severity(); + } + + public AlertErrorDetails errorDetails() { + return this.innerModel().errorDetails(); + } + + public Map detailedInformation() { + Map inner = this.innerModel().detailedInformation(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public AlertInner innerModel() { + return this.innerObject; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AlertsClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AlertsClientImpl.java new file mode 100644 index 0000000000000..c2667b46be213 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AlertsClientImpl.java @@ -0,0 +1,516 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.AlertsClient; +import com.azure.resourcemanager.databoxedge.fluent.models.AlertInner; +import com.azure.resourcemanager.databoxedge.models.AlertList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AlertsClient. */ +public final class AlertsClientImpl implements AlertsClient { + private final ClientLogger logger = new ClientLogger(AlertsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AlertsService service; + + /** The service client containing this operation class. */ + private final DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of AlertsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AlertsClientImpl(DataBoxEdgeManagementClientImpl client) { + this.service = RestProxy.create(AlertsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataBoxEdgeManagementClientAlerts to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataBoxEdgeManagemen") + private interface AlertsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/alerts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDevice( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/alerts/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("name") String name, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDeviceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the alerts for a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the alerts for a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceSinglePageAsync( + String deviceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .listByDataBoxEdgeDevice( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets all the alerts for a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the alerts for a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceSinglePageAsync( + String deviceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .listByDataBoxEdgeDevice( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the alerts for a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the alerts for a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the alerts for a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the alerts for a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync( + String deviceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, context), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the alerts for a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the alerts for a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName)); + } + + /** + * Gets all the alerts for a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the alerts for a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice( + String deviceName, String resourceGroupName, Context context) { + return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName, context)); + } + + /** + * Gets an alert by name. + * + * @param deviceName The device name. + * @param name The alert name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an alert by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String deviceName, String name, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .get( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets an alert by name. + * + * @param deviceName The device name. + * @param name The alert name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an alert by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String deviceName, String name, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .get( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets an alert by name. + * + * @param deviceName The device name. + * @param name The alert name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an alert by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String deviceName, String name, String resourceGroupName) { + return getWithResponseAsync(deviceName, name, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets an alert by name. + * + * @param deviceName The device name. + * @param name The alert name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an alert by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AlertInner get(String deviceName, String name, String resourceGroupName) { + return getAsync(deviceName, name, resourceGroupName).block(); + } + + /** + * Gets an alert by name. + * + * @param deviceName The device name. + * @param name The alert name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an alert by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String deviceName, String name, String resourceGroupName, Context context) { + return getWithResponseAsync(deviceName, name, resourceGroupName, 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 collection of alerts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(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.listByDataBoxEdgeDeviceNext(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 collection of alerts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync( + 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 + .listByDataBoxEdgeDeviceNext(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/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AlertsImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AlertsImpl.java new file mode 100644 index 0000000000000..faf1f5f5edb7e --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/AlertsImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.AlertsClient; +import com.azure.resourcemanager.databoxedge.fluent.models.AlertInner; +import com.azure.resourcemanager.databoxedge.models.Alert; +import com.azure.resourcemanager.databoxedge.models.Alerts; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AlertsImpl implements Alerts { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertsImpl.class); + + private final AlertsClient innerClient; + + private final DataBoxEdgeManager serviceManager; + + public AlertsImpl(AlertsClient innerClient, DataBoxEdgeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName); + return inner.mapPage(inner1 -> new AlertImpl(inner1, this.manager())); + } + + public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName, context); + return inner.mapPage(inner1 -> new AlertImpl(inner1, this.manager())); + } + + public Alert get(String deviceName, String name, String resourceGroupName) { + AlertInner inner = this.serviceClient().get(deviceName, name, resourceGroupName); + if (inner != null) { + return new AlertImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context) { + Response inner = this.serviceClient().getWithResponse(deviceName, name, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AlertImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private AlertsClient serviceClient() { + return this.innerClient; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/BandwidthScheduleImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/BandwidthScheduleImpl.java new file mode 100644 index 0000000000000..432ced9ea03e3 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/BandwidthScheduleImpl.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.databoxedge.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.models.BandwidthScheduleInner; +import com.azure.resourcemanager.databoxedge.models.BandwidthSchedule; +import com.azure.resourcemanager.databoxedge.models.DayOfWeek; +import java.util.Collections; +import java.util.List; + +public final class BandwidthScheduleImpl + implements BandwidthSchedule, BandwidthSchedule.Definition, BandwidthSchedule.Update { + private BandwidthScheduleInner innerObject; + + private final DataBoxEdgeManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String start() { + return this.innerModel().start(); + } + + public String stop() { + return this.innerModel().stop(); + } + + public int rateInMbps() { + return this.innerModel().rateInMbps(); + } + + public List days() { + List inner = this.innerModel().days(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public BandwidthScheduleInner innerModel() { + return this.innerObject; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } + + private String deviceName; + + private String name; + + private String resourceGroupName; + + public BandwidthScheduleImpl withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + this.deviceName = deviceName; + this.resourceGroupName = resourceGroupName; + return this; + } + + public BandwidthSchedule create() { + this.innerObject = + serviceManager + .serviceClient() + .getBandwidthSchedules() + .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), Context.NONE); + return this; + } + + public BandwidthSchedule create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBandwidthSchedules() + .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), context); + return this; + } + + BandwidthScheduleImpl(String name, DataBoxEdgeManager serviceManager) { + this.innerObject = new BandwidthScheduleInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public BandwidthScheduleImpl update() { + return this; + } + + public BandwidthSchedule apply() { + this.innerObject = + serviceManager + .serviceClient() + .getBandwidthSchedules() + .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), Context.NONE); + return this; + } + + public BandwidthSchedule apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBandwidthSchedules() + .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), context); + return this; + } + + BandwidthScheduleImpl(BandwidthScheduleInner innerObject, DataBoxEdgeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.deviceName = Utils.getValueFromIdByName(innerObject.id(), "dataBoxEdgeDevices"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "bandwidthSchedules"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + } + + public BandwidthSchedule refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getBandwidthSchedules() + .getWithResponse(deviceName, name, resourceGroupName, Context.NONE) + .getValue(); + return this; + } + + public BandwidthSchedule refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBandwidthSchedules() + .getWithResponse(deviceName, name, resourceGroupName, context) + .getValue(); + return this; + } + + public BandwidthScheduleImpl withStart(String start) { + this.innerModel().withStart(start); + return this; + } + + public BandwidthScheduleImpl withStop(String stop) { + this.innerModel().withStop(stop); + return this; + } + + public BandwidthScheduleImpl withRateInMbps(int rateInMbps) { + this.innerModel().withRateInMbps(rateInMbps); + return this; + } + + public BandwidthScheduleImpl withDays(List days) { + this.innerModel().withDays(days); + return this; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/BandwidthSchedulesClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/BandwidthSchedulesClientImpl.java new file mode 100644 index 0000000000000..b460b27c3f85a --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/BandwidthSchedulesClientImpl.java @@ -0,0 +1,1097 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.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.databoxedge.fluent.BandwidthSchedulesClient; +import com.azure.resourcemanager.databoxedge.fluent.models.BandwidthScheduleInner; +import com.azure.resourcemanager.databoxedge.models.BandwidthSchedulesList; +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 BandwidthSchedulesClient. */ +public final class BandwidthSchedulesClientImpl implements BandwidthSchedulesClient { + private final ClientLogger logger = new ClientLogger(BandwidthSchedulesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BandwidthSchedulesService service; + + /** The service client containing this operation class. */ + private final DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of BandwidthSchedulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BandwidthSchedulesClientImpl(DataBoxEdgeManagementClientImpl client) { + this.service = + RestProxy.create(BandwidthSchedulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataBoxEdgeManagementClientBandwidthSchedules to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataBoxEdgeManagemen") + private interface BandwidthSchedulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDevice( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("name") String name, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("name") String name, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") BandwidthScheduleInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("name") String name, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDeviceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceSinglePageAsync( + String deviceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .listByDataBoxEdgeDevice( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceSinglePageAsync( + String deviceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .listByDataBoxEdgeDevice( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync( + String deviceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync( + String deviceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, context), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName)); + } + + /** + * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice( + String deviceName, String resourceGroupName, Context context) { + return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName, context)); + } + + /** + * Gets the properties of the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified bandwidth schedule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String deviceName, String name, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .get( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the properties of the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified bandwidth schedule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String deviceName, String name, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .get( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the properties of the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified bandwidth schedule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String deviceName, String name, String resourceGroupName) { + return getWithResponseAsync(deviceName, name, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the properties of the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified bandwidth schedule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BandwidthScheduleInner get(String deviceName, String name, String resourceGroupName) { + return getAsync(deviceName, name, resourceGroupName).block(); + } + + /** + * Gets the properties of the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified bandwidth schedule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String deviceName, String name, String resourceGroupName, Context context) { + return getWithResponseAsync(deviceName, name, resourceGroupName, context).block(); + } + + /** + * Creates or updates a bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param parameters The bandwidth schedule to be added or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the bandwidth schedule details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 (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(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates a bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param parameters The bandwidth schedule to be added or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the bandwidth schedule details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 (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(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Creates or updates a bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param parameters The bandwidth schedule to be added or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the bandwidth schedule details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, BandwidthScheduleInner> beginCreateOrUpdateAsync( + String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(deviceName, name, resourceGroupName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BandwidthScheduleInner.class, + BandwidthScheduleInner.class, + Context.NONE); + } + + /** + * Creates or updates a bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param parameters The bandwidth schedule to be added or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the bandwidth schedule details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, BandwidthScheduleInner> beginCreateOrUpdateAsync( + String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(deviceName, name, resourceGroupName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BandwidthScheduleInner.class, + BandwidthScheduleInner.class, + context); + } + + /** + * Creates or updates a bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param parameters The bandwidth schedule to be added or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the bandwidth schedule details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, BandwidthScheduleInner> beginCreateOrUpdate( + String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters) { + return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param parameters The bandwidth schedule to be added or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the bandwidth schedule details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, BandwidthScheduleInner> beginCreateOrUpdate( + String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters, Context context) { + return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param parameters The bandwidth schedule to be added or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the bandwidth schedule details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters) { + return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param parameters The bandwidth schedule to be added or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the bandwidth schedule details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters, Context context) { + return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param parameters The bandwidth schedule to be added or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the bandwidth schedule details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BandwidthScheduleInner createOrUpdate( + String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters) { + return createOrUpdateAsync(deviceName, name, resourceGroupName, parameters).block(); + } + + /** + * Creates or updates a bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param parameters The bandwidth schedule to be added or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the bandwidth schedule details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BandwidthScheduleInner createOrUpdate( + String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters, Context context) { + return createOrUpdateAsync(deviceName, name, resourceGroupName, parameters, context).block(); + } + + /** + * Deletes the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .delete( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .delete( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName) { + Mono>> mono = deleteWithResponseAsync(deviceName, name, resourceGroupName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(deviceName, name, resourceGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName) { + return beginDeleteAsync(deviceName, name, resourceGroupName).getSyncPoller(); + } + + /** + * Deletes the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName, Context context) { + return beginDeleteAsync(deviceName, name, resourceGroupName, context).getSyncPoller(); + } + + /** + * Deletes the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName) { + return beginDeleteAsync(deviceName, name, resourceGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName, Context context) { + return beginDeleteAsync(deviceName, name, resourceGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deviceName, String name, String resourceGroupName) { + deleteAsync(deviceName, name, resourceGroupName).block(); + } + + /** + * Deletes the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deviceName, String name, String resourceGroupName, Context context) { + deleteAsync(deviceName, name, resourceGroupName, 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 collection of bandwidth schedules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(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.listByDataBoxEdgeDeviceNext(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 collection of bandwidth schedules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync( + 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 + .listByDataBoxEdgeDeviceNext(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/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/BandwidthSchedulesImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/BandwidthSchedulesImpl.java new file mode 100644 index 0000000000000..e4bbc79483837 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/BandwidthSchedulesImpl.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.BandwidthSchedulesClient; +import com.azure.resourcemanager.databoxedge.fluent.models.BandwidthScheduleInner; +import com.azure.resourcemanager.databoxedge.models.BandwidthSchedule; +import com.azure.resourcemanager.databoxedge.models.BandwidthSchedules; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BandwidthSchedulesImpl implements BandwidthSchedules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BandwidthSchedulesImpl.class); + + private final BandwidthSchedulesClient innerClient; + + private final DataBoxEdgeManager serviceManager; + + public BandwidthSchedulesImpl(BandwidthSchedulesClient innerClient, DataBoxEdgeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName); + return inner.mapPage(inner1 -> new BandwidthScheduleImpl(inner1, this.manager())); + } + + public PagedIterable listByDataBoxEdgeDevice( + String deviceName, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName, context); + return inner.mapPage(inner1 -> new BandwidthScheduleImpl(inner1, this.manager())); + } + + public BandwidthSchedule get(String deviceName, String name, String resourceGroupName) { + BandwidthScheduleInner inner = this.serviceClient().get(deviceName, name, resourceGroupName); + if (inner != null) { + return new BandwidthScheduleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String deviceName, String name, String resourceGroupName, Context context) { + Response inner = + this.serviceClient().getWithResponse(deviceName, name, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BandwidthScheduleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String deviceName, String name, String resourceGroupName) { + this.serviceClient().delete(deviceName, name, resourceGroupName); + } + + public void delete(String deviceName, String name, String resourceGroupName, Context context) { + this.serviceClient().delete(deviceName, name, resourceGroupName, context); + } + + public BandwidthSchedule getById(String id) { + String deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String name = Utils.getValueFromIdByName(id, "bandwidthSchedules"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'bandwidthSchedules'.", 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))); + } + return this.getWithResponse(deviceName, name, resourceGroupName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String name = Utils.getValueFromIdByName(id, "bandwidthSchedules"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'bandwidthSchedules'.", 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))); + } + return this.getWithResponse(deviceName, name, resourceGroupName, context); + } + + public void deleteById(String id) { + String deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String name = Utils.getValueFromIdByName(id, "bandwidthSchedules"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'bandwidthSchedules'.", 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))); + } + this.delete(deviceName, name, resourceGroupName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String name = Utils.getValueFromIdByName(id, "bandwidthSchedules"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'bandwidthSchedules'.", 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))); + } + this.delete(deviceName, name, resourceGroupName, context); + } + + private BandwidthSchedulesClient serviceClient() { + return this.innerClient; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } + + public BandwidthScheduleImpl define(String name) { + return new BandwidthScheduleImpl(name, this.manager()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ContainerImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ContainerImpl.java new file mode 100644 index 0000000000000..4bdfbfaa5ab52 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ContainerImpl.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.databoxedge.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.models.ContainerInner; +import com.azure.resourcemanager.databoxedge.models.AzureContainerDataFormat; +import com.azure.resourcemanager.databoxedge.models.Container; +import com.azure.resourcemanager.databoxedge.models.ContainerStatus; +import com.azure.resourcemanager.databoxedge.models.RefreshDetails; +import java.time.OffsetDateTime; + +public final class ContainerImpl implements Container, Container.Definition, Container.Update { + private ContainerInner innerObject; + + private final DataBoxEdgeManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ContainerStatus containerStatus() { + return this.innerModel().containerStatus(); + } + + public AzureContainerDataFormat dataFormat() { + return this.innerModel().dataFormat(); + } + + public RefreshDetails refreshDetails() { + return this.innerModel().refreshDetails(); + } + + public OffsetDateTime createdDateTime() { + return this.innerModel().createdDateTime(); + } + + public ContainerInner innerModel() { + return this.innerObject; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } + + private String deviceName; + + private String storageAccountName; + + private String containerName; + + private String resourceGroupName; + + public ContainerImpl withExistingStorageAccount( + String deviceName, String storageAccountName, String resourceGroupName) { + this.deviceName = deviceName; + this.storageAccountName = storageAccountName; + this.resourceGroupName = resourceGroupName; + return this; + } + + public Container create() { + this.innerObject = + serviceManager + .serviceClient() + .getContainers() + .createOrUpdate( + deviceName, storageAccountName, containerName, resourceGroupName, this.innerModel(), Context.NONE); + return this; + } + + public Container create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainers() + .createOrUpdate( + deviceName, storageAccountName, containerName, resourceGroupName, this.innerModel(), context); + return this; + } + + ContainerImpl(String name, DataBoxEdgeManager serviceManager) { + this.innerObject = new ContainerInner(); + this.serviceManager = serviceManager; + this.containerName = name; + } + + public ContainerImpl update() { + return this; + } + + public Container apply() { + this.innerObject = + serviceManager + .serviceClient() + .getContainers() + .createOrUpdate( + deviceName, storageAccountName, containerName, resourceGroupName, this.innerModel(), Context.NONE); + return this; + } + + public Container apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainers() + .createOrUpdate( + deviceName, storageAccountName, containerName, resourceGroupName, this.innerModel(), context); + return this; + } + + ContainerImpl(ContainerInner innerObject, DataBoxEdgeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.deviceName = Utils.getValueFromIdByName(innerObject.id(), "dataBoxEdgeDevices"); + this.storageAccountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.containerName = Utils.getValueFromIdByName(innerObject.id(), "containers"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + } + + public Container refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getContainers() + .getWithResponse(deviceName, storageAccountName, containerName, resourceGroupName, Context.NONE) + .getValue(); + return this; + } + + public Container refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainers() + .getWithResponse(deviceName, storageAccountName, containerName, resourceGroupName, context) + .getValue(); + return this; + } + + public ContainerImpl withDataFormat(AzureContainerDataFormat dataFormat) { + this.innerModel().withDataFormat(dataFormat); + return this; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ContainersClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ContainersClientImpl.java new file mode 100644 index 0000000000000..937fb62e3dbae --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ContainersClientImpl.java @@ -0,0 +1,1521 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.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.databoxedge.fluent.ContainersClient; +import com.azure.resourcemanager.databoxedge.fluent.models.ContainerInner; +import com.azure.resourcemanager.databoxedge.models.ContainerList; +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 ContainersClient. */ +public final class ContainersClientImpl implements ContainersClient { + private final ClientLogger logger = new ClientLogger(ContainersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ContainersService service; + + /** The service client containing this operation class. */ + private final DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of ContainersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainersClientImpl(DataBoxEdgeManagementClientImpl client) { + this.service = + RestProxy.create(ContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataBoxEdgeManagementClientContainers to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataBoxEdgeManagemen") + private interface ContainersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByStorageAccount( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("storageAccountName") String storageAccountName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("storageAccountName") String storageAccountName, + @PathParam("containerName") String containerName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("storageAccountName") String storageAccountName, + @PathParam("containerName") String containerName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ContainerInner container, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("storageAccountName") String storageAccountName, + @PathParam("containerName") String containerName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}" + + "/refresh") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> refresh( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("storageAccountName") String storageAccountName, + @PathParam("containerName") String containerName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByStorageAccountNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The storage Account name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the containers on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByStorageAccountSinglePageAsync( + String deviceName, String storageAccountName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (storageAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageAccountName is required and 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 + .listByStorageAccount( + this.client.getEndpoint(), + deviceName, + storageAccountName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The storage Account name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the containers on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByStorageAccountSinglePageAsync( + String deviceName, String storageAccountName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (storageAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageAccountName is required and 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 + .listByStorageAccount( + this.client.getEndpoint(), + deviceName, + storageAccountName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The storage Account name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the containers on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByStorageAccountAsync( + String deviceName, String storageAccountName, String resourceGroupName) { + return new PagedFlux<>( + () -> listByStorageAccountSinglePageAsync(deviceName, storageAccountName, resourceGroupName), + nextLink -> listByStorageAccountNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The storage Account name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the containers on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByStorageAccountAsync( + String deviceName, String storageAccountName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByStorageAccountSinglePageAsync(deviceName, storageAccountName, resourceGroupName, context), + nextLink -> listByStorageAccountNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The storage Account name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the containers on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByStorageAccount( + String deviceName, String storageAccountName, String resourceGroupName) { + return new PagedIterable<>(listByStorageAccountAsync(deviceName, storageAccountName, resourceGroupName)); + } + + /** + * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The storage Account name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the containers on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByStorageAccount( + String deviceName, String storageAccountName, String resourceGroupName, Context context) { + return new PagedIterable<>( + listByStorageAccountAsync(deviceName, storageAccountName, resourceGroupName, context)); + } + + /** + * Gets a container by name. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container Name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 container by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String deviceName, String storageAccountName, String containerName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); + } + 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 + .get( + this.client.getEndpoint(), + deviceName, + storageAccountName, + containerName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets a container by name. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container Name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 container by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String deviceName, String storageAccountName, String containerName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); + } + 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 + .get( + this.client.getEndpoint(), + deviceName, + storageAccountName, + containerName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a container by name. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container Name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 container by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String deviceName, String storageAccountName, String containerName, String resourceGroupName) { + return getWithResponseAsync(deviceName, storageAccountName, containerName, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a container by name. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container Name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 container by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerInner get( + String deviceName, String storageAccountName, String containerName, String resourceGroupName) { + return getAsync(deviceName, storageAccountName, containerName, resourceGroupName).block(); + } + + /** + * Gets a container by name. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container Name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 container by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String deviceName, String storageAccountName, String containerName, String resourceGroupName, Context context) { + return getWithResponseAsync(deviceName, storageAccountName, containerName, resourceGroupName, context).block(); + } + + /** + * Creates a new container or updates an existing container on the device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param container The container properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a container on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String deviceName, + String storageAccountName, + String containerName, + String resourceGroupName, + ContainerInner container) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); + } + 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 (container == null) { + return Mono.error(new IllegalArgumentException("Parameter container is required and cannot be null.")); + } else { + container.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + deviceName, + storageAccountName, + containerName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + container, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates a new container or updates an existing container on the device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param container The container properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a container on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String deviceName, + String storageAccountName, + String containerName, + String resourceGroupName, + ContainerInner container, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); + } + 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 (container == null) { + return Mono.error(new IllegalArgumentException("Parameter container is required and cannot be null.")); + } else { + container.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + deviceName, + storageAccountName, + containerName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + container, + accept, + context); + } + + /** + * Creates a new container or updates an existing container on the device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param container The container properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a container on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ContainerInner> beginCreateOrUpdateAsync( + String deviceName, + String storageAccountName, + String containerName, + String resourceGroupName, + ContainerInner container) { + Mono>> mono = + createOrUpdateWithResponseAsync( + deviceName, storageAccountName, containerName, resourceGroupName, container); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ContainerInner.class, ContainerInner.class, Context.NONE); + } + + /** + * Creates a new container or updates an existing container on the device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param container The container properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a container on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ContainerInner> beginCreateOrUpdateAsync( + String deviceName, + String storageAccountName, + String containerName, + String resourceGroupName, + ContainerInner container, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + deviceName, storageAccountName, containerName, resourceGroupName, container, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ContainerInner.class, ContainerInner.class, context); + } + + /** + * Creates a new container or updates an existing container on the device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param container The container properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a container on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ContainerInner> beginCreateOrUpdate( + String deviceName, + String storageAccountName, + String containerName, + String resourceGroupName, + ContainerInner container) { + return beginCreateOrUpdateAsync(deviceName, storageAccountName, containerName, resourceGroupName, container) + .getSyncPoller(); + } + + /** + * Creates a new container or updates an existing container on the device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param container The container properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a container on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ContainerInner> beginCreateOrUpdate( + String deviceName, + String storageAccountName, + String containerName, + String resourceGroupName, + ContainerInner container, + Context context) { + return beginCreateOrUpdateAsync( + deviceName, storageAccountName, containerName, resourceGroupName, container, context) + .getSyncPoller(); + } + + /** + * Creates a new container or updates an existing container on the device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param container The container properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a container on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String deviceName, + String storageAccountName, + String containerName, + String resourceGroupName, + ContainerInner container) { + return beginCreateOrUpdateAsync(deviceName, storageAccountName, containerName, resourceGroupName, container) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new container or updates an existing container on the device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param container The container properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a container on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String deviceName, + String storageAccountName, + String containerName, + String resourceGroupName, + ContainerInner container, + Context context) { + return beginCreateOrUpdateAsync( + deviceName, storageAccountName, containerName, resourceGroupName, container, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new container or updates an existing container on the device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param container The container properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a container on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerInner createOrUpdate( + String deviceName, + String storageAccountName, + String containerName, + String resourceGroupName, + ContainerInner container) { + return createOrUpdateAsync(deviceName, storageAccountName, containerName, resourceGroupName, container).block(); + } + + /** + * Creates a new container or updates an existing container on the device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param container The container properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a container on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerInner createOrUpdate( + String deviceName, + String storageAccountName, + String containerName, + String resourceGroupName, + ContainerInner container, + Context context) { + return createOrUpdateAsync(deviceName, storageAccountName, containerName, resourceGroupName, container, context) + .block(); + } + + /** + * Deletes the container on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String storageAccountName, String containerName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); + } + 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 + .delete( + this.client.getEndpoint(), + deviceName, + storageAccountName, + containerName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the container on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String storageAccountName, String containerName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); + } + 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 + .delete( + this.client.getEndpoint(), + deviceName, + storageAccountName, + containerName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the container on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String storageAccountName, String containerName, String resourceGroupName) { + Mono>> mono = + deleteWithResponseAsync(deviceName, storageAccountName, containerName, resourceGroupName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the container on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String storageAccountName, String containerName, String resourceGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(deviceName, storageAccountName, containerName, resourceGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the container on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String storageAccountName, String containerName, String resourceGroupName) { + return beginDeleteAsync(deviceName, storageAccountName, containerName, resourceGroupName).getSyncPoller(); + } + + /** + * Deletes the container on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String storageAccountName, String containerName, String resourceGroupName, Context context) { + return beginDeleteAsync(deviceName, storageAccountName, containerName, resourceGroupName, context) + .getSyncPoller(); + } + + /** + * Deletes the container on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String storageAccountName, String containerName, String resourceGroupName) { + return beginDeleteAsync(deviceName, storageAccountName, containerName, resourceGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the container on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String storageAccountName, String containerName, String resourceGroupName, Context context) { + return beginDeleteAsync(deviceName, storageAccountName, containerName, resourceGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the container on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deviceName, String storageAccountName, String containerName, String resourceGroupName) { + deleteAsync(deviceName, storageAccountName, containerName, resourceGroupName).block(); + } + + /** + * Deletes the container on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deviceName, String storageAccountName, String containerName, String resourceGroupName, Context context) { + deleteAsync(deviceName, storageAccountName, containerName, resourceGroupName, context).block(); + } + + /** + * Refreshes the container metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> refreshWithResponseAsync( + String deviceName, String storageAccountName, String containerName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); + } + 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 + .refresh( + this.client.getEndpoint(), + deviceName, + storageAccountName, + containerName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Refreshes the container metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> refreshWithResponseAsync( + String deviceName, String storageAccountName, String containerName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName 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.")); + } + 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 + .refresh( + this.client.getEndpoint(), + deviceName, + storageAccountName, + containerName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Refreshes the container metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRefreshAsync( + String deviceName, String storageAccountName, String containerName, String resourceGroupName) { + Mono>> mono = + refreshWithResponseAsync(deviceName, storageAccountName, containerName, resourceGroupName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Refreshes the container metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRefreshAsync( + String deviceName, String storageAccountName, String containerName, String resourceGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + refreshWithResponseAsync(deviceName, storageAccountName, containerName, resourceGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Refreshes the container metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRefresh( + String deviceName, String storageAccountName, String containerName, String resourceGroupName) { + return beginRefreshAsync(deviceName, storageAccountName, containerName, resourceGroupName).getSyncPoller(); + } + + /** + * Refreshes the container metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRefresh( + String deviceName, String storageAccountName, String containerName, String resourceGroupName, Context context) { + return beginRefreshAsync(deviceName, storageAccountName, containerName, resourceGroupName, context) + .getSyncPoller(); + } + + /** + * Refreshes the container metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 refreshAsync( + String deviceName, String storageAccountName, String containerName, String resourceGroupName) { + return beginRefreshAsync(deviceName, storageAccountName, containerName, resourceGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refreshes the container metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 refreshAsync( + String deviceName, String storageAccountName, String containerName, String resourceGroupName, Context context) { + return beginRefreshAsync(deviceName, storageAccountName, containerName, resourceGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refreshes the container metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 refresh(String deviceName, String storageAccountName, String containerName, String resourceGroupName) { + refreshAsync(deviceName, storageAccountName, containerName, resourceGroupName).block(); + } + + /** + * Refreshes the container metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 refresh( + String deviceName, String storageAccountName, String containerName, String resourceGroupName, Context context) { + refreshAsync(deviceName, storageAccountName, containerName, resourceGroupName, 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 collection of all the containers on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByStorageAccountNextSinglePageAsync(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.listByStorageAccountNext(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 collection of all the containers on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByStorageAccountNextSinglePageAsync( + 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 + .listByStorageAccountNext(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/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ContainersImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ContainersImpl.java new file mode 100644 index 0000000000000..6f2c706f3db20 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ContainersImpl.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.ContainersClient; +import com.azure.resourcemanager.databoxedge.fluent.models.ContainerInner; +import com.azure.resourcemanager.databoxedge.models.Container; +import com.azure.resourcemanager.databoxedge.models.Containers; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ContainersImpl implements Containers { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainersImpl.class); + + private final ContainersClient innerClient; + + private final DataBoxEdgeManager serviceManager; + + public ContainersImpl(ContainersClient innerClient, DataBoxEdgeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByStorageAccount( + String deviceName, String storageAccountName, String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByStorageAccount(deviceName, storageAccountName, resourceGroupName); + return inner.mapPage(inner1 -> new ContainerImpl(inner1, this.manager())); + } + + public PagedIterable listByStorageAccount( + String deviceName, String storageAccountName, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByStorageAccount(deviceName, storageAccountName, resourceGroupName, context); + return inner.mapPage(inner1 -> new ContainerImpl(inner1, this.manager())); + } + + public Container get(String deviceName, String storageAccountName, String containerName, String resourceGroupName) { + ContainerInner inner = + this.serviceClient().get(deviceName, storageAccountName, containerName, resourceGroupName); + if (inner != null) { + return new ContainerImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String deviceName, String storageAccountName, String containerName, String resourceGroupName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(deviceName, storageAccountName, containerName, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ContainerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String deviceName, String storageAccountName, String containerName, String resourceGroupName) { + this.serviceClient().delete(deviceName, storageAccountName, containerName, resourceGroupName); + } + + public void delete( + String deviceName, String storageAccountName, String containerName, String resourceGroupName, Context context) { + this.serviceClient().delete(deviceName, storageAccountName, containerName, resourceGroupName, context); + } + + public void refresh(String deviceName, String storageAccountName, String containerName, String resourceGroupName) { + this.serviceClient().refresh(deviceName, storageAccountName, containerName, resourceGroupName); + } + + public void refresh( + String deviceName, String storageAccountName, String containerName, String resourceGroupName, Context context) { + this.serviceClient().refresh(deviceName, storageAccountName, containerName, resourceGroupName, context); + } + + public Container getById(String id) { + String deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String storageAccountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (storageAccountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String containerName = Utils.getValueFromIdByName(id, "containers"); + if (containerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containers'.", id))); + } + String 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))); + } + return this + .getWithResponse(deviceName, storageAccountName, containerName, resourceGroupName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String storageAccountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (storageAccountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String containerName = Utils.getValueFromIdByName(id, "containers"); + if (containerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containers'.", id))); + } + String 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))); + } + return this.getWithResponse(deviceName, storageAccountName, containerName, resourceGroupName, context); + } + + public void deleteById(String id) { + String deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String storageAccountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (storageAccountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String containerName = Utils.getValueFromIdByName(id, "containers"); + if (containerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containers'.", id))); + } + String 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))); + } + this.delete(deviceName, storageAccountName, containerName, resourceGroupName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String storageAccountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (storageAccountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", id))); + } + String containerName = Utils.getValueFromIdByName(id, "containers"); + if (containerName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containers'.", id))); + } + String 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))); + } + this.delete(deviceName, storageAccountName, containerName, resourceGroupName, context); + } + + private ContainersClient serviceClient() { + return this.innerClient; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } + + public ContainerImpl define(String name) { + return new ContainerImpl(name, this.manager()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeDeviceExtendedInfoImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeDeviceExtendedInfoImpl.java new file mode 100644 index 0000000000000..979351ce9e154 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeDeviceExtendedInfoImpl.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.databoxedge.implementation; + +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceExtendedInfoInner; +import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceExtendedInfo; + +public final class DataBoxEdgeDeviceExtendedInfoImpl implements DataBoxEdgeDeviceExtendedInfo { + private DataBoxEdgeDeviceExtendedInfoInner innerObject; + + private final DataBoxEdgeManager serviceManager; + + DataBoxEdgeDeviceExtendedInfoImpl( + DataBoxEdgeDeviceExtendedInfoInner innerObject, DataBoxEdgeManager 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 encryptionKeyThumbprint() { + return this.innerModel().encryptionKeyThumbprint(); + } + + public String encryptionKey() { + return this.innerModel().encryptionKey(); + } + + public String resourceKey() { + return this.innerModel().resourceKey(); + } + + public DataBoxEdgeDeviceExtendedInfoInner innerModel() { + return this.innerObject; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeDeviceImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeDeviceImpl.java new file mode 100644 index 0000000000000..1477c73ef487a --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeDeviceImpl.java @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceInner; +import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDevice; +import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceExtendedInfo; +import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDevicePatch; +import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceStatus; +import com.azure.resourcemanager.databoxedge.models.DeviceType; +import com.azure.resourcemanager.databoxedge.models.RoleTypes; +import com.azure.resourcemanager.databoxedge.models.Sku; +import com.azure.resourcemanager.databoxedge.models.UploadCertificateRequest; +import com.azure.resourcemanager.databoxedge.models.UploadCertificateResponse; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class DataBoxEdgeDeviceImpl + implements DataBoxEdgeDevice, DataBoxEdgeDevice.Definition, DataBoxEdgeDevice.Update { + private DataBoxEdgeDeviceInner innerObject; + + private final DataBoxEdgeManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public DataBoxEdgeDeviceStatus dataBoxEdgeDeviceStatus() { + return this.innerModel().dataBoxEdgeDeviceStatus(); + } + + public String serialNumber() { + return this.innerModel().serialNumber(); + } + + public String description() { + return this.innerModel().description(); + } + + public String modelDescription() { + return this.innerModel().modelDescription(); + } + + public DeviceType deviceType() { + return this.innerModel().deviceType(); + } + + public String friendlyName() { + return this.innerModel().friendlyName(); + } + + public String culture() { + return this.innerModel().culture(); + } + + public String deviceModel() { + return this.innerModel().deviceModel(); + } + + public String deviceSoftwareVersion() { + return this.innerModel().deviceSoftwareVersion(); + } + + public Long deviceLocalCapacity() { + return this.innerModel().deviceLocalCapacity(); + } + + public String timeZone() { + return this.innerModel().timeZone(); + } + + public String deviceHcsVersion() { + return this.innerModel().deviceHcsVersion(); + } + + public List configuredRoleTypes() { + List inner = this.innerModel().configuredRoleTypes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Integer nodeCount() { + return this.innerModel().nodeCount(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public DataBoxEdgeDeviceInner innerModel() { + return this.innerObject; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } + + private String deviceName; + + private String resourceGroupName; + + private DataBoxEdgeDevicePatch updateParameters; + + public DataBoxEdgeDeviceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public DataBoxEdgeDevice create() { + this.innerObject = + serviceManager + .serviceClient() + .getDevices() + .createOrUpdate(deviceName, resourceGroupName, this.innerModel(), Context.NONE); + return this; + } + + public DataBoxEdgeDevice create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDevices() + .createOrUpdate(deviceName, resourceGroupName, this.innerModel(), context); + return this; + } + + DataBoxEdgeDeviceImpl(String name, DataBoxEdgeManager serviceManager) { + this.innerObject = new DataBoxEdgeDeviceInner(); + this.serviceManager = serviceManager; + this.deviceName = name; + } + + public DataBoxEdgeDeviceImpl update() { + this.updateParameters = new DataBoxEdgeDevicePatch(); + return this; + } + + public DataBoxEdgeDevice apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDevices() + .updateWithResponse(deviceName, resourceGroupName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public DataBoxEdgeDevice apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDevices() + .updateWithResponse(deviceName, resourceGroupName, updateParameters, context) + .getValue(); + return this; + } + + DataBoxEdgeDeviceImpl(DataBoxEdgeDeviceInner innerObject, DataBoxEdgeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.deviceName = Utils.getValueFromIdByName(innerObject.id(), "dataBoxEdgeDevices"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + } + + public DataBoxEdgeDevice refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDevices() + .getByResourceGroupWithResponse(resourceGroupName, deviceName, Context.NONE) + .getValue(); + return this; + } + + public DataBoxEdgeDevice refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDevices() + .getByResourceGroupWithResponse(resourceGroupName, deviceName, context) + .getValue(); + return this; + } + + public void downloadUpdates() { + serviceManager.devices().downloadUpdates(deviceName, resourceGroupName); + } + + public void downloadUpdates(Context context) { + serviceManager.devices().downloadUpdates(deviceName, resourceGroupName, context); + } + + public DataBoxEdgeDeviceExtendedInfo getExtendedInformation() { + return serviceManager.devices().getExtendedInformation(deviceName, resourceGroupName); + } + + public Response getExtendedInformationWithResponse(Context context) { + return serviceManager.devices().getExtendedInformationWithResponse(deviceName, resourceGroupName, context); + } + + public void installUpdates() { + serviceManager.devices().installUpdates(deviceName, resourceGroupName); + } + + public void installUpdates(Context context) { + serviceManager.devices().installUpdates(deviceName, resourceGroupName, context); + } + + public void scanForUpdates() { + serviceManager.devices().scanForUpdates(deviceName, resourceGroupName); + } + + public void scanForUpdates(Context context) { + serviceManager.devices().scanForUpdates(deviceName, resourceGroupName, context); + } + + public UploadCertificateResponse uploadCertificate(UploadCertificateRequest parameters) { + return serviceManager.devices().uploadCertificate(deviceName, resourceGroupName, parameters); + } + + public Response uploadCertificateWithResponse( + UploadCertificateRequest parameters, Context context) { + return serviceManager + .devices() + .uploadCertificateWithResponse(deviceName, resourceGroupName, parameters, context); + } + + public DataBoxEdgeDeviceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DataBoxEdgeDeviceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DataBoxEdgeDeviceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public DataBoxEdgeDeviceImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + public DataBoxEdgeDeviceImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public DataBoxEdgeDeviceImpl withDataBoxEdgeDeviceStatus(DataBoxEdgeDeviceStatus dataBoxEdgeDeviceStatus) { + this.innerModel().withDataBoxEdgeDeviceStatus(dataBoxEdgeDeviceStatus); + return this; + } + + public DataBoxEdgeDeviceImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public DataBoxEdgeDeviceImpl withModelDescription(String modelDescription) { + this.innerModel().withModelDescription(modelDescription); + return this; + } + + public DataBoxEdgeDeviceImpl withFriendlyName(String friendlyName) { + this.innerModel().withFriendlyName(friendlyName); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeManagementClientBuilder.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeManagementClientBuilder.java new file mode 100644 index 0000000000000..243dc1659fd7c --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeManagementClientBuilder.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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 DataBoxEdgeManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {DataBoxEdgeManagementClientImpl.class}) +public final class DataBoxEdgeManagementClientBuilder { + /* + * The subscription ID. + */ + private String subscriptionId; + + /** + * Sets The subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the DataBoxEdgeManagementClientBuilder. + */ + public DataBoxEdgeManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the DataBoxEdgeManagementClientBuilder. + */ + public DataBoxEdgeManagementClientBuilder 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 DataBoxEdgeManagementClientBuilder. + */ + public DataBoxEdgeManagementClientBuilder 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 DataBoxEdgeManagementClientBuilder. + */ + public DataBoxEdgeManagementClientBuilder 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 DataBoxEdgeManagementClientBuilder. + */ + public DataBoxEdgeManagementClientBuilder 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 DataBoxEdgeManagementClientBuilder. + */ + public DataBoxEdgeManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of DataBoxEdgeManagementClientImpl with the provided parameters. + * + * @return an instance of DataBoxEdgeManagementClientImpl. + */ + public DataBoxEdgeManagementClientImpl 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(); + } + DataBoxEdgeManagementClientImpl client = + new DataBoxEdgeManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeManagementClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeManagementClientImpl.java new file mode 100644 index 0000000000000..82130baaadf68 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DataBoxEdgeManagementClientImpl.java @@ -0,0 +1,503 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.databoxedge.fluent.AlertsClient; +import com.azure.resourcemanager.databoxedge.fluent.BandwidthSchedulesClient; +import com.azure.resourcemanager.databoxedge.fluent.ContainersClient; +import com.azure.resourcemanager.databoxedge.fluent.DataBoxEdgeManagementClient; +import com.azure.resourcemanager.databoxedge.fluent.DevicesClient; +import com.azure.resourcemanager.databoxedge.fluent.JobsClient; +import com.azure.resourcemanager.databoxedge.fluent.NodesClient; +import com.azure.resourcemanager.databoxedge.fluent.OperationsClient; +import com.azure.resourcemanager.databoxedge.fluent.OperationsStatusClient; +import com.azure.resourcemanager.databoxedge.fluent.OrdersClient; +import com.azure.resourcemanager.databoxedge.fluent.RolesClient; +import com.azure.resourcemanager.databoxedge.fluent.SharesClient; +import com.azure.resourcemanager.databoxedge.fluent.SkusClient; +import com.azure.resourcemanager.databoxedge.fluent.StorageAccountCredentialsClient; +import com.azure.resourcemanager.databoxedge.fluent.StorageAccountsClient; +import com.azure.resourcemanager.databoxedge.fluent.TriggersClient; +import com.azure.resourcemanager.databoxedge.fluent.UsersClient; +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 DataBoxEdgeManagementClientImpl type. */ +@ServiceClient(builder = DataBoxEdgeManagementClientBuilder.class) +public final class DataBoxEdgeManagementClientImpl implements DataBoxEdgeManagementClient { + private final ClientLogger logger = new ClientLogger(DataBoxEdgeManagementClientImpl.class); + + /** The subscription ID. */ + private final String subscriptionId; + + /** + * Gets The subscription ID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The DevicesClient object to access its operations. */ + private final DevicesClient devices; + + /** + * Gets the DevicesClient object to access its operations. + * + * @return the DevicesClient object. + */ + public DevicesClient getDevices() { + return this.devices; + } + + /** The AlertsClient object to access its operations. */ + private final AlertsClient alerts; + + /** + * Gets the AlertsClient object to access its operations. + * + * @return the AlertsClient object. + */ + public AlertsClient getAlerts() { + return this.alerts; + } + + /** The BandwidthSchedulesClient object to access its operations. */ + private final BandwidthSchedulesClient bandwidthSchedules; + + /** + * Gets the BandwidthSchedulesClient object to access its operations. + * + * @return the BandwidthSchedulesClient object. + */ + public BandwidthSchedulesClient getBandwidthSchedules() { + return this.bandwidthSchedules; + } + + /** The JobsClient object to access its operations. */ + private final JobsClient jobs; + + /** + * Gets the JobsClient object to access its operations. + * + * @return the JobsClient object. + */ + public JobsClient getJobs() { + return this.jobs; + } + + /** The NodesClient object to access its operations. */ + private final NodesClient nodes; + + /** + * Gets the NodesClient object to access its operations. + * + * @return the NodesClient object. + */ + public NodesClient getNodes() { + return this.nodes; + } + + /** The OperationsStatusClient object to access its operations. */ + private final OperationsStatusClient operationsStatus; + + /** + * Gets the OperationsStatusClient object to access its operations. + * + * @return the OperationsStatusClient object. + */ + public OperationsStatusClient getOperationsStatus() { + return this.operationsStatus; + } + + /** The OrdersClient object to access its operations. */ + private final OrdersClient orders; + + /** + * Gets the OrdersClient object to access its operations. + * + * @return the OrdersClient object. + */ + public OrdersClient getOrders() { + return this.orders; + } + + /** The RolesClient object to access its operations. */ + private final RolesClient roles; + + /** + * Gets the RolesClient object to access its operations. + * + * @return the RolesClient object. + */ + public RolesClient getRoles() { + return this.roles; + } + + /** The SharesClient object to access its operations. */ + private final SharesClient shares; + + /** + * Gets the SharesClient object to access its operations. + * + * @return the SharesClient object. + */ + public SharesClient getShares() { + return this.shares; + } + + /** The StorageAccountCredentialsClient object to access its operations. */ + private final StorageAccountCredentialsClient storageAccountCredentials; + + /** + * Gets the StorageAccountCredentialsClient object to access its operations. + * + * @return the StorageAccountCredentialsClient object. + */ + public StorageAccountCredentialsClient getStorageAccountCredentials() { + return this.storageAccountCredentials; + } + + /** 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 ContainersClient object to access its operations. */ + private final ContainersClient containers; + + /** + * Gets the ContainersClient object to access its operations. + * + * @return the ContainersClient object. + */ + public ContainersClient getContainers() { + return this.containers; + } + + /** The TriggersClient object to access its operations. */ + private final TriggersClient triggers; + + /** + * Gets the TriggersClient object to access its operations. + * + * @return the TriggersClient object. + */ + public TriggersClient getTriggers() { + return this.triggers; + } + + /** The UsersClient object to access its operations. */ + private final UsersClient users; + + /** + * Gets the UsersClient object to access its operations. + * + * @return the UsersClient object. + */ + public UsersClient getUsers() { + return this.users; + } + + /** The SkusClient object to access its operations. */ + private final SkusClient skus; + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + public SkusClient getSkus() { + return this.skus; + } + + /** + * Initializes an instance of DataBoxEdgeManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The subscription ID. + * @param endpoint server parameter. + */ + DataBoxEdgeManagementClientImpl( + 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 = "2019-08-01"; + this.operations = new OperationsClientImpl(this); + this.devices = new DevicesClientImpl(this); + this.alerts = new AlertsClientImpl(this); + this.bandwidthSchedules = new BandwidthSchedulesClientImpl(this); + this.jobs = new JobsClientImpl(this); + this.nodes = new NodesClientImpl(this); + this.operationsStatus = new OperationsStatusClientImpl(this); + this.orders = new OrdersClientImpl(this); + this.roles = new RolesClientImpl(this); + this.shares = new SharesClientImpl(this); + this.storageAccountCredentials = new StorageAccountCredentialsClientImpl(this); + this.storageAccounts = new StorageAccountsClientImpl(this); + this.containers = new ContainersClientImpl(this); + this.triggers = new TriggersClientImpl(this); + this.users = new UsersClientImpl(this); + this.skus = new SkusClientImpl(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 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.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/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DevicesClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DevicesClientImpl.java new file mode 100644 index 0000000000000..28ef6ef8b6fc1 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DevicesClientImpl.java @@ -0,0 +1,3210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.databoxedge.fluent.DevicesClient; +import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceExtendedInfoInner; +import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceInner; +import com.azure.resourcemanager.databoxedge.fluent.models.NetworkSettingsInner; +import com.azure.resourcemanager.databoxedge.fluent.models.UpdateSummaryInner; +import com.azure.resourcemanager.databoxedge.fluent.models.UploadCertificateResponseInner; +import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceList; +import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDevicePatch; +import com.azure.resourcemanager.databoxedge.models.SecuritySettings; +import com.azure.resourcemanager.databoxedge.models.UploadCertificateRequest; +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 DevicesClient. */ +public final class DevicesClientImpl implements DevicesClient { + private final ClientLogger logger = new ClientLogger(DevicesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DevicesService service; + + /** The service client containing this operation class. */ + private final DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of DevicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DevicesClientImpl(DataBoxEdgeManagementClientImpl client) { + this.service = RestProxy.create(DevicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataBoxEdgeManagementClientDevices to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataBoxEdgeManagemen") + private interface DevicesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("deviceName") String deviceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DataBoxEdgeDeviceInner dataBoxEdgeDevice, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("deviceName") String deviceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DataBoxEdgeDevicePatch parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/downloadUpdates") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> downloadUpdates( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/getExtendedInformation") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getExtendedInformation( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/installUpdates") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> installUpdates( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/networkSettings/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getNetworkSettings( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/scanForUpdates") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> scanForUpdates( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdateSecuritySettings( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SecuritySettings securitySettings, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/updateSummary/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getUpdateSummary( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/uploadCertificate") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> uploadCertificate( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UploadCertificateRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + * + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Data Box Edge/Data Box Gateway devices in a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + expand, + 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 all the Data Box Edge/Data Box Gateway devices in a subscription. + * + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the list. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Data Box Edge/Data Box Gateway devices in a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + expand, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + * + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Data Box Edge/Data Box Gateway devices in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String expand) { + return new PagedFlux<>( + () -> listSinglePageAsync(expand), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Data Box Edge/Data Box Gateway devices in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String expand = null; + return new PagedFlux<>( + () -> listSinglePageAsync(expand), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + * + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the list. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Data Box Edge/Data Box Gateway devices in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String expand, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(expand, context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Data Box Edge/Data Box Gateway devices in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String expand = null; + return new PagedIterable<>(listAsync(expand)); + } + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + * + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the list. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Data Box Edge/Data Box Gateway devices in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String expand, Context context) { + return new PagedIterable<>(listAsync(expand, context)); + } + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + * + * @param resourceGroupName The resource group name. + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Data Box Edge/Data Box Gateway devices in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + expand, + 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 all the Data Box Edge/Data Box Gateway devices in a resource group. + * + * @param resourceGroupName The resource group name. + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the list. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Data Box Edge/Data Box Gateway devices in a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + expand, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + * + * @param resourceGroupName The resource group name. + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Data Box Edge/Data Box Gateway devices in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String expand) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + * + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Data Box Edge/Data Box Gateway devices in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String expand = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + * + * @param resourceGroupName The resource group name. + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the list. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Data Box Edge/Data Box Gateway devices in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String expand, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, expand, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + * + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Data Box Edge/Data Box Gateway devices in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String expand = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, expand)); + } + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + * + * @param resourceGroupName The resource group name. + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the list. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Data Box Edge/Data Box Gateway devices in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String expand, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, expand, context)); + } + + /** + * Gets the properties of the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The resource group name. + * @param deviceName The device name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String deviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + deviceName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the properties of the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The resource group name. + * @param deviceName The device name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String deviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + deviceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the properties of the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The resource group name. + * @param deviceName The device name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String deviceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, deviceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the properties of the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The resource group name. + * @param deviceName The device name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataBoxEdgeDeviceInner getByResourceGroup(String resourceGroupName, String deviceName) { + return getByResourceGroupAsync(resourceGroupName, deviceName).block(); + } + + /** + * Gets the properties of the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The resource group name. + * @param deviceName The device name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String deviceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, deviceName, context).block(); + } + + /** + * Creates or updates a Data Box Edge/Data Box Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param dataBoxEdgeDevice The resource object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 (dataBoxEdgeDevice == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataBoxEdgeDevice is required and cannot be null.")); + } else { + dataBoxEdgeDevice.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + dataBoxEdgeDevice, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates a Data Box Edge/Data Box Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param dataBoxEdgeDevice The resource object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 (dataBoxEdgeDevice == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataBoxEdgeDevice is required and cannot be null.")); + } else { + dataBoxEdgeDevice.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + dataBoxEdgeDevice, + accept, + context); + } + + /** + * Creates or updates a Data Box Edge/Data Box Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param dataBoxEdgeDevice The resource object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataBoxEdgeDeviceInner> beginCreateOrUpdateAsync( + String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice) { + Mono>> mono = + createOrUpdateWithResponseAsync(deviceName, resourceGroupName, dataBoxEdgeDevice); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DataBoxEdgeDeviceInner.class, + DataBoxEdgeDeviceInner.class, + Context.NONE); + } + + /** + * Creates or updates a Data Box Edge/Data Box Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param dataBoxEdgeDevice The resource object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataBoxEdgeDeviceInner> beginCreateOrUpdateAsync( + String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(deviceName, resourceGroupName, dataBoxEdgeDevice, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DataBoxEdgeDeviceInner.class, + DataBoxEdgeDeviceInner.class, + context); + } + + /** + * Creates or updates a Data Box Edge/Data Box Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param dataBoxEdgeDevice The resource object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataBoxEdgeDeviceInner> beginCreateOrUpdate( + String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice) { + return beginCreateOrUpdateAsync(deviceName, resourceGroupName, dataBoxEdgeDevice).getSyncPoller(); + } + + /** + * Creates or updates a Data Box Edge/Data Box Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param dataBoxEdgeDevice The resource object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataBoxEdgeDeviceInner> beginCreateOrUpdate( + String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice, Context context) { + return beginCreateOrUpdateAsync(deviceName, resourceGroupName, dataBoxEdgeDevice, context).getSyncPoller(); + } + + /** + * Creates or updates a Data Box Edge/Data Box Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param dataBoxEdgeDevice The resource object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice) { + return beginCreateOrUpdateAsync(deviceName, resourceGroupName, dataBoxEdgeDevice) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a Data Box Edge/Data Box Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param dataBoxEdgeDevice The resource object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice, Context context) { + return beginCreateOrUpdateAsync(deviceName, resourceGroupName, dataBoxEdgeDevice, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a Data Box Edge/Data Box Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param dataBoxEdgeDevice The resource object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataBoxEdgeDeviceInner createOrUpdate( + String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice) { + return createOrUpdateAsync(deviceName, resourceGroupName, dataBoxEdgeDevice).block(); + } + + /** + * Creates or updates a Data Box Edge/Data Box Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param dataBoxEdgeDevice The resource object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataBoxEdgeDeviceInner createOrUpdate( + String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice, Context context) { + return createOrUpdateAsync(deviceName, resourceGroupName, dataBoxEdgeDevice, context).block(); + } + + /** + * Deletes the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The resource group name. + * @param deviceName The device name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + deviceName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The resource group name. + * @param deviceName The device name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + deviceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The resource group name. + * @param deviceName The device name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, deviceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The resource group name. + * @param deviceName The device name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, deviceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The resource group name. + * @param deviceName The device name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName) { + return beginDeleteAsync(resourceGroupName, deviceName).getSyncPoller(); + } + + /** + * Deletes the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The resource group name. + * @param deviceName The device name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, Context context) { + return beginDeleteAsync(resourceGroupName, deviceName, context).getSyncPoller(); + } + + /** + * Deletes the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The resource group name. + * @param deviceName The device name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName) { + return beginDeleteAsync(resourceGroupName, deviceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The resource group name. + * @param deviceName The device name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, Context context) { + return beginDeleteAsync(resourceGroupName, deviceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The resource group name. + * @param deviceName The device name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deviceName) { + deleteAsync(resourceGroupName, deviceName).block(); + } + + /** + * Deletes the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The resource group name. + * @param deviceName The device name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deviceName, Context context) { + deleteAsync(resourceGroupName, deviceName, context).block(); + } + + /** + * Modifies a Data Box Edge/Data Box Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The resource parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String deviceName, String resourceGroupName, DataBoxEdgeDevicePatch parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Modifies a Data Box Edge/Data Box Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The resource parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String deviceName, String resourceGroupName, DataBoxEdgeDevicePatch parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Modifies a Data Box Edge/Data Box Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The resource parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String deviceName, String resourceGroupName, DataBoxEdgeDevicePatch parameters) { + return updateWithResponseAsync(deviceName, resourceGroupName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Modifies a Data Box Edge/Data Box Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The resource parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataBoxEdgeDeviceInner update( + String deviceName, String resourceGroupName, DataBoxEdgeDevicePatch parameters) { + return updateAsync(deviceName, resourceGroupName, parameters).block(); + } + + /** + * Modifies a Data Box Edge/Data Box Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The resource parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String deviceName, String resourceGroupName, DataBoxEdgeDevicePatch parameters, Context context) { + return updateWithResponseAsync(deviceName, resourceGroupName, parameters, context).block(); + } + + /** + * Downloads the updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> downloadUpdatesWithResponseAsync( + String deviceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .downloadUpdates( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Downloads the updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> downloadUpdatesWithResponseAsync( + String deviceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .downloadUpdates( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Downloads the updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDownloadUpdatesAsync(String deviceName, String resourceGroupName) { + Mono>> mono = downloadUpdatesWithResponseAsync(deviceName, resourceGroupName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Downloads the updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDownloadUpdatesAsync( + String deviceName, String resourceGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + downloadUpdatesWithResponseAsync(deviceName, resourceGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Downloads the updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDownloadUpdates(String deviceName, String resourceGroupName) { + return beginDownloadUpdatesAsync(deviceName, resourceGroupName).getSyncPoller(); + } + + /** + * Downloads the updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDownloadUpdates( + String deviceName, String resourceGroupName, Context context) { + return beginDownloadUpdatesAsync(deviceName, resourceGroupName, context).getSyncPoller(); + } + + /** + * Downloads the updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 downloadUpdatesAsync(String deviceName, String resourceGroupName) { + return beginDownloadUpdatesAsync(deviceName, resourceGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Downloads the updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 downloadUpdatesAsync(String deviceName, String resourceGroupName, Context context) { + return beginDownloadUpdatesAsync(deviceName, resourceGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Downloads the updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 downloadUpdates(String deviceName, String resourceGroupName) { + downloadUpdatesAsync(deviceName, resourceGroupName).block(); + } + + /** + * Downloads the updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 downloadUpdates(String deviceName, String resourceGroupName, Context context) { + downloadUpdatesAsync(deviceName, resourceGroupName, context).block(); + } + + /** + * Gets additional information for the specified Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return additional information for the specified Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getExtendedInformationWithResponseAsync( + String deviceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .getExtendedInformation( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets additional information for the specified Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return additional information for the specified Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getExtendedInformationWithResponseAsync( + String deviceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .getExtendedInformation( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets additional information for the specified Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return additional information for the specified Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getExtendedInformationAsync( + String deviceName, String resourceGroupName) { + return getExtendedInformationWithResponseAsync(deviceName, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets additional information for the specified Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return additional information for the specified Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataBoxEdgeDeviceExtendedInfoInner getExtendedInformation(String deviceName, String resourceGroupName) { + return getExtendedInformationAsync(deviceName, resourceGroupName).block(); + } + + /** + * Gets additional information for the specified Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return additional information for the specified Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getExtendedInformationWithResponse( + String deviceName, String resourceGroupName, Context context) { + return getExtendedInformationWithResponseAsync(deviceName, resourceGroupName, context).block(); + } + + /** + * Installs the updates on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> installUpdatesWithResponseAsync( + String deviceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .installUpdates( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Installs the updates on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> installUpdatesWithResponseAsync( + String deviceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .installUpdates( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Installs the updates on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginInstallUpdatesAsync(String deviceName, String resourceGroupName) { + Mono>> mono = installUpdatesWithResponseAsync(deviceName, resourceGroupName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Installs the updates on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginInstallUpdatesAsync( + String deviceName, String resourceGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = installUpdatesWithResponseAsync(deviceName, resourceGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Installs the updates on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginInstallUpdates(String deviceName, String resourceGroupName) { + return beginInstallUpdatesAsync(deviceName, resourceGroupName).getSyncPoller(); + } + + /** + * Installs the updates on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginInstallUpdates( + String deviceName, String resourceGroupName, Context context) { + return beginInstallUpdatesAsync(deviceName, resourceGroupName, context).getSyncPoller(); + } + + /** + * Installs the updates on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 installUpdatesAsync(String deviceName, String resourceGroupName) { + return beginInstallUpdatesAsync(deviceName, resourceGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Installs the updates on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 installUpdatesAsync(String deviceName, String resourceGroupName, Context context) { + return beginInstallUpdatesAsync(deviceName, resourceGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Installs the updates on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 installUpdates(String deviceName, String resourceGroupName) { + installUpdatesAsync(deviceName, resourceGroupName).block(); + } + + /** + * Installs the updates on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 installUpdates(String deviceName, String resourceGroupName, Context context) { + installUpdatesAsync(deviceName, resourceGroupName, context).block(); + } + + /** + * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network settings of the specified Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getNetworkSettingsWithResponseAsync( + String deviceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .getNetworkSettings( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network settings of the specified Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getNetworkSettingsWithResponseAsync( + String deviceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .getNetworkSettings( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network settings of the specified Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getNetworkSettingsAsync(String deviceName, String resourceGroupName) { + return getNetworkSettingsWithResponseAsync(deviceName, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network settings of the specified Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkSettingsInner getNetworkSettings(String deviceName, String resourceGroupName) { + return getNetworkSettingsAsync(deviceName, resourceGroupName).block(); + } + + /** + * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network settings of the specified Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getNetworkSettingsWithResponse( + String deviceName, String resourceGroupName, Context context) { + return getNetworkSettingsWithResponseAsync(deviceName, resourceGroupName, context).block(); + } + + /** + * Scans for updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> scanForUpdatesWithResponseAsync( + String deviceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .scanForUpdates( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Scans for updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> scanForUpdatesWithResponseAsync( + String deviceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .scanForUpdates( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Scans for updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginScanForUpdatesAsync(String deviceName, String resourceGroupName) { + Mono>> mono = scanForUpdatesWithResponseAsync(deviceName, resourceGroupName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Scans for updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginScanForUpdatesAsync( + String deviceName, String resourceGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = scanForUpdatesWithResponseAsync(deviceName, resourceGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Scans for updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginScanForUpdates(String deviceName, String resourceGroupName) { + return beginScanForUpdatesAsync(deviceName, resourceGroupName).getSyncPoller(); + } + + /** + * Scans for updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginScanForUpdates( + String deviceName, String resourceGroupName, Context context) { + return beginScanForUpdatesAsync(deviceName, resourceGroupName, context).getSyncPoller(); + } + + /** + * Scans for updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 scanForUpdatesAsync(String deviceName, String resourceGroupName) { + return beginScanForUpdatesAsync(deviceName, resourceGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Scans for updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 scanForUpdatesAsync(String deviceName, String resourceGroupName, Context context) { + return beginScanForUpdatesAsync(deviceName, resourceGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Scans for updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 scanForUpdates(String deviceName, String resourceGroupName) { + scanForUpdatesAsync(deviceName, resourceGroupName).block(); + } + + /** + * Scans for updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 scanForUpdates(String deviceName, String resourceGroupName, Context context) { + scanForUpdatesAsync(deviceName, resourceGroupName, context).block(); + } + + /** + * Updates the security settings on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> createOrUpdateSecuritySettingsWithResponseAsync( + String deviceName, String resourceGroupName, SecuritySettings securitySettings) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 (securitySettings == null) { + return Mono + .error(new IllegalArgumentException("Parameter securitySettings is required and cannot be null.")); + } else { + securitySettings.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdateSecuritySettings( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + securitySettings, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the security settings on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> createOrUpdateSecuritySettingsWithResponseAsync( + String deviceName, String resourceGroupName, SecuritySettings securitySettings, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 (securitySettings == null) { + return Mono + .error(new IllegalArgumentException("Parameter securitySettings is required and cannot be null.")); + } else { + securitySettings.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdateSecuritySettings( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + securitySettings, + accept, + context); + } + + /** + * Updates the security settings on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginCreateOrUpdateSecuritySettingsAsync( + String deviceName, String resourceGroupName, SecuritySettings securitySettings) { + Mono>> mono = + createOrUpdateSecuritySettingsWithResponseAsync(deviceName, resourceGroupName, securitySettings); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Updates the security settings on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginCreateOrUpdateSecuritySettingsAsync( + String deviceName, String resourceGroupName, SecuritySettings securitySettings, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateSecuritySettingsWithResponseAsync(deviceName, resourceGroupName, securitySettings, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Updates the security settings on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginCreateOrUpdateSecuritySettings( + String deviceName, String resourceGroupName, SecuritySettings securitySettings) { + return beginCreateOrUpdateSecuritySettingsAsync(deviceName, resourceGroupName, securitySettings) + .getSyncPoller(); + } + + /** + * Updates the security settings on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginCreateOrUpdateSecuritySettings( + String deviceName, String resourceGroupName, SecuritySettings securitySettings, Context context) { + return beginCreateOrUpdateSecuritySettingsAsync(deviceName, resourceGroupName, securitySettings, context) + .getSyncPoller(); + } + + /** + * Updates the security settings on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 createOrUpdateSecuritySettingsAsync( + String deviceName, String resourceGroupName, SecuritySettings securitySettings) { + return beginCreateOrUpdateSecuritySettingsAsync(deviceName, resourceGroupName, securitySettings) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the security settings on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 createOrUpdateSecuritySettingsAsync( + String deviceName, String resourceGroupName, SecuritySettings securitySettings, Context context) { + return beginCreateOrUpdateSecuritySettingsAsync(deviceName, resourceGroupName, securitySettings, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the security settings on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 createOrUpdateSecuritySettings( + String deviceName, String resourceGroupName, SecuritySettings securitySettings) { + createOrUpdateSecuritySettingsAsync(deviceName, resourceGroupName, securitySettings).block(); + } + + /** + * Updates the security settings on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 createOrUpdateSecuritySettings( + String deviceName, String resourceGroupName, SecuritySettings securitySettings, Context context) { + createOrUpdateSecuritySettingsAsync(deviceName, resourceGroupName, securitySettings, context).block(); + } + + /** + * Gets information about the availability of updates based on the last scan of the device. It also gets information + * about any ongoing download or install jobs on the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the availability of updates based on the last scan of the device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getUpdateSummaryWithResponseAsync( + String deviceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .getUpdateSummary( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets information about the availability of updates based on the last scan of the device. It also gets information + * about any ongoing download or install jobs on the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the availability of updates based on the last scan of the device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getUpdateSummaryWithResponseAsync( + String deviceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .getUpdateSummary( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets information about the availability of updates based on the last scan of the device. It also gets information + * about any ongoing download or install jobs on the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the availability of updates based on the last scan of the device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getUpdateSummaryAsync(String deviceName, String resourceGroupName) { + return getUpdateSummaryWithResponseAsync(deviceName, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets information about the availability of updates based on the last scan of the device. It also gets information + * about any ongoing download or install jobs on the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the availability of updates based on the last scan of the device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateSummaryInner getUpdateSummary(String deviceName, String resourceGroupName) { + return getUpdateSummaryAsync(deviceName, resourceGroupName).block(); + } + + /** + * Gets information about the availability of updates based on the last scan of the device. It also gets information + * about any ongoing download or install jobs on the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the availability of updates based on the last scan of the device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getUpdateSummaryWithResponse( + String deviceName, String resourceGroupName, Context context) { + return getUpdateSummaryWithResponseAsync(deviceName, resourceGroupName, context).block(); + } + + /** + * Uploads registration certificate for the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload registration certificate response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> uploadCertificateWithResponseAsync( + String deviceName, String resourceGroupName, UploadCertificateRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 (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 + .uploadCertificate( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Uploads registration certificate for the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The upload certificate request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload registration certificate response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> uploadCertificateWithResponseAsync( + String deviceName, String resourceGroupName, UploadCertificateRequest parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 (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 + .uploadCertificate( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Uploads registration certificate for the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload registration certificate response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono uploadCertificateAsync( + String deviceName, String resourceGroupName, UploadCertificateRequest parameters) { + return uploadCertificateWithResponseAsync(deviceName, resourceGroupName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Uploads registration certificate for the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload registration certificate response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UploadCertificateResponseInner uploadCertificate( + String deviceName, String resourceGroupName, UploadCertificateRequest parameters) { + return uploadCertificateAsync(deviceName, resourceGroupName, parameters).block(); + } + + /** + * Uploads registration certificate for the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The upload certificate request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload registration certificate response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response uploadCertificateWithResponse( + String deviceName, String resourceGroupName, UploadCertificateRequest parameters, Context context) { + return uploadCertificateWithResponseAsync(deviceName, resourceGroupName, 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 the collection of Data Box Edge/Gateway devices. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .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 collection of Data Box Edge/Gateway devices. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of Data Box Edge/Gateway devices. + */ + @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 the collection of Data Box Edge/Gateway devices. + */ + @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/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DevicesImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DevicesImpl.java new file mode 100644 index 0000000000000..53dab88251abe --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/DevicesImpl.java @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.DevicesClient; +import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceExtendedInfoInner; +import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceInner; +import com.azure.resourcemanager.databoxedge.fluent.models.NetworkSettingsInner; +import com.azure.resourcemanager.databoxedge.fluent.models.UpdateSummaryInner; +import com.azure.resourcemanager.databoxedge.fluent.models.UploadCertificateResponseInner; +import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDevice; +import com.azure.resourcemanager.databoxedge.models.DataBoxEdgeDeviceExtendedInfo; +import com.azure.resourcemanager.databoxedge.models.Devices; +import com.azure.resourcemanager.databoxedge.models.NetworkSettings; +import com.azure.resourcemanager.databoxedge.models.SecuritySettings; +import com.azure.resourcemanager.databoxedge.models.UpdateSummary; +import com.azure.resourcemanager.databoxedge.models.UploadCertificateRequest; +import com.azure.resourcemanager.databoxedge.models.UploadCertificateResponse; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DevicesImpl implements Devices { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DevicesImpl.class); + + private final DevicesClient innerClient; + + private final DataBoxEdgeManager serviceManager; + + public DevicesImpl(DevicesClient innerClient, DataBoxEdgeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return inner.mapPage(inner1 -> new DataBoxEdgeDeviceImpl(inner1, this.manager())); + } + + public PagedIterable list(String expand, Context context) { + PagedIterable inner = this.serviceClient().list(expand, context); + return inner.mapPage(inner1 -> new DataBoxEdgeDeviceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return inner.mapPage(inner1 -> new DataBoxEdgeDeviceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, String expand, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, expand, context); + return inner.mapPage(inner1 -> new DataBoxEdgeDeviceImpl(inner1, this.manager())); + } + + public DataBoxEdgeDevice getByResourceGroup(String resourceGroupName, String deviceName) { + DataBoxEdgeDeviceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, deviceName); + if (inner != null) { + return new DataBoxEdgeDeviceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String deviceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, deviceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DataBoxEdgeDeviceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String deviceName) { + this.serviceClient().delete(resourceGroupName, deviceName); + } + + public void delete(String resourceGroupName, String deviceName, Context context) { + this.serviceClient().delete(resourceGroupName, deviceName, context); + } + + public void downloadUpdates(String deviceName, String resourceGroupName) { + this.serviceClient().downloadUpdates(deviceName, resourceGroupName); + } + + public void downloadUpdates(String deviceName, String resourceGroupName, Context context) { + this.serviceClient().downloadUpdates(deviceName, resourceGroupName, context); + } + + public DataBoxEdgeDeviceExtendedInfo getExtendedInformation(String deviceName, String resourceGroupName) { + DataBoxEdgeDeviceExtendedInfoInner inner = + this.serviceClient().getExtendedInformation(deviceName, resourceGroupName); + if (inner != null) { + return new DataBoxEdgeDeviceExtendedInfoImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getExtendedInformationWithResponse( + String deviceName, String resourceGroupName, Context context) { + Response inner = + this.serviceClient().getExtendedInformationWithResponse(deviceName, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DataBoxEdgeDeviceExtendedInfoImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void installUpdates(String deviceName, String resourceGroupName) { + this.serviceClient().installUpdates(deviceName, resourceGroupName); + } + + public void installUpdates(String deviceName, String resourceGroupName, Context context) { + this.serviceClient().installUpdates(deviceName, resourceGroupName, context); + } + + public NetworkSettings getNetworkSettings(String deviceName, String resourceGroupName) { + NetworkSettingsInner inner = this.serviceClient().getNetworkSettings(deviceName, resourceGroupName); + if (inner != null) { + return new NetworkSettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getNetworkSettingsWithResponse( + String deviceName, String resourceGroupName, Context context) { + Response inner = + this.serviceClient().getNetworkSettingsWithResponse(deviceName, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkSettingsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void scanForUpdates(String deviceName, String resourceGroupName) { + this.serviceClient().scanForUpdates(deviceName, resourceGroupName); + } + + public void scanForUpdates(String deviceName, String resourceGroupName, Context context) { + this.serviceClient().scanForUpdates(deviceName, resourceGroupName, context); + } + + public void createOrUpdateSecuritySettings( + String deviceName, String resourceGroupName, SecuritySettings securitySettings) { + this.serviceClient().createOrUpdateSecuritySettings(deviceName, resourceGroupName, securitySettings); + } + + public void createOrUpdateSecuritySettings( + String deviceName, String resourceGroupName, SecuritySettings securitySettings, Context context) { + this.serviceClient().createOrUpdateSecuritySettings(deviceName, resourceGroupName, securitySettings, context); + } + + public UpdateSummary getUpdateSummary(String deviceName, String resourceGroupName) { + UpdateSummaryInner inner = this.serviceClient().getUpdateSummary(deviceName, resourceGroupName); + if (inner != null) { + return new UpdateSummaryImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getUpdateSummaryWithResponse( + String deviceName, String resourceGroupName, Context context) { + Response inner = + this.serviceClient().getUpdateSummaryWithResponse(deviceName, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new UpdateSummaryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public UploadCertificateResponse uploadCertificate( + String deviceName, String resourceGroupName, UploadCertificateRequest parameters) { + UploadCertificateResponseInner inner = + this.serviceClient().uploadCertificate(deviceName, resourceGroupName, parameters); + if (inner != null) { + return new UploadCertificateResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response uploadCertificateWithResponse( + String deviceName, String resourceGroupName, UploadCertificateRequest parameters, Context context) { + Response inner = + this.serviceClient().uploadCertificateWithResponse(deviceName, resourceGroupName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new UploadCertificateResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DataBoxEdgeDevice 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 deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, deviceName, 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 deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, deviceName, 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 deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + this.delete(resourceGroupName, deviceName, 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 deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + this.delete(resourceGroupName, deviceName, context); + } + + private DevicesClient serviceClient() { + return this.innerClient; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } + + public DataBoxEdgeDeviceImpl define(String name) { + return new DataBoxEdgeDeviceImpl(name, this.manager()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/JobImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/JobImpl.java new file mode 100644 index 0000000000000..c118ec75370e9 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/JobImpl.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.models.JobInner; +import com.azure.resourcemanager.databoxedge.models.Job; +import com.azure.resourcemanager.databoxedge.models.JobErrorDetails; +import com.azure.resourcemanager.databoxedge.models.JobStatus; +import com.azure.resourcemanager.databoxedge.models.JobType; +import com.azure.resourcemanager.databoxedge.models.UpdateDownloadProgress; +import com.azure.resourcemanager.databoxedge.models.UpdateInstallProgress; +import com.azure.resourcemanager.databoxedge.models.UpdateOperationStage; +import java.time.OffsetDateTime; + +public final class JobImpl implements Job { + private JobInner innerObject; + + private final DataBoxEdgeManager serviceManager; + + JobImpl(JobInner innerObject, DataBoxEdgeManager 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 JobStatus status() { + return this.innerModel().status(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public Integer percentComplete() { + return this.innerModel().percentComplete(); + } + + public JobErrorDetails error() { + return this.innerModel().error(); + } + + public JobType jobType() { + return this.innerModel().jobType(); + } + + public UpdateOperationStage currentStage() { + return this.innerModel().currentStage(); + } + + public UpdateDownloadProgress downloadProgress() { + return this.innerModel().downloadProgress(); + } + + public UpdateInstallProgress installProgress() { + return this.innerModel().installProgress(); + } + + public Integer totalRefreshErrors() { + return this.innerModel().totalRefreshErrors(); + } + + public String errorManifestFile() { + return this.innerModel().errorManifestFile(); + } + + public String refreshedEntityId() { + return this.innerModel().refreshedEntityId(); + } + + public String folder() { + return this.innerModel().folder(); + } + + public JobInner innerModel() { + return this.innerObject; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/JobsClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/JobsClientImpl.java new file mode 100644 index 0000000000000..587971c5729e7 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/JobsClientImpl.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.databoxedge.fluent.JobsClient; +import com.azure.resourcemanager.databoxedge.fluent.models.JobInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in JobsClient. */ +public final class JobsClientImpl implements JobsClient { + private final ClientLogger logger = new ClientLogger(JobsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final JobsService service; + + /** The service client containing this operation class. */ + private final DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of JobsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + JobsClientImpl(DataBoxEdgeManagementClientImpl client) { + this.service = RestProxy.create(JobsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataBoxEdgeManagementClientJobs to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataBoxEdgeManagemen") + private interface JobsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/jobs/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("name") String name, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a specified job on a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String deviceName, String name, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .get( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a specified job on a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String deviceName, String name, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .get( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a specified job on a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String deviceName, String name, String resourceGroupName) { + return getWithResponseAsync(deviceName, name, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a specified job on a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner get(String deviceName, String name, String resourceGroupName) { + return getAsync(deviceName, name, resourceGroupName).block(); + } + + /** + * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a specified job on a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String deviceName, String name, String resourceGroupName, Context context) { + return getWithResponseAsync(deviceName, name, resourceGroupName, context).block(); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/JobsImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/JobsImpl.java new file mode 100644 index 0000000000000..a0c4d061f2033 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/JobsImpl.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.databoxedge.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.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.JobsClient; +import com.azure.resourcemanager.databoxedge.fluent.models.JobInner; +import com.azure.resourcemanager.databoxedge.models.Job; +import com.azure.resourcemanager.databoxedge.models.Jobs; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class JobsImpl implements Jobs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobsImpl.class); + + private final JobsClient innerClient; + + private final DataBoxEdgeManager serviceManager; + + public JobsImpl(JobsClient innerClient, DataBoxEdgeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Job get(String deviceName, String name, String resourceGroupName) { + JobInner inner = this.serviceClient().get(deviceName, name, resourceGroupName); + if (inner != null) { + return new JobImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context) { + Response inner = this.serviceClient().getWithResponse(deviceName, name, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new JobImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private JobsClient serviceClient() { + return this.innerClient; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NetworkSettingsImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NetworkSettingsImpl.java new file mode 100644 index 0000000000000..94e0be92d2422 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NetworkSettingsImpl.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.databoxedge.implementation; + +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.models.NetworkSettingsInner; +import com.azure.resourcemanager.databoxedge.models.NetworkAdapter; +import com.azure.resourcemanager.databoxedge.models.NetworkSettings; +import java.util.Collections; +import java.util.List; + +public final class NetworkSettingsImpl implements NetworkSettings { + private NetworkSettingsInner innerObject; + + private final DataBoxEdgeManager serviceManager; + + NetworkSettingsImpl(NetworkSettingsInner innerObject, DataBoxEdgeManager 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 List networkAdapters() { + List inner = this.innerModel().networkAdapters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public NetworkSettingsInner innerModel() { + return this.innerObject; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NodeImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NodeImpl.java new file mode 100644 index 0000000000000..ad185d1a50733 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NodeImpl.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.models.NodeInner; +import com.azure.resourcemanager.databoxedge.models.Node; +import com.azure.resourcemanager.databoxedge.models.NodeStatus; + +public final class NodeImpl implements Node { + private NodeInner innerObject; + + private final DataBoxEdgeManager serviceManager; + + NodeImpl(NodeInner innerObject, DataBoxEdgeManager 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 NodeStatus nodeStatus() { + return this.innerModel().nodeStatus(); + } + + public String nodeChassisSerialNumber() { + return this.innerModel().nodeChassisSerialNumber(); + } + + public String nodeSerialNumber() { + return this.innerModel().nodeSerialNumber(); + } + + public String nodeDisplayName() { + return this.innerModel().nodeDisplayName(); + } + + public String nodeFriendlySoftwareVersion() { + return this.innerModel().nodeFriendlySoftwareVersion(); + } + + public String nodeHcsVersion() { + return this.innerModel().nodeHcsVersion(); + } + + public String nodeInstanceId() { + return this.innerModel().nodeInstanceId(); + } + + public NodeInner innerModel() { + return this.innerObject; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NodesClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NodesClientImpl.java new file mode 100644 index 0000000000000..4616cd82e1b18 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NodesClientImpl.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.NodesClient; +import com.azure.resourcemanager.databoxedge.fluent.models.NodeInner; +import com.azure.resourcemanager.databoxedge.models.NodeList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NodesClient. */ +public final class NodesClientImpl implements NodesClient { + private final ClientLogger logger = new ClientLogger(NodesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NodesService service; + + /** The service client containing this operation class. */ + private final DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of NodesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NodesClientImpl(DataBoxEdgeManagementClientImpl client) { + this.service = RestProxy.create(NodesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataBoxEdgeManagementClientNodes to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataBoxEdgeManagemen") + private interface NodesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/nodes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDevice( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the nodes currently configured under this Data Box Edge device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the nodes currently configured under this Data Box Edge device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceSinglePageAsync( + String deviceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .listByDataBoxEdgeDevice( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets all the nodes currently configured under this Data Box Edge device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the nodes currently configured under this Data Box Edge device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceSinglePageAsync( + String deviceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .listByDataBoxEdgeDevice( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Gets all the nodes currently configured under this Data Box Edge device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the nodes currently configured under this Data Box Edge device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName) { + return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName)); + } + + /** + * Gets all the nodes currently configured under this Data Box Edge device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the nodes currently configured under this Data Box Edge device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync( + String deviceName, String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, context)); + } + + /** + * Gets all the nodes currently configured under this Data Box Edge device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the nodes currently configured under this Data Box Edge device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName)); + } + + /** + * Gets all the nodes currently configured under this Data Box Edge device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the nodes currently configured under this Data Box Edge device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice( + String deviceName, String resourceGroupName, Context context) { + return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName, context)); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NodesImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NodesImpl.java new file mode 100644 index 0000000000000..c49b707553f9f --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/NodesImpl.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.databoxedge.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.NodesClient; +import com.azure.resourcemanager.databoxedge.fluent.models.NodeInner; +import com.azure.resourcemanager.databoxedge.models.Node; +import com.azure.resourcemanager.databoxedge.models.Nodes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NodesImpl implements Nodes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NodesImpl.class); + + private final NodesClient innerClient; + + private final DataBoxEdgeManager serviceManager; + + public NodesImpl(NodesClient innerClient, DataBoxEdgeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName); + return inner.mapPage(inner1 -> new NodeImpl(inner1, this.manager())); + } + + public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName, context); + return inner.mapPage(inner1 -> new NodeImpl(inner1, this.manager())); + } + + private NodesClient serviceClient() { + return this.innerClient; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationImpl.java new file mode 100644 index 0000000000000..bac4af9cd2777 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.models.OperationInner; +import com.azure.resourcemanager.databoxedge.models.Operation; +import com.azure.resourcemanager.databoxedge.models.OperationDisplay; +import com.azure.resourcemanager.databoxedge.models.ServiceSpecification; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final DataBoxEdgeManager serviceManager; + + OperationImpl(OperationInner innerObject, DataBoxEdgeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public ServiceSpecification serviceSpecification() { + return this.innerModel().serviceSpecification(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..df0b2d41218d9 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsClientImpl.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.OperationsClient; +import com.azure.resourcemanager.databoxedge.fluent.models.OperationInner; +import com.azure.resourcemanager.databoxedge.models.OperationsList; +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 DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(DataBoxEdgeManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataBoxEdgeManagementClientOperations to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataBoxEdgeManagemen") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.DataBoxEdge/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List all the supported 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 operations used for the discovery of available provider operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List all the supported 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 operations used for the discovery of available provider operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all the supported 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 operations used for the discovery of available provider operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all the supported 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 operations used for the discovery of available provider operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all the supported 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 operations used for the discovery of available provider operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List all the supported 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 operations used for the discovery of available provider operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(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 the list of operations used for the discovery of available provider operations. + */ + @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 the list of operations used for the discovery of available provider operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..7370c967902d4 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.OperationsClient; +import com.azure.resourcemanager.databoxedge.fluent.models.OperationInner; +import com.azure.resourcemanager.databoxedge.models.Operation; +import com.azure.resourcemanager.databoxedge.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 DataBoxEdgeManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, DataBoxEdgeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return inner.mapPage(inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return inner.mapPage(inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsStatusClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsStatusClientImpl.java new file mode 100644 index 0000000000000..d0c5465a03639 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsStatusClientImpl.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.databoxedge.fluent.OperationsStatusClient; +import com.azure.resourcemanager.databoxedge.fluent.models.JobInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsStatusClient. */ +public final class OperationsStatusClientImpl implements OperationsStatusClient { + private final ClientLogger logger = new ClientLogger(OperationsStatusClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsStatusService service; + + /** The service client containing this operation class. */ + private final DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of OperationsStatusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsStatusClientImpl(DataBoxEdgeManagementClientImpl client) { + this.service = + RestProxy.create(OperationsStatusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataBoxEdgeManagementClientOperationsStatus to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataBoxEdgeManagemen") + private interface OperationsStatusService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/operationsStatus/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("name") String name, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a specified job on a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String deviceName, String name, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .get( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a specified job on a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String deviceName, String name, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .get( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a specified job on a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String deviceName, String name, String resourceGroupName) { + return getWithResponseAsync(deviceName, name, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a specified job on a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner get(String deviceName, String name, String resourceGroupName) { + return getAsync(deviceName, name, resourceGroupName).block(); + } + + /** + * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a specified job on a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String deviceName, String name, String resourceGroupName, Context context) { + return getWithResponseAsync(deviceName, name, resourceGroupName, context).block(); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsStatusImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsStatusImpl.java new file mode 100644 index 0000000000000..3f2aa3727106c --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OperationsStatusImpl.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.databoxedge.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.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.OperationsStatusClient; +import com.azure.resourcemanager.databoxedge.fluent.models.JobInner; +import com.azure.resourcemanager.databoxedge.models.Job; +import com.azure.resourcemanager.databoxedge.models.OperationsStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsStatusImpl implements OperationsStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsStatusImpl.class); + + private final OperationsStatusClient innerClient; + + private final DataBoxEdgeManager serviceManager; + + public OperationsStatusImpl(OperationsStatusClient innerClient, DataBoxEdgeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Job get(String deviceName, String name, String resourceGroupName) { + JobInner inner = this.serviceClient().get(deviceName, name, resourceGroupName); + if (inner != null) { + return new JobImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context) { + Response inner = this.serviceClient().getWithResponse(deviceName, name, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new JobImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private OperationsStatusClient serviceClient() { + return this.innerClient; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OrderImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OrderImpl.java new file mode 100644 index 0000000000000..397c46a8b623b --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OrderImpl.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.models.OrderInner; +import com.azure.resourcemanager.databoxedge.models.Address; +import com.azure.resourcemanager.databoxedge.models.ContactDetails; +import com.azure.resourcemanager.databoxedge.models.Order; +import com.azure.resourcemanager.databoxedge.models.OrderStatus; +import com.azure.resourcemanager.databoxedge.models.TrackingInfo; +import java.util.Collections; +import java.util.List; + +public final class OrderImpl implements Order { + private OrderInner innerObject; + + private final DataBoxEdgeManager serviceManager; + + OrderImpl(OrderInner innerObject, DataBoxEdgeManager 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 ContactDetails contactInformation() { + return this.innerModel().contactInformation(); + } + + public Address shippingAddress() { + return this.innerModel().shippingAddress(); + } + + public OrderStatus currentStatus() { + return this.innerModel().currentStatus(); + } + + public List orderHistory() { + List inner = this.innerModel().orderHistory(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String serialNumber() { + return this.innerModel().serialNumber(); + } + + public List deliveryTrackingInfo() { + List inner = this.innerModel().deliveryTrackingInfo(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List returnTrackingInfo() { + List inner = this.innerModel().returnTrackingInfo(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OrderInner innerModel() { + return this.innerObject; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OrdersClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OrdersClientImpl.java new file mode 100644 index 0000000000000..4cc827217c8a9 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OrdersClientImpl.java @@ -0,0 +1,1025 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.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.databoxedge.fluent.OrdersClient; +import com.azure.resourcemanager.databoxedge.fluent.models.OrderInner; +import com.azure.resourcemanager.databoxedge.models.OrderList; +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 OrdersClient. */ +public final class OrdersClientImpl implements OrdersClient { + private final ClientLogger logger = new ClientLogger(OrdersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OrdersService service; + + /** The service client containing this operation class. */ + private final DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of OrdersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OrdersClientImpl(DataBoxEdgeManagementClientImpl client) { + this.service = RestProxy.create(OrdersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataBoxEdgeManagementClientOrders to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataBoxEdgeManagemen") + private interface OrdersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/orders") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDevice( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/orders/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/orders/default") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") OrderInner order, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/orders/default") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDeviceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the orders related to a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order entities. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceSinglePageAsync( + String deviceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .listByDataBoxEdgeDevice( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all the orders related to a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order entities. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceSinglePageAsync( + String deviceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .listByDataBoxEdgeDevice( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the orders related to a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order entities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the orders related to a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order entities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync( + String deviceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, context), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the orders related to a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order entities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName)); + } + + /** + * Lists all the orders related to a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order entities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice( + String deviceName, String resourceGroupName, Context context) { + return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName, context)); + } + + /** + * Gets a specific order by name. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specific order by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String deviceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .get( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets a specific order by name. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specific order by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String deviceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .get( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a specific order by name. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specific order by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String deviceName, String resourceGroupName) { + return getWithResponseAsync(deviceName, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a specific order by name. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specific order by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrderInner get(String deviceName, String resourceGroupName) { + return getAsync(deviceName, resourceGroupName).block(); + } + + /** + * Gets a specific order by name. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specific order by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String deviceName, String resourceGroupName, Context context) { + return getWithResponseAsync(deviceName, resourceGroupName, context).block(); + } + + /** + * Creates or updates an order. + * + * @param deviceName The order details of a device. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the order details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String deviceName, String resourceGroupName, OrderInner order) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 (order == null) { + return Mono.error(new IllegalArgumentException("Parameter order is required and cannot be null.")); + } else { + order.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + order, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates an order. + * + * @param deviceName The order details of a device. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the order details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String deviceName, String resourceGroupName, OrderInner order, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 (order == null) { + return Mono.error(new IllegalArgumentException("Parameter order is required and cannot be null.")); + } else { + order.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + order, + accept, + context); + } + + /** + * Creates or updates an order. + * + * @param deviceName The order details of a device. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the order details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OrderInner> beginCreateOrUpdateAsync( + String deviceName, String resourceGroupName, OrderInner order) { + Mono>> mono = createOrUpdateWithResponseAsync(deviceName, resourceGroupName, order); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), OrderInner.class, OrderInner.class, Context.NONE); + } + + /** + * Creates or updates an order. + * + * @param deviceName The order details of a device. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the order details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OrderInner> beginCreateOrUpdateAsync( + String deviceName, String resourceGroupName, OrderInner order, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(deviceName, resourceGroupName, order, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), OrderInner.class, OrderInner.class, context); + } + + /** + * Creates or updates an order. + * + * @param deviceName The order details of a device. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the order details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OrderInner> beginCreateOrUpdate( + String deviceName, String resourceGroupName, OrderInner order) { + return beginCreateOrUpdateAsync(deviceName, resourceGroupName, order).getSyncPoller(); + } + + /** + * Creates or updates an order. + * + * @param deviceName The order details of a device. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the order details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OrderInner> beginCreateOrUpdate( + String deviceName, String resourceGroupName, OrderInner order, Context context) { + return beginCreateOrUpdateAsync(deviceName, resourceGroupName, order, context).getSyncPoller(); + } + + /** + * Creates or updates an order. + * + * @param deviceName The order details of a device. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the order details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String deviceName, String resourceGroupName, OrderInner order) { + return beginCreateOrUpdateAsync(deviceName, resourceGroupName, order) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an order. + * + * @param deviceName The order details of a device. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the order details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String deviceName, String resourceGroupName, OrderInner order, Context context) { + return beginCreateOrUpdateAsync(deviceName, resourceGroupName, order, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an order. + * + * @param deviceName The order details of a device. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the order details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrderInner createOrUpdate(String deviceName, String resourceGroupName, OrderInner order) { + return createOrUpdateAsync(deviceName, resourceGroupName, order).block(); + } + + /** + * Creates or updates an order. + * + * @param deviceName The order details of a device. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the order details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrderInner createOrUpdate(String deviceName, String resourceGroupName, OrderInner order, Context context) { + return createOrUpdateAsync(deviceName, resourceGroupName, order, context).block(); + } + + /** + * Deletes the order related to the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .delete( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the order related to the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .delete( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the order related to the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String resourceGroupName) { + Mono>> mono = deleteWithResponseAsync(deviceName, resourceGroupName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the order related to the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String resourceGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(deviceName, resourceGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the order related to the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String resourceGroupName) { + return beginDeleteAsync(deviceName, resourceGroupName).getSyncPoller(); + } + + /** + * Deletes the order related to the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String resourceGroupName, Context context) { + return beginDeleteAsync(deviceName, resourceGroupName, context).getSyncPoller(); + } + + /** + * Deletes the order related to the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String resourceGroupName) { + return beginDeleteAsync(deviceName, resourceGroupName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the order related to the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String resourceGroupName, Context context) { + return beginDeleteAsync(deviceName, resourceGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the order related to the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deviceName, String resourceGroupName) { + deleteAsync(deviceName, resourceGroupName).block(); + } + + /** + * Deletes the order related to the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deviceName, String resourceGroupName, Context context) { + deleteAsync(deviceName, resourceGroupName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order entities. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(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.listByDataBoxEdgeDeviceNext(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 list of order entities. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync( + 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 + .listByDataBoxEdgeDeviceNext(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/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OrdersImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OrdersImpl.java new file mode 100644 index 0000000000000..b7f06c3658e8f --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/OrdersImpl.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.OrdersClient; +import com.azure.resourcemanager.databoxedge.fluent.models.OrderInner; +import com.azure.resourcemanager.databoxedge.models.Order; +import com.azure.resourcemanager.databoxedge.models.Orders; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OrdersImpl implements Orders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OrdersImpl.class); + + private final OrdersClient innerClient; + + private final DataBoxEdgeManager serviceManager; + + public OrdersImpl(OrdersClient innerClient, DataBoxEdgeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName); + return inner.mapPage(inner1 -> new OrderImpl(inner1, this.manager())); + } + + public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName, context); + return inner.mapPage(inner1 -> new OrderImpl(inner1, this.manager())); + } + + public Order get(String deviceName, String resourceGroupName) { + OrderInner inner = this.serviceClient().get(deviceName, resourceGroupName); + if (inner != null) { + return new OrderImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String deviceName, String resourceGroupName, Context context) { + Response inner = this.serviceClient().getWithResponse(deviceName, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OrderImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Order createOrUpdate(String deviceName, String resourceGroupName, OrderInner order) { + OrderInner inner = this.serviceClient().createOrUpdate(deviceName, resourceGroupName, order); + if (inner != null) { + return new OrderImpl(inner, this.manager()); + } else { + return null; + } + } + + public Order createOrUpdate(String deviceName, String resourceGroupName, OrderInner order, Context context) { + OrderInner inner = this.serviceClient().createOrUpdate(deviceName, resourceGroupName, order, context); + if (inner != null) { + return new OrderImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String deviceName, String resourceGroupName) { + this.serviceClient().delete(deviceName, resourceGroupName); + } + + public void delete(String deviceName, String resourceGroupName, Context context) { + this.serviceClient().delete(deviceName, resourceGroupName, context); + } + + private OrdersClient serviceClient() { + return this.innerClient; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ResourceTypeSkuImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ResourceTypeSkuImpl.java new file mode 100644 index 0000000000000..c8916fd2cc9ea --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ResourceTypeSkuImpl.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.models.ResourceTypeSkuInner; +import com.azure.resourcemanager.databoxedge.models.ResourceTypeSku; +import com.azure.resourcemanager.databoxedge.models.SkuCost; +import com.azure.resourcemanager.databoxedge.models.SkuLocationInfo; +import com.azure.resourcemanager.databoxedge.models.SkuName; +import com.azure.resourcemanager.databoxedge.models.SkuRestriction; +import com.azure.resourcemanager.databoxedge.models.SkuTier; +import java.util.Collections; +import java.util.List; + +public final class ResourceTypeSkuImpl implements ResourceTypeSku { + private ResourceTypeSkuInner innerObject; + + private final DataBoxEdgeManager serviceManager; + + ResourceTypeSkuImpl(ResourceTypeSkuInner innerObject, DataBoxEdgeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public SkuName name() { + return this.innerModel().name(); + } + + public String kind() { + return this.innerModel().kind(); + } + + public SkuTier tier() { + return this.innerModel().tier(); + } + + public String family() { + return this.innerModel().family(); + } + + public List locations() { + List inner = this.innerModel().locations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List apiVersions() { + List inner = this.innerModel().apiVersions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List locationInfo() { + List inner = this.innerModel().locationInfo(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List costs() { + List inner = this.innerModel().costs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List restrictions() { + List inner = this.innerModel().restrictions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ResourceTypeSkuInner innerModel() { + return this.innerObject; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/RoleImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/RoleImpl.java new file mode 100644 index 0000000000000..a609fa1185b9c --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/RoleImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.models.RoleInner; +import com.azure.resourcemanager.databoxedge.models.Role; + +public final class RoleImpl implements Role { + private RoleInner innerObject; + + private final DataBoxEdgeManager serviceManager; + + RoleImpl(RoleInner innerObject, DataBoxEdgeManager 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 RoleInner innerModel() { + return this.innerObject; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/RolesClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/RolesClientImpl.java new file mode 100644 index 0000000000000..11c2da04f6011 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/RolesClientImpl.java @@ -0,0 +1,1085 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.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.databoxedge.fluent.RolesClient; +import com.azure.resourcemanager.databoxedge.fluent.models.RoleInner; +import com.azure.resourcemanager.databoxedge.models.RoleList; +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 RolesClient. */ +public final class RolesClientImpl implements RolesClient { + private final ClientLogger logger = new ClientLogger(RolesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RolesService service; + + /** The service client containing this operation class. */ + private final DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of RolesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RolesClientImpl(DataBoxEdgeManagementClientImpl client) { + this.service = RestProxy.create(RolesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataBoxEdgeManagementClientRoles to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataBoxEdgeManagemen") + private interface RolesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/roles") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDevice( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/roles/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("name") String name, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/roles/{name}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("name") String name, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RoleInner role, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/roles/{name}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("name") String name, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDeviceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the roles on the Data Box Edge device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceSinglePageAsync( + String deviceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .listByDataBoxEdgeDevice( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the roles on the Data Box Edge device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceSinglePageAsync( + String deviceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .listByDataBoxEdgeDevice( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the roles on the Data Box Edge device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the roles on the Data Box Edge device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync( + String deviceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, context), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the roles on the Data Box Edge device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName)); + } + + /** + * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the roles on the Data Box Edge device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice( + String deviceName, String resourceGroupName, Context context) { + return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName, context)); + } + + /** + * Gets a specific role by name. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specific role by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String deviceName, String name, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .get( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets a specific role by name. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specific role by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String deviceName, String name, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .get( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a specific role by name. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specific role by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String deviceName, String name, String resourceGroupName) { + return getWithResponseAsync(deviceName, name, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a specific role by name. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specific role by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleInner get(String deviceName, String name, String resourceGroupName) { + return getAsync(deviceName, name, resourceGroupName).block(); + } + + /** + * Gets a specific role by name. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specific role by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String deviceName, String name, String resourceGroupName, Context context) { + return getWithResponseAsync(deviceName, name, resourceGroupName, context).block(); + } + + /** + * Create or update a role. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param role The role properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return compute role. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String deviceName, String name, String resourceGroupName, RoleInner role) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 (role == null) { + return Mono.error(new IllegalArgumentException("Parameter role is required and cannot be null.")); + } else { + role.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + role, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create or update a role. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param role The role properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return compute role. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String deviceName, String name, String resourceGroupName, RoleInner role, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 (role == null) { + return Mono.error(new IllegalArgumentException("Parameter role is required and cannot be null.")); + } else { + role.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + role, + accept, + context); + } + + /** + * Create or update a role. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param role The role properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return compute role. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RoleInner> beginCreateOrUpdateAsync( + String deviceName, String name, String resourceGroupName, RoleInner role) { + Mono>> mono = + createOrUpdateWithResponseAsync(deviceName, name, resourceGroupName, role); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RoleInner.class, RoleInner.class, Context.NONE); + } + + /** + * Create or update a role. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param role The role properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return compute role. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RoleInner> beginCreateOrUpdateAsync( + String deviceName, String name, String resourceGroupName, RoleInner role, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(deviceName, name, resourceGroupName, role, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RoleInner.class, RoleInner.class, context); + } + + /** + * Create or update a role. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param role The role properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return compute role. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RoleInner> beginCreateOrUpdate( + String deviceName, String name, String resourceGroupName, RoleInner role) { + return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, role).getSyncPoller(); + } + + /** + * Create or update a role. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param role The role properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return compute role. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RoleInner> beginCreateOrUpdate( + String deviceName, String name, String resourceGroupName, RoleInner role, Context context) { + return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, role, context).getSyncPoller(); + } + + /** + * Create or update a role. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param role The role properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return compute role. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String deviceName, String name, String resourceGroupName, RoleInner role) { + return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, role) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a role. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param role The role properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return compute role. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String deviceName, String name, String resourceGroupName, RoleInner role, Context context) { + return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, role, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a role. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param role The role properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return compute role. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleInner createOrUpdate(String deviceName, String name, String resourceGroupName, RoleInner role) { + return createOrUpdateAsync(deviceName, name, resourceGroupName, role).block(); + } + + /** + * Create or update a role. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param role The role properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return compute role. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleInner createOrUpdate( + String deviceName, String name, String resourceGroupName, RoleInner role, Context context) { + return createOrUpdateAsync(deviceName, name, resourceGroupName, role, context).block(); + } + + /** + * Deletes the role on the device. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .delete( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the role on the device. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .delete( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the role on the device. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName) { + Mono>> mono = deleteWithResponseAsync(deviceName, name, resourceGroupName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the role on the device. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(deviceName, name, resourceGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the role on the device. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName) { + return beginDeleteAsync(deviceName, name, resourceGroupName).getSyncPoller(); + } + + /** + * Deletes the role on the device. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName, Context context) { + return beginDeleteAsync(deviceName, name, resourceGroupName, context).getSyncPoller(); + } + + /** + * Deletes the role on the device. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName) { + return beginDeleteAsync(deviceName, name, resourceGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the role on the device. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName, Context context) { + return beginDeleteAsync(deviceName, name, resourceGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the role on the device. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deviceName, String name, String resourceGroupName) { + deleteAsync(deviceName, name, resourceGroupName).block(); + } + + /** + * Deletes the role on the device. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deviceName, String name, String resourceGroupName, Context context) { + deleteAsync(deviceName, name, resourceGroupName, 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 collection of all the roles on the Data Box Edge device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(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.listByDataBoxEdgeDeviceNext(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 collection of all the roles on the Data Box Edge device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync( + 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 + .listByDataBoxEdgeDeviceNext(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/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/RolesImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/RolesImpl.java new file mode 100644 index 0000000000000..ed3bc65f9ccf8 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/RolesImpl.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.databoxedge.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.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.RolesClient; +import com.azure.resourcemanager.databoxedge.fluent.models.RoleInner; +import com.azure.resourcemanager.databoxedge.models.Role; +import com.azure.resourcemanager.databoxedge.models.Roles; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RolesImpl implements Roles { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RolesImpl.class); + + private final RolesClient innerClient; + + private final DataBoxEdgeManager serviceManager; + + public RolesImpl(RolesClient innerClient, DataBoxEdgeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName); + return inner.mapPage(inner1 -> new RoleImpl(inner1, this.manager())); + } + + public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName, context); + return inner.mapPage(inner1 -> new RoleImpl(inner1, this.manager())); + } + + public Role get(String deviceName, String name, String resourceGroupName) { + RoleInner inner = this.serviceClient().get(deviceName, name, resourceGroupName); + if (inner != null) { + return new RoleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context) { + Response inner = this.serviceClient().getWithResponse(deviceName, name, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RoleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Role createOrUpdate(String deviceName, String name, String resourceGroupName, RoleInner role) { + RoleInner inner = this.serviceClient().createOrUpdate(deviceName, name, resourceGroupName, role); + if (inner != null) { + return new RoleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Role createOrUpdate( + String deviceName, String name, String resourceGroupName, RoleInner role, Context context) { + RoleInner inner = this.serviceClient().createOrUpdate(deviceName, name, resourceGroupName, role, context); + if (inner != null) { + return new RoleImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String deviceName, String name, String resourceGroupName) { + this.serviceClient().delete(deviceName, name, resourceGroupName); + } + + public void delete(String deviceName, String name, String resourceGroupName, Context context) { + this.serviceClient().delete(deviceName, name, resourceGroupName, context); + } + + private RolesClient serviceClient() { + return this.innerClient; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ShareImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ShareImpl.java new file mode 100644 index 0000000000000..9296b07f053b2 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/ShareImpl.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.models.ShareInner; +import com.azure.resourcemanager.databoxedge.models.AzureContainerInfo; +import com.azure.resourcemanager.databoxedge.models.ClientAccessRight; +import com.azure.resourcemanager.databoxedge.models.DataPolicy; +import com.azure.resourcemanager.databoxedge.models.MonitoringStatus; +import com.azure.resourcemanager.databoxedge.models.MountPointMap; +import com.azure.resourcemanager.databoxedge.models.RefreshDetails; +import com.azure.resourcemanager.databoxedge.models.Share; +import com.azure.resourcemanager.databoxedge.models.ShareAccessProtocol; +import com.azure.resourcemanager.databoxedge.models.ShareStatus; +import com.azure.resourcemanager.databoxedge.models.UserAccessRight; +import java.util.Collections; +import java.util.List; + +public final class ShareImpl implements Share, Share.Definition, Share.Update { + private ShareInner innerObject; + + private final DataBoxEdgeManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String description() { + return this.innerModel().description(); + } + + public ShareStatus shareStatus() { + return this.innerModel().shareStatus(); + } + + public MonitoringStatus monitoringStatus() { + return this.innerModel().monitoringStatus(); + } + + public AzureContainerInfo azureContainerInfo() { + return this.innerModel().azureContainerInfo(); + } + + public ShareAccessProtocol accessProtocol() { + return this.innerModel().accessProtocol(); + } + + public List userAccessRights() { + List inner = this.innerModel().userAccessRights(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List clientAccessRights() { + List inner = this.innerModel().clientAccessRights(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public RefreshDetails refreshDetails() { + return this.innerModel().refreshDetails(); + } + + public List shareMappings() { + List inner = this.innerModel().shareMappings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DataPolicy dataPolicy() { + return this.innerModel().dataPolicy(); + } + + public ShareInner innerModel() { + return this.innerObject; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } + + private String deviceName; + + private String name; + + private String resourceGroupName; + + public ShareImpl withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + this.deviceName = deviceName; + this.resourceGroupName = resourceGroupName; + return this; + } + + public Share create() { + this.innerObject = + serviceManager + .serviceClient() + .getShares() + .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), Context.NONE); + return this; + } + + public Share create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getShares() + .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), context); + return this; + } + + ShareImpl(String name, DataBoxEdgeManager serviceManager) { + this.innerObject = new ShareInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public ShareImpl update() { + return this; + } + + public Share apply() { + this.innerObject = + serviceManager + .serviceClient() + .getShares() + .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), Context.NONE); + return this; + } + + public Share apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getShares() + .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), context); + return this; + } + + ShareImpl(ShareInner innerObject, DataBoxEdgeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.deviceName = Utils.getValueFromIdByName(innerObject.id(), "dataBoxEdgeDevices"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "shares"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + } + + public Share refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getShares() + .getWithResponse(deviceName, name, resourceGroupName, Context.NONE) + .getValue(); + return this; + } + + public Share refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getShares() + .getWithResponse(deviceName, name, resourceGroupName, context) + .getValue(); + return this; + } + + public ShareImpl withShareStatus(ShareStatus shareStatus) { + this.innerModel().withShareStatus(shareStatus); + return this; + } + + public ShareImpl withMonitoringStatus(MonitoringStatus monitoringStatus) { + this.innerModel().withMonitoringStatus(monitoringStatus); + return this; + } + + public ShareImpl withAccessProtocol(ShareAccessProtocol accessProtocol) { + this.innerModel().withAccessProtocol(accessProtocol); + return this; + } + + public ShareImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public ShareImpl withAzureContainerInfo(AzureContainerInfo azureContainerInfo) { + this.innerModel().withAzureContainerInfo(azureContainerInfo); + return this; + } + + public ShareImpl withUserAccessRights(List userAccessRights) { + this.innerModel().withUserAccessRights(userAccessRights); + return this; + } + + public ShareImpl withClientAccessRights(List clientAccessRights) { + this.innerModel().withClientAccessRights(clientAccessRights); + return this; + } + + public ShareImpl withRefreshDetails(RefreshDetails refreshDetails) { + this.innerModel().withRefreshDetails(refreshDetails); + return this; + } + + public ShareImpl withDataPolicy(DataPolicy dataPolicy) { + this.innerModel().withDataPolicy(dataPolicy); + return this; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/SharesClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/SharesClientImpl.java new file mode 100644 index 0000000000000..e3cea9fbd060a --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/SharesClientImpl.java @@ -0,0 +1,1350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.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.databoxedge.fluent.SharesClient; +import com.azure.resourcemanager.databoxedge.fluent.models.ShareInner; +import com.azure.resourcemanager.databoxedge.models.ShareList; +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 SharesClient. */ +public final class SharesClientImpl implements SharesClient { + private final ClientLogger logger = new ClientLogger(SharesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SharesService service; + + /** The service client containing this operation class. */ + private final DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of SharesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SharesClientImpl(DataBoxEdgeManagementClientImpl client) { + this.service = RestProxy.create(SharesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataBoxEdgeManagementClientShares to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataBoxEdgeManagemen") + private interface SharesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/shares") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDevice( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/shares/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("name") String name, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/shares/{name}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("name") String name, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ShareInner share, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/shares/{name}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("name") String name, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/shares/{name}/refresh") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> refresh( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("name") String name, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDeviceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the shares in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the shares on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceSinglePageAsync( + String deviceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .listByDataBoxEdgeDevice( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all the shares in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the shares on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceSinglePageAsync( + String deviceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .listByDataBoxEdgeDevice( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the shares in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the shares on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the shares in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the shares on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync( + String deviceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, context), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the shares in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the shares on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName)); + } + + /** + * Lists all the shares in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the shares on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice( + String deviceName, String resourceGroupName, Context context) { + return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName, context)); + } + + /** + * Gets a share by name. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 share by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String deviceName, String name, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .get( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets a share by name. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 share by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String deviceName, String name, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .get( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a share by name. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 share by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String deviceName, String name, String resourceGroupName) { + return getWithResponseAsync(deviceName, name, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a share by name. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 share by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ShareInner get(String deviceName, String name, String resourceGroupName) { + return getAsync(deviceName, name, resourceGroupName).block(); + } + + /** + * Gets a share by name. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 share by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String deviceName, String name, String resourceGroupName, Context context) { + return getWithResponseAsync(deviceName, name, resourceGroupName, context).block(); + } + + /** + * Creates a new share or updates an existing share on the device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param share The share properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a share on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String deviceName, String name, String resourceGroupName, ShareInner share) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 (share == null) { + return Mono.error(new IllegalArgumentException("Parameter share is required and cannot be null.")); + } else { + share.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + share, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates a new share or updates an existing share on the device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param share The share properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a share on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String deviceName, String name, String resourceGroupName, ShareInner share, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 (share == null) { + return Mono.error(new IllegalArgumentException("Parameter share is required and cannot be null.")); + } else { + share.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + share, + accept, + context); + } + + /** + * Creates a new share or updates an existing share on the device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param share The share properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a share on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ShareInner> beginCreateOrUpdateAsync( + String deviceName, String name, String resourceGroupName, ShareInner share) { + Mono>> mono = + createOrUpdateWithResponseAsync(deviceName, name, resourceGroupName, share); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ShareInner.class, ShareInner.class, Context.NONE); + } + + /** + * Creates a new share or updates an existing share on the device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param share The share properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a share on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ShareInner> beginCreateOrUpdateAsync( + String deviceName, String name, String resourceGroupName, ShareInner share, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(deviceName, name, resourceGroupName, share, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ShareInner.class, ShareInner.class, context); + } + + /** + * Creates a new share or updates an existing share on the device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param share The share properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a share on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ShareInner> beginCreateOrUpdate( + String deviceName, String name, String resourceGroupName, ShareInner share) { + return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, share).getSyncPoller(); + } + + /** + * Creates a new share or updates an existing share on the device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param share The share properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a share on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ShareInner> beginCreateOrUpdate( + String deviceName, String name, String resourceGroupName, ShareInner share, Context context) { + return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, share, context).getSyncPoller(); + } + + /** + * Creates a new share or updates an existing share on the device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param share The share properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a share on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String deviceName, String name, String resourceGroupName, ShareInner share) { + return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, share) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new share or updates an existing share on the device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param share The share properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a share on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String deviceName, String name, String resourceGroupName, ShareInner share, Context context) { + return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, share, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new share or updates an existing share on the device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param share The share properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a share on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ShareInner createOrUpdate(String deviceName, String name, String resourceGroupName, ShareInner share) { + return createOrUpdateAsync(deviceName, name, resourceGroupName, share).block(); + } + + /** + * Creates a new share or updates an existing share on the device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param share The share properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a share on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ShareInner createOrUpdate( + String deviceName, String name, String resourceGroupName, ShareInner share, Context context) { + return createOrUpdateAsync(deviceName, name, resourceGroupName, share, context).block(); + } + + /** + * Deletes the share on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .delete( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the share on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .delete( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the share on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName) { + Mono>> mono = deleteWithResponseAsync(deviceName, name, resourceGroupName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the share on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(deviceName, name, resourceGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the share on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName) { + return beginDeleteAsync(deviceName, name, resourceGroupName).getSyncPoller(); + } + + /** + * Deletes the share on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName, Context context) { + return beginDeleteAsync(deviceName, name, resourceGroupName, context).getSyncPoller(); + } + + /** + * Deletes the share on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName) { + return beginDeleteAsync(deviceName, name, resourceGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the share on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName, Context context) { + return beginDeleteAsync(deviceName, name, resourceGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the share on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deviceName, String name, String resourceGroupName) { + deleteAsync(deviceName, name, resourceGroupName).block(); + } + + /** + * Deletes the share on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deviceName, String name, String resourceGroupName, Context context) { + deleteAsync(deviceName, name, resourceGroupName, context).block(); + } + + /** + * Refreshes the share metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> refreshWithResponseAsync( + String deviceName, String name, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .refresh( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Refreshes the share metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> refreshWithResponseAsync( + String deviceName, String name, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .refresh( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Refreshes the share metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRefreshAsync( + String deviceName, String name, String resourceGroupName) { + Mono>> mono = refreshWithResponseAsync(deviceName, name, resourceGroupName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Refreshes the share metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRefreshAsync( + String deviceName, String name, String resourceGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = refreshWithResponseAsync(deviceName, name, resourceGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Refreshes the share metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRefresh(String deviceName, String name, String resourceGroupName) { + return beginRefreshAsync(deviceName, name, resourceGroupName).getSyncPoller(); + } + + /** + * Refreshes the share metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRefresh( + String deviceName, String name, String resourceGroupName, Context context) { + return beginRefreshAsync(deviceName, name, resourceGroupName, context).getSyncPoller(); + } + + /** + * Refreshes the share metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 refreshAsync(String deviceName, String name, String resourceGroupName) { + return beginRefreshAsync(deviceName, name, resourceGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refreshes the share metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 refreshAsync(String deviceName, String name, String resourceGroupName, Context context) { + return beginRefreshAsync(deviceName, name, resourceGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refreshes the share metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 refresh(String deviceName, String name, String resourceGroupName) { + refreshAsync(deviceName, name, resourceGroupName).block(); + } + + /** + * Refreshes the share metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 refresh(String deviceName, String name, String resourceGroupName, Context context) { + refreshAsync(deviceName, name, resourceGroupName, 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 collection of all the shares on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(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.listByDataBoxEdgeDeviceNext(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 collection of all the shares on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync( + 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 + .listByDataBoxEdgeDeviceNext(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/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/SharesImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/SharesImpl.java new file mode 100644 index 0000000000000..e9daefe2079d7 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/SharesImpl.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.SharesClient; +import com.azure.resourcemanager.databoxedge.fluent.models.ShareInner; +import com.azure.resourcemanager.databoxedge.models.Share; +import com.azure.resourcemanager.databoxedge.models.Shares; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SharesImpl implements Shares { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SharesImpl.class); + + private final SharesClient innerClient; + + private final DataBoxEdgeManager serviceManager; + + public SharesImpl(SharesClient innerClient, DataBoxEdgeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName); + return inner.mapPage(inner1 -> new ShareImpl(inner1, this.manager())); + } + + public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName, context); + return inner.mapPage(inner1 -> new ShareImpl(inner1, this.manager())); + } + + public Share get(String deviceName, String name, String resourceGroupName) { + ShareInner inner = this.serviceClient().get(deviceName, name, resourceGroupName); + if (inner != null) { + return new ShareImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context) { + Response inner = this.serviceClient().getWithResponse(deviceName, name, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ShareImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String deviceName, String name, String resourceGroupName) { + this.serviceClient().delete(deviceName, name, resourceGroupName); + } + + public void delete(String deviceName, String name, String resourceGroupName, Context context) { + this.serviceClient().delete(deviceName, name, resourceGroupName, context); + } + + public void refresh(String deviceName, String name, String resourceGroupName) { + this.serviceClient().refresh(deviceName, name, resourceGroupName); + } + + public void refresh(String deviceName, String name, String resourceGroupName, Context context) { + this.serviceClient().refresh(deviceName, name, resourceGroupName, context); + } + + public Share getById(String id) { + String deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String name = Utils.getValueFromIdByName(id, "shares"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'shares'.", 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))); + } + return this.getWithResponse(deviceName, name, resourceGroupName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String name = Utils.getValueFromIdByName(id, "shares"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'shares'.", 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))); + } + return this.getWithResponse(deviceName, name, resourceGroupName, context); + } + + public void deleteById(String id) { + String deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String name = Utils.getValueFromIdByName(id, "shares"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'shares'.", 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))); + } + this.delete(deviceName, name, resourceGroupName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String name = Utils.getValueFromIdByName(id, "shares"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'shares'.", 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))); + } + this.delete(deviceName, name, resourceGroupName, context); + } + + private SharesClient serviceClient() { + return this.innerClient; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } + + public ShareImpl define(String name) { + return new ShareImpl(name, this.manager()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/SkusClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/SkusClientImpl.java new file mode 100644 index 0000000000000..4d6b894d6ab2d --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/SkusClientImpl.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.SkusClient; +import com.azure.resourcemanager.databoxedge.fluent.models.ResourceTypeSkuInner; +import com.azure.resourcemanager.databoxedge.models.SkuInformationList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SkusClient. */ +public final class SkusClientImpl implements SkusClient { + private final ClientLogger logger = new ClientLogger(SkusClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SkusService service; + + /** The service client containing this operation class. */ + private final DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of SkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SkusClientImpl(DataBoxEdgeManagementClientImpl client) { + this.service = RestProxy.create(SkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataBoxEdgeManagementClientSkus to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataBoxEdgeManagemen") + private interface SkusService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List all the available Skus in the region and information related to them. + * + * @param filter Specify $filter='location eq <location>' to filter on location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU Information objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List all the available Skus in the region and information related to them. + * + * @param filter Specify $filter='location eq <location>' to filter on location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU Information objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * List all the available Skus in the region and information related to them. + * + * @param filter Specify $filter='location eq <location>' to filter on location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU Information objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(filter)); + } + + /** + * List all the available Skus in the region and information related to them. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU Information objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(filter)); + } + + /** + * List all the available Skus in the region and information related to them. + * + * @param filter Specify $filter='location eq <location>' to filter on location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU Information objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(filter, context)); + } + + /** + * List all the available Skus in the region and information related to them. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU Information objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + return new PagedIterable<>(listAsync(filter)); + } + + /** + * List all the available Skus in the region and information related to them. + * + * @param filter Specify $filter='location eq <location>' to filter on location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU Information objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, Context context) { + return new PagedIterable<>(listAsync(filter, context)); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/SkusImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/SkusImpl.java new file mode 100644 index 0000000000000..52a6db4af97f3 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/SkusImpl.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.databoxedge.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.SkusClient; +import com.azure.resourcemanager.databoxedge.fluent.models.ResourceTypeSkuInner; +import com.azure.resourcemanager.databoxedge.models.ResourceTypeSku; +import com.azure.resourcemanager.databoxedge.models.Skus; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SkusImpl implements Skus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkusImpl.class); + + private final SkusClient innerClient; + + private final DataBoxEdgeManager serviceManager; + + public SkusImpl(SkusClient innerClient, DataBoxEdgeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return inner.mapPage(inner1 -> new ResourceTypeSkuImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, Context context) { + PagedIterable inner = this.serviceClient().list(filter, context); + return inner.mapPage(inner1 -> new ResourceTypeSkuImpl(inner1, this.manager())); + } + + private SkusClient serviceClient() { + return this.innerClient; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountCredentialImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountCredentialImpl.java new file mode 100644 index 0000000000000..557c5b79b9f23 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountCredentialImpl.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.databoxedge.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountCredentialInner; +import com.azure.resourcemanager.databoxedge.models.AccountType; +import com.azure.resourcemanager.databoxedge.models.AsymmetricEncryptedSecret; +import com.azure.resourcemanager.databoxedge.models.SslStatus; +import com.azure.resourcemanager.databoxedge.models.StorageAccountCredential; + +public final class StorageAccountCredentialImpl + implements StorageAccountCredential, StorageAccountCredential.Definition, StorageAccountCredential.Update { + private StorageAccountCredentialInner innerObject; + + private final DataBoxEdgeManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String alias() { + return this.innerModel().alias(); + } + + public String username() { + return this.innerModel().username(); + } + + public AsymmetricEncryptedSecret accountKey() { + return this.innerModel().accountKey(); + } + + public String connectionString() { + return this.innerModel().connectionString(); + } + + public SslStatus sslStatus() { + return this.innerModel().sslStatus(); + } + + public String blobDomainName() { + return this.innerModel().blobDomainName(); + } + + public AccountType accountType() { + return this.innerModel().accountType(); + } + + public String storageAccountId() { + return this.innerModel().storageAccountId(); + } + + public StorageAccountCredentialInner innerModel() { + return this.innerObject; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } + + private String deviceName; + + private String name; + + private String resourceGroupName; + + public StorageAccountCredentialImpl withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + this.deviceName = deviceName; + this.resourceGroupName = resourceGroupName; + return this; + } + + public StorageAccountCredential create() { + this.innerObject = + serviceManager + .serviceClient() + .getStorageAccountCredentials() + .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), Context.NONE); + return this; + } + + public StorageAccountCredential create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStorageAccountCredentials() + .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), context); + return this; + } + + StorageAccountCredentialImpl(String name, DataBoxEdgeManager serviceManager) { + this.innerObject = new StorageAccountCredentialInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public StorageAccountCredentialImpl update() { + return this; + } + + public StorageAccountCredential apply() { + this.innerObject = + serviceManager + .serviceClient() + .getStorageAccountCredentials() + .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), Context.NONE); + return this; + } + + public StorageAccountCredential apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStorageAccountCredentials() + .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), context); + return this; + } + + StorageAccountCredentialImpl(StorageAccountCredentialInner innerObject, DataBoxEdgeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.deviceName = Utils.getValueFromIdByName(innerObject.id(), "dataBoxEdgeDevices"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "storageAccountCredentials"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + } + + public StorageAccountCredential refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getStorageAccountCredentials() + .getWithResponse(deviceName, name, resourceGroupName, Context.NONE) + .getValue(); + return this; + } + + public StorageAccountCredential refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStorageAccountCredentials() + .getWithResponse(deviceName, name, resourceGroupName, context) + .getValue(); + return this; + } + + public StorageAccountCredentialImpl withAlias(String alias) { + this.innerModel().withAlias(alias); + return this; + } + + public StorageAccountCredentialImpl withSslStatus(SslStatus sslStatus) { + this.innerModel().withSslStatus(sslStatus); + return this; + } + + public StorageAccountCredentialImpl withAccountType(AccountType accountType) { + this.innerModel().withAccountType(accountType); + return this; + } + + public StorageAccountCredentialImpl withUsername(String username) { + this.innerModel().withUsername(username); + return this; + } + + public StorageAccountCredentialImpl withAccountKey(AsymmetricEncryptedSecret accountKey) { + this.innerModel().withAccountKey(accountKey); + return this; + } + + public StorageAccountCredentialImpl withConnectionString(String connectionString) { + this.innerModel().withConnectionString(connectionString); + return this; + } + + public StorageAccountCredentialImpl withBlobDomainName(String blobDomainName) { + this.innerModel().withBlobDomainName(blobDomainName); + return this; + } + + public StorageAccountCredentialImpl withStorageAccountId(String storageAccountId) { + this.innerModel().withStorageAccountId(storageAccountId); + return this; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountCredentialsClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountCredentialsClientImpl.java new file mode 100644 index 0000000000000..7b865a62de00a --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountCredentialsClientImpl.java @@ -0,0 +1,1143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.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.databoxedge.fluent.StorageAccountCredentialsClient; +import com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountCredentialInner; +import com.azure.resourcemanager.databoxedge.models.StorageAccountCredentialList; +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 StorageAccountCredentialsClient. */ +public final class StorageAccountCredentialsClientImpl implements StorageAccountCredentialsClient { + private final ClientLogger logger = new ClientLogger(StorageAccountCredentialsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final StorageAccountCredentialsService service; + + /** The service client containing this operation class. */ + private final DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of StorageAccountCredentialsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + StorageAccountCredentialsClientImpl(DataBoxEdgeManagementClientImpl client) { + this.service = + RestProxy + .create( + StorageAccountCredentialsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataBoxEdgeManagementClientStorageAccountCredentials to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataBoxEdgeManagemen") + private interface StorageAccountCredentialsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDevice( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("name") String name, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("name") String name, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StorageAccountCredentialInner storageAccountCredential, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("name") String name, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDeviceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the storage account credentials in a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceSinglePageAsync( + String deviceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .listByDataBoxEdgeDevice( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the storage account credentials in a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceSinglePageAsync( + String deviceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .listByDataBoxEdgeDevice( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the storage account credentials in a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync( + String deviceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the storage account credentials in a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync( + String deviceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, context), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the storage account credentials in a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice( + String deviceName, String resourceGroupName) { + return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName)); + } + + /** + * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the storage account credentials in a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice( + String deviceName, String resourceGroupName, Context context) { + return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName, context)); + } + + /** + * Gets the properties of the specified storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified storage account credential. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String deviceName, String name, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .get( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the properties of the specified storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified storage account credential. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String deviceName, String name, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .get( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the properties of the specified storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified storage account credential. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String deviceName, String name, String resourceGroupName) { + return getWithResponseAsync(deviceName, name, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the properties of the specified storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified storage account credential. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageAccountCredentialInner get(String deviceName, String name, String resourceGroupName) { + return getAsync(deviceName, name, resourceGroupName).block(); + } + + /** + * Gets the properties of the specified storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified storage account credential. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String deviceName, String name, String resourceGroupName, Context context) { + return getWithResponseAsync(deviceName, name, resourceGroupName, context).block(); + } + + /** + * Creates or updates the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account credential. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String deviceName, + String name, + String resourceGroupName, + StorageAccountCredentialInner storageAccountCredential) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 (storageAccountCredential == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageAccountCredential is required and cannot be null.")); + } else { + storageAccountCredential.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageAccountCredential, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account credential. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String deviceName, + String name, + String resourceGroupName, + StorageAccountCredentialInner storageAccountCredential, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 (storageAccountCredential == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageAccountCredential is required and cannot be null.")); + } else { + storageAccountCredential.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageAccountCredential, + accept, + context); + } + + /** + * Creates or updates the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account credential. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, StorageAccountCredentialInner> + beginCreateOrUpdateAsync( + String deviceName, + String name, + String resourceGroupName, + StorageAccountCredentialInner storageAccountCredential) { + Mono>> mono = + createOrUpdateWithResponseAsync(deviceName, name, resourceGroupName, storageAccountCredential); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + StorageAccountCredentialInner.class, + StorageAccountCredentialInner.class, + Context.NONE); + } + + /** + * Creates or updates the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account credential. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, StorageAccountCredentialInner> + beginCreateOrUpdateAsync( + String deviceName, + String name, + String resourceGroupName, + StorageAccountCredentialInner storageAccountCredential, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(deviceName, name, resourceGroupName, storageAccountCredential, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + StorageAccountCredentialInner.class, + StorageAccountCredentialInner.class, + context); + } + + /** + * Creates or updates the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account credential. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, StorageAccountCredentialInner> beginCreateOrUpdate( + String deviceName, + String name, + String resourceGroupName, + StorageAccountCredentialInner storageAccountCredential) { + return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, storageAccountCredential).getSyncPoller(); + } + + /** + * Creates or updates the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account credential. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, StorageAccountCredentialInner> beginCreateOrUpdate( + String deviceName, + String name, + String resourceGroupName, + StorageAccountCredentialInner storageAccountCredential, + Context context) { + return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, storageAccountCredential, context) + .getSyncPoller(); + } + + /** + * Creates or updates the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account credential. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String deviceName, + String name, + String resourceGroupName, + StorageAccountCredentialInner storageAccountCredential) { + return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, storageAccountCredential) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account credential. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String deviceName, + String name, + String resourceGroupName, + StorageAccountCredentialInner storageAccountCredential, + Context context) { + return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, storageAccountCredential, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account credential. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageAccountCredentialInner createOrUpdate( + String deviceName, + String name, + String resourceGroupName, + StorageAccountCredentialInner storageAccountCredential) { + return createOrUpdateAsync(deviceName, name, resourceGroupName, storageAccountCredential).block(); + } + + /** + * Creates or updates the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage account credential. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageAccountCredentialInner createOrUpdate( + String deviceName, + String name, + String resourceGroupName, + StorageAccountCredentialInner storageAccountCredential, + Context context) { + return createOrUpdateAsync(deviceName, name, resourceGroupName, storageAccountCredential, context).block(); + } + + /** + * Deletes the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .delete( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .delete( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName) { + Mono>> mono = deleteWithResponseAsync(deviceName, name, resourceGroupName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(deviceName, name, resourceGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName) { + return beginDeleteAsync(deviceName, name, resourceGroupName).getSyncPoller(); + } + + /** + * Deletes the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName, Context context) { + return beginDeleteAsync(deviceName, name, resourceGroupName, context).getSyncPoller(); + } + + /** + * Deletes the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName) { + return beginDeleteAsync(deviceName, name, resourceGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName, Context context) { + return beginDeleteAsync(deviceName, name, resourceGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deviceName, String name, String resourceGroupName) { + deleteAsync(deviceName, name, resourceGroupName).block(); + } + + /** + * Deletes the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deviceName, String name, String resourceGroupName, Context context) { + deleteAsync(deviceName, name, resourceGroupName, 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 collection of storage account credentials. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync( + 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.listByDataBoxEdgeDeviceNext(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 collection of storage account credentials. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync( + 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 + .listByDataBoxEdgeDeviceNext(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/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountCredentialsImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountCredentialsImpl.java new file mode 100644 index 0000000000000..d722747360c75 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountCredentialsImpl.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.StorageAccountCredentialsClient; +import com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountCredentialInner; +import com.azure.resourcemanager.databoxedge.models.StorageAccountCredential; +import com.azure.resourcemanager.databoxedge.models.StorageAccountCredentials; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class StorageAccountCredentialsImpl implements StorageAccountCredentials { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountCredentialsImpl.class); + + private final StorageAccountCredentialsClient innerClient; + + private final DataBoxEdgeManager serviceManager; + + public StorageAccountCredentialsImpl( + StorageAccountCredentialsClient innerClient, DataBoxEdgeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByDataBoxEdgeDevice( + String deviceName, String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName); + return inner.mapPage(inner1 -> new StorageAccountCredentialImpl(inner1, this.manager())); + } + + public PagedIterable listByDataBoxEdgeDevice( + String deviceName, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName, context); + return inner.mapPage(inner1 -> new StorageAccountCredentialImpl(inner1, this.manager())); + } + + public StorageAccountCredential get(String deviceName, String name, String resourceGroupName) { + StorageAccountCredentialInner inner = this.serviceClient().get(deviceName, name, resourceGroupName); + if (inner != null) { + return new StorageAccountCredentialImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String deviceName, String name, String resourceGroupName, Context context) { + Response inner = + this.serviceClient().getWithResponse(deviceName, name, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new StorageAccountCredentialImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String deviceName, String name, String resourceGroupName) { + this.serviceClient().delete(deviceName, name, resourceGroupName); + } + + public void delete(String deviceName, String name, String resourceGroupName, Context context) { + this.serviceClient().delete(deviceName, name, resourceGroupName, context); + } + + public StorageAccountCredential getById(String id) { + String deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String name = Utils.getValueFromIdByName(id, "storageAccountCredentials"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageAccountCredentials'.", + 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))); + } + return this.getWithResponse(deviceName, name, resourceGroupName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String name = Utils.getValueFromIdByName(id, "storageAccountCredentials"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageAccountCredentials'.", + 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))); + } + return this.getWithResponse(deviceName, name, resourceGroupName, context); + } + + public void deleteById(String id) { + String deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String name = Utils.getValueFromIdByName(id, "storageAccountCredentials"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageAccountCredentials'.", + 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))); + } + this.delete(deviceName, name, resourceGroupName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String name = Utils.getValueFromIdByName(id, "storageAccountCredentials"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageAccountCredentials'.", + 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))); + } + this.delete(deviceName, name, resourceGroupName, context); + } + + private StorageAccountCredentialsClient serviceClient() { + return this.innerClient; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } + + public StorageAccountCredentialImpl define(String name) { + return new StorageAccountCredentialImpl(name, this.manager()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountImpl.java new file mode 100644 index 0000000000000..69684739d7da3 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountImpl.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountInner; +import com.azure.resourcemanager.databoxedge.models.DataPolicy; +import com.azure.resourcemanager.databoxedge.models.StorageAccount; +import com.azure.resourcemanager.databoxedge.models.StorageAccountStatus; + +public final class StorageAccountImpl implements StorageAccount, StorageAccount.Definition, StorageAccount.Update { + private StorageAccountInner innerObject; + + private final DataBoxEdgeManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String description() { + return this.innerModel().description(); + } + + public StorageAccountStatus storageAccountStatus() { + return this.innerModel().storageAccountStatus(); + } + + public DataPolicy dataPolicy() { + return this.innerModel().dataPolicy(); + } + + public String storageAccountCredentialId() { + return this.innerModel().storageAccountCredentialId(); + } + + public String blobEndpoint() { + return this.innerModel().blobEndpoint(); + } + + public Integer containerCount() { + return this.innerModel().containerCount(); + } + + public StorageAccountInner innerModel() { + return this.innerObject; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } + + private String deviceName; + + private String storageAccountName; + + private String resourceGroupName; + + public StorageAccountImpl withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + this.deviceName = deviceName; + this.resourceGroupName = resourceGroupName; + return this; + } + + public StorageAccount create() { + this.innerObject = + serviceManager + .serviceClient() + .getStorageAccounts() + .createOrUpdate(deviceName, storageAccountName, resourceGroupName, this.innerModel(), Context.NONE); + return this; + } + + public StorageAccount create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStorageAccounts() + .createOrUpdate(deviceName, storageAccountName, resourceGroupName, this.innerModel(), context); + return this; + } + + StorageAccountImpl(String name, DataBoxEdgeManager serviceManager) { + this.innerObject = new StorageAccountInner(); + this.serviceManager = serviceManager; + this.storageAccountName = name; + } + + public StorageAccountImpl update() { + return this; + } + + public StorageAccount apply() { + this.innerObject = + serviceManager + .serviceClient() + .getStorageAccounts() + .createOrUpdate(deviceName, storageAccountName, resourceGroupName, this.innerModel(), Context.NONE); + return this; + } + + public StorageAccount apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStorageAccounts() + .createOrUpdate(deviceName, storageAccountName, resourceGroupName, this.innerModel(), context); + return this; + } + + StorageAccountImpl(StorageAccountInner innerObject, DataBoxEdgeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.deviceName = Utils.getValueFromIdByName(innerObject.id(), "dataBoxEdgeDevices"); + this.storageAccountName = Utils.getValueFromIdByName(innerObject.id(), "storageAccounts"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + } + + public StorageAccount refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getStorageAccounts() + .getWithResponse(deviceName, storageAccountName, resourceGroupName, Context.NONE) + .getValue(); + return this; + } + + public StorageAccount refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStorageAccounts() + .getWithResponse(deviceName, storageAccountName, resourceGroupName, context) + .getValue(); + return this; + } + + public StorageAccountImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public StorageAccountImpl withStorageAccountStatus(StorageAccountStatus storageAccountStatus) { + this.innerModel().withStorageAccountStatus(storageAccountStatus); + return this; + } + + public StorageAccountImpl withDataPolicy(DataPolicy dataPolicy) { + this.innerModel().withDataPolicy(dataPolicy); + return this; + } + + public StorageAccountImpl withStorageAccountCredentialId(String storageAccountCredentialId) { + this.innerModel().withStorageAccountCredentialId(storageAccountCredentialId); + return this; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountsClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountsClientImpl.java new file mode 100644 index 0000000000000..2699a73af77c0 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountsClientImpl.java @@ -0,0 +1,1124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.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.databoxedge.fluent.StorageAccountsClient; +import com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountInner; +import com.azure.resourcemanager.databoxedge.models.StorageAccountList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in StorageAccountsClient. */ +public final class StorageAccountsClientImpl implements StorageAccountsClient { + private final ClientLogger logger = new ClientLogger(StorageAccountsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final StorageAccountsService service; + + /** The service client containing this operation class. */ + private final DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of StorageAccountsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + StorageAccountsClientImpl(DataBoxEdgeManagementClientImpl client) { + this.service = + RestProxy.create(StorageAccountsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataBoxEdgeManagementClientStorageAccounts to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataBoxEdgeManagemen") + private interface StorageAccountsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/storageAccounts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDevice( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("storageAccountName") String storageAccountName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("storageAccountName") String storageAccountName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StorageAccountInner storageAccount, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("storageAccountName") String storageAccountName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDeviceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the Storage Accounts on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceSinglePageAsync( + String deviceName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .listByDataBoxEdgeDevice( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the Storage Accounts on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceSinglePageAsync( + String deviceName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .listByDataBoxEdgeDevice( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the Storage Accounts on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName) { + return new PagedFlux<>( + () -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the Storage Accounts on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync( + String deviceName, String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, context), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the Storage Accounts on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName)); + } + + /** + * Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the Storage Accounts on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice( + String deviceName, String resourceGroupName, Context context) { + return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName, context)); + } + + /** + * Gets a StorageAccount by name. + * + * @param deviceName The device name. + * @param storageAccountName The storage account name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 StorageAccount by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String deviceName, String storageAccountName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (storageAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageAccountName is required and 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 + .get( + this.client.getEndpoint(), + deviceName, + storageAccountName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets a StorageAccount by name. + * + * @param deviceName The device name. + * @param storageAccountName The storage account name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 StorageAccount by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String deviceName, String storageAccountName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (storageAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageAccountName is required and 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 + .get( + this.client.getEndpoint(), + deviceName, + storageAccountName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a StorageAccount by name. + * + * @param deviceName The device name. + * @param storageAccountName The storage account name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 StorageAccount by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String deviceName, String storageAccountName, String resourceGroupName) { + return getWithResponseAsync(deviceName, storageAccountName, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a StorageAccount by name. + * + * @param deviceName The device name. + * @param storageAccountName The storage account name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 StorageAccount by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageAccountInner get(String deviceName, String storageAccountName, String resourceGroupName) { + return getAsync(deviceName, storageAccountName, resourceGroupName).block(); + } + + /** + * Gets a StorageAccount by name. + * + * @param deviceName The device name. + * @param storageAccountName The storage account name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 StorageAccount by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String deviceName, String storageAccountName, String resourceGroupName, Context context) { + return getWithResponseAsync(deviceName, storageAccountName, resourceGroupName, context).block(); + } + + /** + * Creates a new StorageAccount or updates an existing StorageAccount on the device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @param storageAccount The StorageAccount properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Storage Account on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String deviceName, String storageAccountName, String resourceGroupName, StorageAccountInner storageAccount) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (storageAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageAccountName is required and 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 (storageAccount == null) { + return Mono.error(new IllegalArgumentException("Parameter storageAccount is required and cannot be null.")); + } else { + storageAccount.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + deviceName, + storageAccountName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageAccount, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates a new StorageAccount or updates an existing StorageAccount on the device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @param storageAccount The StorageAccount properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Storage Account on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String deviceName, + String storageAccountName, + String resourceGroupName, + StorageAccountInner storageAccount, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (storageAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageAccountName is required and 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 (storageAccount == null) { + return Mono.error(new IllegalArgumentException("Parameter storageAccount is required and cannot be null.")); + } else { + storageAccount.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + deviceName, + storageAccountName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageAccount, + accept, + context); + } + + /** + * Creates a new StorageAccount or updates an existing StorageAccount on the device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @param storageAccount The StorageAccount properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Storage Account on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, StorageAccountInner> beginCreateOrUpdateAsync( + String deviceName, String storageAccountName, String resourceGroupName, StorageAccountInner storageAccount) { + Mono>> mono = + createOrUpdateWithResponseAsync(deviceName, storageAccountName, resourceGroupName, storageAccount); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + StorageAccountInner.class, + StorageAccountInner.class, + Context.NONE); + } + + /** + * Creates a new StorageAccount or updates an existing StorageAccount on the device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @param storageAccount The StorageAccount properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Storage Account on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, StorageAccountInner> beginCreateOrUpdateAsync( + String deviceName, + String storageAccountName, + String resourceGroupName, + StorageAccountInner storageAccount, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(deviceName, storageAccountName, resourceGroupName, storageAccount, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), StorageAccountInner.class, StorageAccountInner.class, context); + } + + /** + * Creates a new StorageAccount or updates an existing StorageAccount on the device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @param storageAccount The StorageAccount properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Storage Account on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, StorageAccountInner> beginCreateOrUpdate( + String deviceName, String storageAccountName, String resourceGroupName, StorageAccountInner storageAccount) { + return beginCreateOrUpdateAsync(deviceName, storageAccountName, resourceGroupName, storageAccount) + .getSyncPoller(); + } + + /** + * Creates a new StorageAccount or updates an existing StorageAccount on the device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @param storageAccount The StorageAccount properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Storage Account on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, StorageAccountInner> beginCreateOrUpdate( + String deviceName, + String storageAccountName, + String resourceGroupName, + StorageAccountInner storageAccount, + Context context) { + return beginCreateOrUpdateAsync(deviceName, storageAccountName, resourceGroupName, storageAccount, context) + .getSyncPoller(); + } + + /** + * Creates a new StorageAccount or updates an existing StorageAccount on the device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @param storageAccount The StorageAccount properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Storage Account on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String deviceName, String storageAccountName, String resourceGroupName, StorageAccountInner storageAccount) { + return beginCreateOrUpdateAsync(deviceName, storageAccountName, resourceGroupName, storageAccount) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new StorageAccount or updates an existing StorageAccount on the device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @param storageAccount The StorageAccount properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Storage Account on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String deviceName, + String storageAccountName, + String resourceGroupName, + StorageAccountInner storageAccount, + Context context) { + return beginCreateOrUpdateAsync(deviceName, storageAccountName, resourceGroupName, storageAccount, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new StorageAccount or updates an existing StorageAccount on the device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @param storageAccount The StorageAccount properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Storage Account on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageAccountInner createOrUpdate( + String deviceName, String storageAccountName, String resourceGroupName, StorageAccountInner storageAccount) { + return createOrUpdateAsync(deviceName, storageAccountName, resourceGroupName, storageAccount).block(); + } + + /** + * Creates a new StorageAccount or updates an existing StorageAccount on the device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @param storageAccount The StorageAccount properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Storage Account on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageAccountInner createOrUpdate( + String deviceName, + String storageAccountName, + String resourceGroupName, + StorageAccountInner storageAccount, + Context context) { + return createOrUpdateAsync(deviceName, storageAccountName, resourceGroupName, storageAccount, context).block(); + } + + /** + * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String storageAccountName, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (storageAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageAccountName is required and 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 + .delete( + this.client.getEndpoint(), + deviceName, + storageAccountName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String storageAccountName, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (storageAccountName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageAccountName is required and 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 + .delete( + this.client.getEndpoint(), + deviceName, + storageAccountName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String storageAccountName, String resourceGroupName) { + Mono>> mono = + deleteWithResponseAsync(deviceName, storageAccountName, resourceGroupName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String storageAccountName, String resourceGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(deviceName, storageAccountName, resourceGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String storageAccountName, String resourceGroupName) { + return beginDeleteAsync(deviceName, storageAccountName, resourceGroupName).getSyncPoller(); + } + + /** + * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String storageAccountName, String resourceGroupName, Context context) { + return beginDeleteAsync(deviceName, storageAccountName, resourceGroupName, context).getSyncPoller(); + } + + /** + * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String storageAccountName, String resourceGroupName) { + return beginDeleteAsync(deviceName, storageAccountName, resourceGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String storageAccountName, String resourceGroupName, Context context) { + return beginDeleteAsync(deviceName, storageAccountName, resourceGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deviceName, String storageAccountName, String resourceGroupName) { + deleteAsync(deviceName, storageAccountName, resourceGroupName).block(); + } + + /** + * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deviceName, String storageAccountName, String resourceGroupName, Context context) { + deleteAsync(deviceName, storageAccountName, resourceGroupName, 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 collection of all the Storage Accounts on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(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.listByDataBoxEdgeDeviceNext(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 collection of all the Storage Accounts on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync( + 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 + .listByDataBoxEdgeDeviceNext(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/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountsImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountsImpl.java new file mode 100644 index 0000000000000..b8a804cad4ddf --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/StorageAccountsImpl.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.StorageAccountsClient; +import com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountInner; +import com.azure.resourcemanager.databoxedge.models.StorageAccount; +import com.azure.resourcemanager.databoxedge.models.StorageAccounts; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class StorageAccountsImpl implements StorageAccounts { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountsImpl.class); + + private final StorageAccountsClient innerClient; + + private final DataBoxEdgeManager serviceManager; + + public StorageAccountsImpl(StorageAccountsClient innerClient, DataBoxEdgeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName); + return inner.mapPage(inner1 -> new StorageAccountImpl(inner1, this.manager())); + } + + public PagedIterable listByDataBoxEdgeDevice( + String deviceName, String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName, context); + return inner.mapPage(inner1 -> new StorageAccountImpl(inner1, this.manager())); + } + + public StorageAccount get(String deviceName, String storageAccountName, String resourceGroupName) { + StorageAccountInner inner = this.serviceClient().get(deviceName, storageAccountName, resourceGroupName); + if (inner != null) { + return new StorageAccountImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String deviceName, String storageAccountName, String resourceGroupName, Context context) { + Response inner = + this.serviceClient().getWithResponse(deviceName, storageAccountName, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new StorageAccountImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String deviceName, String storageAccountName, String resourceGroupName) { + this.serviceClient().delete(deviceName, storageAccountName, resourceGroupName); + } + + public void delete(String deviceName, String storageAccountName, String resourceGroupName, Context context) { + this.serviceClient().delete(deviceName, storageAccountName, resourceGroupName, context); + } + + public StorageAccount getById(String id) { + String deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String storageAccountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (storageAccountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", 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))); + } + return this.getWithResponse(deviceName, storageAccountName, resourceGroupName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String storageAccountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (storageAccountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", 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))); + } + return this.getWithResponse(deviceName, storageAccountName, resourceGroupName, context); + } + + public void deleteById(String id) { + String deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String storageAccountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (storageAccountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", 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))); + } + this.delete(deviceName, storageAccountName, resourceGroupName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String storageAccountName = Utils.getValueFromIdByName(id, "storageAccounts"); + if (storageAccountName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'storageAccounts'.", 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))); + } + this.delete(deviceName, storageAccountName, resourceGroupName, context); + } + + private StorageAccountsClient serviceClient() { + return this.innerClient; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } + + public StorageAccountImpl define(String name) { + return new StorageAccountImpl(name, this.manager()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/TriggerImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/TriggerImpl.java new file mode 100644 index 0000000000000..1f828398f9d27 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/TriggerImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.models.TriggerInner; +import com.azure.resourcemanager.databoxedge.models.Trigger; + +public final class TriggerImpl implements Trigger { + private TriggerInner innerObject; + + private final DataBoxEdgeManager serviceManager; + + TriggerImpl(TriggerInner innerObject, DataBoxEdgeManager 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 TriggerInner innerModel() { + return this.innerObject; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/TriggersClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/TriggersClientImpl.java new file mode 100644 index 0000000000000..dadf3d775c0e4 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/TriggersClientImpl.java @@ -0,0 +1,1114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.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.databoxedge.fluent.TriggersClient; +import com.azure.resourcemanager.databoxedge.fluent.models.TriggerInner; +import com.azure.resourcemanager.databoxedge.models.TriggerList; +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 TriggersClient. */ +public final class TriggersClientImpl implements TriggersClient { + private final ClientLogger logger = new ClientLogger(TriggersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final TriggersService service; + + /** The service client containing this operation class. */ + private final DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of TriggersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TriggersClientImpl(DataBoxEdgeManagementClientImpl client) { + this.service = RestProxy.create(TriggersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataBoxEdgeManagementClientTriggers to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataBoxEdgeManagemen") + private interface TriggersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/triggers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDevice( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/triggers/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("name") String name, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/triggers/{name}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("name") String name, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TriggerInner trigger, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/triggers/{name}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("name") String name, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDeviceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the triggers configured in the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param filter Specify $filter='CustomContextTag eq <tag>' to filter on custom context tag property. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all trigger on the data box edge device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceSinglePageAsync( + String deviceName, String resourceGroupName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .listByDataBoxEdgeDevice( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + filter, + 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 all the triggers configured in the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param filter Specify $filter='CustomContextTag eq <tag>' to filter on custom context tag property. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all trigger on the data box edge device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceSinglePageAsync( + String deviceName, String resourceGroupName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .listByDataBoxEdgeDevice( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the triggers configured in the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param filter Specify $filter='CustomContextTag eq <tag>' to filter on custom context tag property. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all trigger on the data box edge device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync( + String deviceName, String resourceGroupName, String filter) { + return new PagedFlux<>( + () -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, filter), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the triggers configured in the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all trigger on the data box edge device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName) { + final String filter = null; + return new PagedFlux<>( + () -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, filter), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the triggers configured in the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param filter Specify $filter='CustomContextTag eq <tag>' to filter on custom context tag property. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all trigger on the data box edge device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync( + String deviceName, String resourceGroupName, String filter, Context context) { + return new PagedFlux<>( + () -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, filter, context), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the triggers configured in the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all trigger on the data box edge device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + final String filter = null; + return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName, filter)); + } + + /** + * Lists all the triggers configured in the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param filter Specify $filter='CustomContextTag eq <tag>' to filter on custom context tag property. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all trigger on the data box edge device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice( + String deviceName, String resourceGroupName, String filter, Context context) { + return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName, filter, context)); + } + + /** + * Get a specific trigger by name. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specific trigger by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String deviceName, String name, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .get( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get a specific trigger by name. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specific trigger by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String deviceName, String name, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .get( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get a specific trigger by name. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specific trigger by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String deviceName, String name, String resourceGroupName) { + return getWithResponseAsync(deviceName, name, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a specific trigger by name. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specific trigger by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TriggerInner get(String deviceName, String name, String resourceGroupName) { + return getAsync(deviceName, name, resourceGroupName).block(); + } + + /** + * Get a specific trigger by name. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specific trigger by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String deviceName, String name, String resourceGroupName, Context context) { + return getWithResponseAsync(deviceName, name, resourceGroupName, context).block(); + } + + /** + * Creates or updates a trigger. + * + * @param deviceName Creates or updates a trigger. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param trigger The trigger. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return trigger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String deviceName, String name, String resourceGroupName, TriggerInner trigger) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 (trigger == null) { + return Mono.error(new IllegalArgumentException("Parameter trigger is required and cannot be null.")); + } else { + trigger.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + trigger, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates a trigger. + * + * @param deviceName Creates or updates a trigger. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param trigger The trigger. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return trigger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String deviceName, String name, String resourceGroupName, TriggerInner trigger, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 (trigger == null) { + return Mono.error(new IllegalArgumentException("Parameter trigger is required and cannot be null.")); + } else { + trigger.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + trigger, + accept, + context); + } + + /** + * Creates or updates a trigger. + * + * @param deviceName Creates or updates a trigger. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param trigger The trigger. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return trigger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, TriggerInner> beginCreateOrUpdateAsync( + String deviceName, String name, String resourceGroupName, TriggerInner trigger) { + Mono>> mono = + createOrUpdateWithResponseAsync(deviceName, name, resourceGroupName, trigger); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), TriggerInner.class, TriggerInner.class, Context.NONE); + } + + /** + * Creates or updates a trigger. + * + * @param deviceName Creates or updates a trigger. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param trigger The trigger. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return trigger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, TriggerInner> beginCreateOrUpdateAsync( + String deviceName, String name, String resourceGroupName, TriggerInner trigger, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(deviceName, name, resourceGroupName, trigger, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), TriggerInner.class, TriggerInner.class, context); + } + + /** + * Creates or updates a trigger. + * + * @param deviceName Creates or updates a trigger. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param trigger The trigger. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return trigger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, TriggerInner> beginCreateOrUpdate( + String deviceName, String name, String resourceGroupName, TriggerInner trigger) { + return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, trigger).getSyncPoller(); + } + + /** + * Creates or updates a trigger. + * + * @param deviceName Creates or updates a trigger. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param trigger The trigger. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return trigger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, TriggerInner> beginCreateOrUpdate( + String deviceName, String name, String resourceGroupName, TriggerInner trigger, Context context) { + return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, trigger, context).getSyncPoller(); + } + + /** + * Creates or updates a trigger. + * + * @param deviceName Creates or updates a trigger. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param trigger The trigger. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return trigger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String deviceName, String name, String resourceGroupName, TriggerInner trigger) { + return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, trigger) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a trigger. + * + * @param deviceName Creates or updates a trigger. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param trigger The trigger. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return trigger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String deviceName, String name, String resourceGroupName, TriggerInner trigger, Context context) { + return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, trigger, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a trigger. + * + * @param deviceName Creates or updates a trigger. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param trigger The trigger. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return trigger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TriggerInner createOrUpdate(String deviceName, String name, String resourceGroupName, TriggerInner trigger) { + return createOrUpdateAsync(deviceName, name, resourceGroupName, trigger).block(); + } + + /** + * Creates or updates a trigger. + * + * @param deviceName Creates or updates a trigger. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param trigger The trigger. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return trigger details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TriggerInner createOrUpdate( + String deviceName, String name, String resourceGroupName, TriggerInner trigger, Context context) { + return createOrUpdateAsync(deviceName, name, resourceGroupName, trigger, context).block(); + } + + /** + * Deletes the trigger on the gateway device. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .delete( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the trigger on the gateway device. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .delete( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the trigger on the gateway device. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName) { + Mono>> mono = deleteWithResponseAsync(deviceName, name, resourceGroupName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the trigger on the gateway device. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(deviceName, name, resourceGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the trigger on the gateway device. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName) { + return beginDeleteAsync(deviceName, name, resourceGroupName).getSyncPoller(); + } + + /** + * Deletes the trigger on the gateway device. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName, Context context) { + return beginDeleteAsync(deviceName, name, resourceGroupName, context).getSyncPoller(); + } + + /** + * Deletes the trigger on the gateway device. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName) { + return beginDeleteAsync(deviceName, name, resourceGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the trigger on the gateway device. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName, Context context) { + return beginDeleteAsync(deviceName, name, resourceGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the trigger on the gateway device. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deviceName, String name, String resourceGroupName) { + deleteAsync(deviceName, name, resourceGroupName).block(); + } + + /** + * Deletes the trigger on the gateway device. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deviceName, String name, String resourceGroupName, Context context) { + deleteAsync(deviceName, name, resourceGroupName, 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 collection of all trigger on the data box edge device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(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.listByDataBoxEdgeDeviceNext(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 collection of all trigger on the data box edge device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync( + 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 + .listByDataBoxEdgeDeviceNext(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/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/TriggersImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/TriggersImpl.java new file mode 100644 index 0000000000000..dd020b7b48f96 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/TriggersImpl.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.databoxedge.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.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.TriggersClient; +import com.azure.resourcemanager.databoxedge.fluent.models.TriggerInner; +import com.azure.resourcemanager.databoxedge.models.Trigger; +import com.azure.resourcemanager.databoxedge.models.Triggers; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class TriggersImpl implements Triggers { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TriggersImpl.class); + + private final TriggersClient innerClient; + + private final DataBoxEdgeManager serviceManager; + + public TriggersImpl(TriggersClient innerClient, DataBoxEdgeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName); + return inner.mapPage(inner1 -> new TriggerImpl(inner1, this.manager())); + } + + public PagedIterable listByDataBoxEdgeDevice( + String deviceName, String resourceGroupName, String filter, Context context) { + PagedIterable inner = + this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName, filter, context); + return inner.mapPage(inner1 -> new TriggerImpl(inner1, this.manager())); + } + + public Trigger get(String deviceName, String name, String resourceGroupName) { + TriggerInner inner = this.serviceClient().get(deviceName, name, resourceGroupName); + if (inner != null) { + return new TriggerImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String deviceName, String name, String resourceGroupName, Context context) { + Response inner = + this.serviceClient().getWithResponse(deviceName, name, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TriggerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Trigger createOrUpdate(String deviceName, String name, String resourceGroupName, TriggerInner trigger) { + TriggerInner inner = this.serviceClient().createOrUpdate(deviceName, name, resourceGroupName, trigger); + if (inner != null) { + return new TriggerImpl(inner, this.manager()); + } else { + return null; + } + } + + public Trigger createOrUpdate( + String deviceName, String name, String resourceGroupName, TriggerInner trigger, Context context) { + TriggerInner inner = this.serviceClient().createOrUpdate(deviceName, name, resourceGroupName, trigger, context); + if (inner != null) { + return new TriggerImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String deviceName, String name, String resourceGroupName) { + this.serviceClient().delete(deviceName, name, resourceGroupName); + } + + public void delete(String deviceName, String name, String resourceGroupName, Context context) { + this.serviceClient().delete(deviceName, name, resourceGroupName, context); + } + + private TriggersClient serviceClient() { + return this.innerClient; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UpdateSummaryImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UpdateSummaryImpl.java new file mode 100644 index 0000000000000..05daa382b82fb --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UpdateSummaryImpl.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.models.UpdateSummaryInner; +import com.azure.resourcemanager.databoxedge.models.InstallRebootBehavior; +import com.azure.resourcemanager.databoxedge.models.UpdateOperation; +import com.azure.resourcemanager.databoxedge.models.UpdateSummary; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class UpdateSummaryImpl implements UpdateSummary { + private UpdateSummaryInner innerObject; + + private final DataBoxEdgeManager serviceManager; + + UpdateSummaryImpl(UpdateSummaryInner innerObject, DataBoxEdgeManager 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 deviceVersionNumber() { + return this.innerModel().deviceVersionNumber(); + } + + public String friendlyDeviceVersionName() { + return this.innerModel().friendlyDeviceVersionName(); + } + + public OffsetDateTime deviceLastScannedDateTime() { + return this.innerModel().deviceLastScannedDateTime(); + } + + public OffsetDateTime lastCompletedScanJobDateTime() { + return this.innerModel().lastCompletedScanJobDateTime(); + } + + public OffsetDateTime lastCompletedDownloadJobDateTime() { + return this.innerModel().lastCompletedDownloadJobDateTime(); + } + + public OffsetDateTime lastCompletedInstallJobDateTime() { + return this.innerModel().lastCompletedInstallJobDateTime(); + } + + public Integer totalNumberOfUpdatesAvailable() { + return this.innerModel().totalNumberOfUpdatesAvailable(); + } + + public Integer totalNumberOfUpdatesPendingDownload() { + return this.innerModel().totalNumberOfUpdatesPendingDownload(); + } + + public Integer totalNumberOfUpdatesPendingInstall() { + return this.innerModel().totalNumberOfUpdatesPendingInstall(); + } + + public InstallRebootBehavior rebootBehavior() { + return this.innerModel().rebootBehavior(); + } + + public UpdateOperation ongoingUpdateOperation() { + return this.innerModel().ongoingUpdateOperation(); + } + + public String inProgressDownloadJobId() { + return this.innerModel().inProgressDownloadJobId(); + } + + public String inProgressInstallJobId() { + return this.innerModel().inProgressInstallJobId(); + } + + public OffsetDateTime inProgressDownloadJobStartedDateTime() { + return this.innerModel().inProgressDownloadJobStartedDateTime(); + } + + public OffsetDateTime inProgressInstallJobStartedDateTime() { + return this.innerModel().inProgressInstallJobStartedDateTime(); + } + + public List updateTitles() { + List inner = this.innerModel().updateTitles(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Double totalUpdateSizeInBytes() { + return this.innerModel().totalUpdateSizeInBytes(); + } + + public UpdateSummaryInner innerModel() { + return this.innerObject; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UploadCertificateResponseImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UploadCertificateResponseImpl.java new file mode 100644 index 0000000000000..904cbc27f4198 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UploadCertificateResponseImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.models.UploadCertificateResponseInner; +import com.azure.resourcemanager.databoxedge.models.AuthenticationType; +import com.azure.resourcemanager.databoxedge.models.UploadCertificateResponse; + +public final class UploadCertificateResponseImpl implements UploadCertificateResponse { + private UploadCertificateResponseInner innerObject; + + private final DataBoxEdgeManager serviceManager; + + UploadCertificateResponseImpl(UploadCertificateResponseInner innerObject, DataBoxEdgeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public AuthenticationType authType() { + return this.innerModel().authType(); + } + + public String resourceId() { + return this.innerModel().resourceId(); + } + + public String aadAuthority() { + return this.innerModel().aadAuthority(); + } + + public String aadTenantId() { + return this.innerModel().aadTenantId(); + } + + public String servicePrincipalClientId() { + return this.innerModel().servicePrincipalClientId(); + } + + public String servicePrincipalObjectId() { + return this.innerModel().servicePrincipalObjectId(); + } + + public String azureManagementEndpointAudience() { + return this.innerModel().azureManagementEndpointAudience(); + } + + public String aadAudience() { + return this.innerModel().aadAudience(); + } + + public UploadCertificateResponseInner innerModel() { + return this.innerObject; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UserImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UserImpl.java new file mode 100644 index 0000000000000..8da2a474e822f --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UserImpl.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.models.UserInner; +import com.azure.resourcemanager.databoxedge.models.AsymmetricEncryptedSecret; +import com.azure.resourcemanager.databoxedge.models.ShareAccessRight; +import com.azure.resourcemanager.databoxedge.models.User; +import com.azure.resourcemanager.databoxedge.models.UserType; +import java.util.Collections; +import java.util.List; + +public final class UserImpl implements User, User.Definition, User.Update { + private UserInner innerObject; + + private final DataBoxEdgeManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public AsymmetricEncryptedSecret encryptedPassword() { + return this.innerModel().encryptedPassword(); + } + + public List shareAccessRights() { + List inner = this.innerModel().shareAccessRights(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public UserType userType() { + return this.innerModel().userType(); + } + + public UserInner innerModel() { + return this.innerObject; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } + + private String deviceName; + + private String name; + + private String resourceGroupName; + + public UserImpl withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + this.deviceName = deviceName; + this.resourceGroupName = resourceGroupName; + return this; + } + + public User create() { + this.innerObject = + serviceManager + .serviceClient() + .getUsers() + .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), Context.NONE); + return this; + } + + public User create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getUsers() + .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), context); + return this; + } + + UserImpl(String name, DataBoxEdgeManager serviceManager) { + this.innerObject = new UserInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public UserImpl update() { + return this; + } + + public User apply() { + this.innerObject = + serviceManager + .serviceClient() + .getUsers() + .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), Context.NONE); + return this; + } + + public User apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getUsers() + .createOrUpdate(deviceName, name, resourceGroupName, this.innerModel(), context); + return this; + } + + UserImpl(UserInner innerObject, DataBoxEdgeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.deviceName = Utils.getValueFromIdByName(innerObject.id(), "dataBoxEdgeDevices"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "users"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + } + + public User refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getUsers() + .getWithResponse(deviceName, name, resourceGroupName, Context.NONE) + .getValue(); + return this; + } + + public User refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getUsers() + .getWithResponse(deviceName, name, resourceGroupName, context) + .getValue(); + return this; + } + + public UserImpl withUserType(UserType userType) { + this.innerModel().withUserType(userType); + return this; + } + + public UserImpl withEncryptedPassword(AsymmetricEncryptedSecret encryptedPassword) { + this.innerModel().withEncryptedPassword(encryptedPassword); + return this; + } + + public UserImpl withShareAccessRights(List shareAccessRights) { + this.innerModel().withShareAccessRights(shareAccessRights); + return this; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UsersClientImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UsersClientImpl.java new file mode 100644 index 0000000000000..b0d984dae5e28 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UsersClientImpl.java @@ -0,0 +1,1113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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.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.databoxedge.fluent.UsersClient; +import com.azure.resourcemanager.databoxedge.fluent.models.UserInner; +import com.azure.resourcemanager.databoxedge.models.UserList; +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 UsersClient. */ +public final class UsersClientImpl implements UsersClient { + private final ClientLogger logger = new ClientLogger(UsersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final UsersService service; + + /** The service client containing this operation class. */ + private final DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of UsersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UsersClientImpl(DataBoxEdgeManagementClientImpl client) { + this.service = RestProxy.create(UsersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataBoxEdgeManagementClientUsers to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataBoxEdgeManagemen") + private interface UsersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/users") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDevice( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/users/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("name") String name, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/users/{name}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("name") String name, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UserInner user, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge" + + "/dataBoxEdgeDevices/{deviceName}/users/{name}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("deviceName") String deviceName, + @PathParam("name") String name, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDataBoxEdgeDeviceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all the users registered on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param filter Specify $filter='UserType eq <type>' to filter on user type property. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the users registered on a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceSinglePageAsync( + String deviceName, String resourceGroupName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .listByDataBoxEdgeDevice( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + filter, + 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 all the users registered on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param filter Specify $filter='UserType eq <type>' to filter on user type property. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the users registered on a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceSinglePageAsync( + String deviceName, String resourceGroupName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and 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 + .listByDataBoxEdgeDevice( + this.client.getEndpoint(), + deviceName, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all the users registered on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param filter Specify $filter='UserType eq <type>' to filter on user type property. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the users registered on a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync( + String deviceName, String resourceGroupName, String filter) { + return new PagedFlux<>( + () -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, filter), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the users registered on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the users registered on a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync(String deviceName, String resourceGroupName) { + final String filter = null; + return new PagedFlux<>( + () -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, filter), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the users registered on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param filter Specify $filter='UserType eq <type>' to filter on user type property. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the users registered on a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDataBoxEdgeDeviceAsync( + String deviceName, String resourceGroupName, String filter, Context context) { + return new PagedFlux<>( + () -> listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, filter, context), + nextLink -> listByDataBoxEdgeDeviceNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the users registered on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the users registered on a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + final String filter = null; + return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName, filter)); + } + + /** + * Gets all the users registered on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param filter Specify $filter='UserType eq <type>' to filter on user type property. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the users registered on a Data Box Edge/Data Box Gateway device. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDataBoxEdgeDevice( + String deviceName, String resourceGroupName, String filter, Context context) { + return new PagedIterable<>(listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName, filter, context)); + } + + /** + * Gets the properties of the specified user. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified user. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String deviceName, String name, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .get( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the properties of the specified user. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified user. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String deviceName, String name, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .get( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the properties of the specified user. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified user. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String deviceName, String name, String resourceGroupName) { + return getWithResponseAsync(deviceName, name, resourceGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the properties of the specified user. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified user. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UserInner get(String deviceName, String name, String resourceGroupName) { + return getAsync(deviceName, name, resourceGroupName).block(); + } + + /** + * Gets the properties of the specified user. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified user. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String deviceName, String name, String resourceGroupName, Context context) { + return getWithResponseAsync(deviceName, name, resourceGroupName, context).block(); + } + + /** + * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param user The user 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 represents a user who has access to one or more shares on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String deviceName, String name, String resourceGroupName, UserInner user) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 (user == null) { + return Mono.error(new IllegalArgumentException("Parameter user is required and cannot be null.")); + } else { + user.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + user, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param user The user 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 represents a user who has access to one or more shares on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String deviceName, String name, String resourceGroupName, UserInner user, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 (user == null) { + return Mono.error(new IllegalArgumentException("Parameter user is required and cannot be null.")); + } else { + user.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + user, + accept, + context); + } + + /** + * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param user The user 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 represents a user who has access to one or more shares on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, UserInner> beginCreateOrUpdateAsync( + String deviceName, String name, String resourceGroupName, UserInner user) { + Mono>> mono = + createOrUpdateWithResponseAsync(deviceName, name, resourceGroupName, user); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), UserInner.class, UserInner.class, Context.NONE); + } + + /** + * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param user The user 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 represents a user who has access to one or more shares on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, UserInner> beginCreateOrUpdateAsync( + String deviceName, String name, String resourceGroupName, UserInner user, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(deviceName, name, resourceGroupName, user, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), UserInner.class, UserInner.class, context); + } + + /** + * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param user The user 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 represents a user who has access to one or more shares on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, UserInner> beginCreateOrUpdate( + String deviceName, String name, String resourceGroupName, UserInner user) { + return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, user).getSyncPoller(); + } + + /** + * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param user The user 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 represents a user who has access to one or more shares on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, UserInner> beginCreateOrUpdate( + String deviceName, String name, String resourceGroupName, UserInner user, Context context) { + return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, user, context).getSyncPoller(); + } + + /** + * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param user The user 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 represents a user who has access to one or more shares on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String deviceName, String name, String resourceGroupName, UserInner user) { + return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, user) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param user The user 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 represents a user who has access to one or more shares on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String deviceName, String name, String resourceGroupName, UserInner user, Context context) { + return beginCreateOrUpdateAsync(deviceName, name, resourceGroupName, user, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param user The user 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 represents a user who has access to one or more shares on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UserInner createOrUpdate(String deviceName, String name, String resourceGroupName, UserInner user) { + return createOrUpdateAsync(deviceName, name, resourceGroupName, user).block(); + } + + /** + * Creates a new user or updates an existing user's information on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param user The user 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 represents a user who has access to one or more shares on the Data Box Edge/Gateway device. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UserInner createOrUpdate( + String deviceName, String name, String resourceGroupName, UserInner user, Context context) { + return createOrUpdateAsync(deviceName, name, resourceGroupName, user, context).block(); + } + + /** + * Deletes the user on a databox edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .delete( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the user on a databox edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and 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 + .delete( + this.client.getEndpoint(), + deviceName, + name, + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the user on a databox edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName) { + Mono>> mono = deleteWithResponseAsync(deviceName, name, resourceGroupName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the user on a databox edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(deviceName, name, resourceGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the user on a databox edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName) { + return beginDeleteAsync(deviceName, name, resourceGroupName).getSyncPoller(); + } + + /** + * Deletes the user on a databox edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName, Context context) { + return beginDeleteAsync(deviceName, name, resourceGroupName, context).getSyncPoller(); + } + + /** + * Deletes the user on a databox edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName) { + return beginDeleteAsync(deviceName, name, resourceGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the user on a databox edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deviceName, String name, String resourceGroupName, Context context) { + return beginDeleteAsync(deviceName, name, resourceGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the user on a databox edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deviceName, String name, String resourceGroupName) { + deleteAsync(deviceName, name, resourceGroupName).block(); + } + + /** + * Deletes the user on a databox edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deviceName, String name, String resourceGroupName, Context context) { + deleteAsync(deviceName, name, resourceGroupName, 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 collection of users. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync(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.listByDataBoxEdgeDeviceNext(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 collection of users. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDataBoxEdgeDeviceNextSinglePageAsync( + 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 + .listByDataBoxEdgeDeviceNext(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/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UsersImpl.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UsersImpl.java new file mode 100644 index 0000000000000..db02454b6efb1 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/UsersImpl.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.databoxedge.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.databoxedge.DataBoxEdgeManager; +import com.azure.resourcemanager.databoxedge.fluent.UsersClient; +import com.azure.resourcemanager.databoxedge.fluent.models.UserInner; +import com.azure.resourcemanager.databoxedge.models.User; +import com.azure.resourcemanager.databoxedge.models.Users; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class UsersImpl implements Users { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsersImpl.class); + + private final UsersClient innerClient; + + private final DataBoxEdgeManager serviceManager; + + public UsersImpl(UsersClient innerClient, DataBoxEdgeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName); + return inner.mapPage(inner1 -> new UserImpl(inner1, this.manager())); + } + + public PagedIterable listByDataBoxEdgeDevice( + String deviceName, String resourceGroupName, String filter, Context context) { + PagedIterable inner = + this.serviceClient().listByDataBoxEdgeDevice(deviceName, resourceGroupName, filter, context); + return inner.mapPage(inner1 -> new UserImpl(inner1, this.manager())); + } + + public User get(String deviceName, String name, String resourceGroupName) { + UserInner inner = this.serviceClient().get(deviceName, name, resourceGroupName); + if (inner != null) { + return new UserImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context) { + Response inner = this.serviceClient().getWithResponse(deviceName, name, resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new UserImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String deviceName, String name, String resourceGroupName) { + this.serviceClient().delete(deviceName, name, resourceGroupName); + } + + public void delete(String deviceName, String name, String resourceGroupName, Context context) { + this.serviceClient().delete(deviceName, name, resourceGroupName, context); + } + + public User getById(String id) { + String deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String name = Utils.getValueFromIdByName(id, "users"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", 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))); + } + return this.getWithResponse(deviceName, name, resourceGroupName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String name = Utils.getValueFromIdByName(id, "users"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", 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))); + } + return this.getWithResponse(deviceName, name, resourceGroupName, context); + } + + public void deleteById(String id) { + String deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String name = Utils.getValueFromIdByName(id, "users"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", 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))); + } + this.delete(deviceName, name, resourceGroupName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String deviceName = Utils.getValueFromIdByName(id, "dataBoxEdgeDevices"); + if (deviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dataBoxEdgeDevices'.", id))); + } + String name = Utils.getValueFromIdByName(id, "users"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'users'.", 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))); + } + this.delete(deviceName, name, resourceGroupName, context); + } + + private UsersClient serviceClient() { + return this.innerClient; + } + + private DataBoxEdgeManager manager() { + return this.serviceManager; + } + + public UserImpl define(String name) { + return new UserImpl(name, this.manager()); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/Utils.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/Utils.java new file mode 100644 index 0000000000000..9e1824c77b6b3 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/Utils.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.implementation; + +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; + +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; + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/package-info.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/package-info.java new file mode 100644 index 0000000000000..5850eac6525d2 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for DataBoxEdgeManagementClient. null. */ +package com.azure.resourcemanager.databoxedge.implementation; diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AccountType.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AccountType.java new file mode 100644 index 0000000000000..ec8698119ebfa --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AccountType.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AccountType. */ +public final class AccountType extends ExpandableStringEnum { + /** Static value GeneralPurposeStorage for AccountType. */ + public static final AccountType GENERAL_PURPOSE_STORAGE = fromString("GeneralPurposeStorage"); + + /** Static value BlobStorage for AccountType. */ + public static final AccountType BLOB_STORAGE = fromString("BlobStorage"); + + /** + * Creates or finds a AccountType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccountType. + */ + @JsonCreator + public static AccountType fromString(String name) { + return fromString(name, AccountType.class); + } + + /** @return known AccountType values. */ + public static Collection values() { + return values(AccountType.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Address.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Address.java new file mode 100644 index 0000000000000..182dc4b24e947 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Address.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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 shipping address of the customer. */ +@Fluent +public final class Address { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Address.class); + + /* + * The address line1. + */ + @JsonProperty(value = "addressLine1", required = true) + private String addressLine1; + + /* + * The address line2. + */ + @JsonProperty(value = "addressLine2") + private String addressLine2; + + /* + * The address line3. + */ + @JsonProperty(value = "addressLine3") + private String addressLine3; + + /* + * The postal code. + */ + @JsonProperty(value = "postalCode", required = true) + private String postalCode; + + /* + * The city name. + */ + @JsonProperty(value = "city", required = true) + private String city; + + /* + * The state name. + */ + @JsonProperty(value = "state", required = true) + private String state; + + /* + * The country name. + */ + @JsonProperty(value = "country", required = true) + private String country; + + /** + * Get the addressLine1 property: The address line1. + * + * @return the addressLine1 value. + */ + public String addressLine1() { + return this.addressLine1; + } + + /** + * Set the addressLine1 property: The address line1. + * + * @param addressLine1 the addressLine1 value to set. + * @return the Address object itself. + */ + public Address withAddressLine1(String addressLine1) { + this.addressLine1 = addressLine1; + return this; + } + + /** + * Get the addressLine2 property: The address line2. + * + * @return the addressLine2 value. + */ + public String addressLine2() { + return this.addressLine2; + } + + /** + * Set the addressLine2 property: The address line2. + * + * @param addressLine2 the addressLine2 value to set. + * @return the Address object itself. + */ + public Address withAddressLine2(String addressLine2) { + this.addressLine2 = addressLine2; + return this; + } + + /** + * Get the addressLine3 property: The address line3. + * + * @return the addressLine3 value. + */ + public String addressLine3() { + return this.addressLine3; + } + + /** + * Set the addressLine3 property: The address line3. + * + * @param addressLine3 the addressLine3 value to set. + * @return the Address object itself. + */ + public Address withAddressLine3(String addressLine3) { + this.addressLine3 = addressLine3; + return this; + } + + /** + * Get the postalCode property: The postal code. + * + * @return the postalCode value. + */ + public String postalCode() { + return this.postalCode; + } + + /** + * Set the postalCode property: The postal code. + * + * @param postalCode the postalCode value to set. + * @return the Address object itself. + */ + public Address withPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** + * Get the city property: The city name. + * + * @return the city value. + */ + public String city() { + return this.city; + } + + /** + * Set the city property: The city name. + * + * @param city the city value to set. + * @return the Address object itself. + */ + public Address withCity(String city) { + this.city = city; + return this; + } + + /** + * Get the state property: The state name. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Set the state property: The state name. + * + * @param state the state value to set. + * @return the Address object itself. + */ + public Address withState(String state) { + this.state = state; + return this; + } + + /** + * Get the country property: The country name. + * + * @return the country value. + */ + public String country() { + return this.country; + } + + /** + * Set the country property: The country name. + * + * @param country the country value to set. + * @return the Address object itself. + */ + public Address withCountry(String country) { + this.country = country; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (addressLine1() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property addressLine1 in model Address")); + } + if (postalCode() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property postalCode in model Address")); + } + if (city() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property city in model Address")); + } + if (state() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property state in model Address")); + } + if (country() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property country in model Address")); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Alert.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Alert.java new file mode 100644 index 0000000000000..7e1f872b4d8de --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Alert.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.resourcemanager.databoxedge.fluent.models.AlertInner; +import java.time.OffsetDateTime; +import java.util.Map; + +/** An immutable client-side representation of Alert. */ +public interface Alert { + /** + * 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 title property: Alert title. + * + * @return the title value. + */ + String title(); + + /** + * Gets the alertType property: Alert type. + * + * @return the alertType value. + */ + String alertType(); + + /** + * Gets the appearedAtDateTime property: UTC time when the alert appeared. + * + * @return the appearedAtDateTime value. + */ + OffsetDateTime appearedAtDateTime(); + + /** + * Gets the recommendation property: Alert recommendation. + * + * @return the recommendation value. + */ + String recommendation(); + + /** + * Gets the severity property: Severity of the alert. + * + * @return the severity value. + */ + AlertSeverity severity(); + + /** + * Gets the errorDetails property: Error details of the alert. + * + * @return the errorDetails value. + */ + AlertErrorDetails errorDetails(); + + /** + * Gets the detailedInformation property: Alert details. + * + * @return the detailedInformation value. + */ + Map detailedInformation(); + + /** + * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.AlertInner object. + * + * @return the inner object. + */ + AlertInner innerModel(); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AlertErrorDetails.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AlertErrorDetails.java new file mode 100644 index 0000000000000..84b6373fec1bc --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AlertErrorDetails.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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; + +/** Error details for the alert. */ +@Immutable +public final class AlertErrorDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertErrorDetails.class); + + /* + * Error code. + */ + @JsonProperty(value = "errorCode", access = JsonProperty.Access.WRITE_ONLY) + private String errorCode; + + /* + * Error Message. + */ + @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY) + private String errorMessage; + + /* + * Number of occurrences. + */ + @JsonProperty(value = "occurrences", access = JsonProperty.Access.WRITE_ONLY) + private Integer occurrences; + + /** + * Get the errorCode property: Error code. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Get the errorMessage property: Error Message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Get the occurrences property: Number of occurrences. + * + * @return the occurrences value. + */ + public Integer occurrences() { + return this.occurrences; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AlertList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AlertList.java new file mode 100644 index 0000000000000..3e582202120ea --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AlertList.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.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.models.AlertInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of alerts. */ +@Immutable +public final class AlertList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AlertList.class); + + /* + * The value. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The value. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to the next set 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/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AlertSeverity.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AlertSeverity.java new file mode 100644 index 0000000000000..c326648c20148 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AlertSeverity.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AlertSeverity. */ +public final class AlertSeverity extends ExpandableStringEnum { + /** Static value Informational for AlertSeverity. */ + public static final AlertSeverity INFORMATIONAL = fromString("Informational"); + + /** Static value Warning for AlertSeverity. */ + public static final AlertSeverity WARNING = fromString("Warning"); + + /** Static value Critical for AlertSeverity. */ + public static final AlertSeverity CRITICAL = fromString("Critical"); + + /** + * Creates or finds a AlertSeverity from its string representation. + * + * @param name a name to look for. + * @return the corresponding AlertSeverity. + */ + @JsonCreator + public static AlertSeverity fromString(String name) { + return fromString(name, AlertSeverity.class); + } + + /** @return known AlertSeverity values. */ + public static Collection values() { + return values(AlertSeverity.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Alerts.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Alerts.java new file mode 100644 index 0000000000000..fbc14d539f4a3 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Alerts.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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 Alerts. */ +public interface Alerts { + /** + * Gets all the alerts for a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the alerts for a Data Box Edge/Data Box Gateway device. + */ + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + + /** + * Gets all the alerts for a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the alerts for a Data Box Edge/Data Box Gateway device. + */ + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context); + + /** + * Gets an alert by name. + * + * @param deviceName The device name. + * @param name The alert name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an alert by name. + */ + Alert get(String deviceName, String name, String resourceGroupName); + + /** + * Gets an alert by name. + * + * @param deviceName The device name. + * @param name The alert name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an alert by name. + */ + Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ArmBaseModel.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ArmBaseModel.java new file mode 100644 index 0000000000000..3e0d42a7b61c3 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ArmBaseModel.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.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Represents the base class for all object models. */ +@Immutable +public class ArmBaseModel extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ArmBaseModel.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AsymmetricEncryptedSecret.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AsymmetricEncryptedSecret.java new file mode 100644 index 0000000000000..4f5598dc807b3 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AsymmetricEncryptedSecret.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.databoxedge.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; + +/** Represent the secrets intended for encryption with asymmetric key pair. */ +@Fluent +public final class AsymmetricEncryptedSecret { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AsymmetricEncryptedSecret.class); + + /* + * The value of the secret. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /* + * Thumbprint certificate used to encrypt \"Value\". If the value is + * unencrypted, it will be null. + */ + @JsonProperty(value = "encryptionCertThumbprint") + private String encryptionCertThumbprint; + + /* + * The algorithm used to encrypt "Value". + */ + @JsonProperty(value = "encryptionAlgorithm", required = true) + private EncryptionAlgorithm encryptionAlgorithm; + + /** + * Get the value property: The value of the secret. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the secret. + * + * @param value the value value to set. + * @return the AsymmetricEncryptedSecret object itself. + */ + public AsymmetricEncryptedSecret withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the encryptionCertThumbprint property: Thumbprint certificate used to encrypt \"Value\". If the value is + * unencrypted, it will be null. + * + * @return the encryptionCertThumbprint value. + */ + public String encryptionCertThumbprint() { + return this.encryptionCertThumbprint; + } + + /** + * Set the encryptionCertThumbprint property: Thumbprint certificate used to encrypt \"Value\". If the value is + * unencrypted, it will be null. + * + * @param encryptionCertThumbprint the encryptionCertThumbprint value to set. + * @return the AsymmetricEncryptedSecret object itself. + */ + public AsymmetricEncryptedSecret withEncryptionCertThumbprint(String encryptionCertThumbprint) { + this.encryptionCertThumbprint = encryptionCertThumbprint; + return this; + } + + /** + * Get the encryptionAlgorithm property: The algorithm used to encrypt "Value". + * + * @return the encryptionAlgorithm value. + */ + public EncryptionAlgorithm encryptionAlgorithm() { + return this.encryptionAlgorithm; + } + + /** + * Set the encryptionAlgorithm property: The algorithm used to encrypt "Value". + * + * @param encryptionAlgorithm the encryptionAlgorithm value to set. + * @return the AsymmetricEncryptedSecret object itself. + */ + public AsymmetricEncryptedSecret withEncryptionAlgorithm(EncryptionAlgorithm encryptionAlgorithm) { + this.encryptionAlgorithm = encryptionAlgorithm; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model AsymmetricEncryptedSecret")); + } + if (encryptionAlgorithm() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property encryptionAlgorithm in model AsymmetricEncryptedSecret")); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Authentication.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Authentication.java new file mode 100644 index 0000000000000..3a30ccd8fd48e --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Authentication.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.databoxedge.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; + +/** Authentication mechanism for IoT devices. */ +@Fluent +public final class Authentication { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Authentication.class); + + /* + * Symmetric key for authentication. + */ + @JsonProperty(value = "symmetricKey") + private SymmetricKey symmetricKey; + + /** + * Get the symmetricKey property: Symmetric key for authentication. + * + * @return the symmetricKey value. + */ + public SymmetricKey symmetricKey() { + return this.symmetricKey; + } + + /** + * Set the symmetricKey property: Symmetric key for authentication. + * + * @param symmetricKey the symmetricKey value to set. + * @return the Authentication object itself. + */ + public Authentication withSymmetricKey(SymmetricKey symmetricKey) { + this.symmetricKey = symmetricKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (symmetricKey() != null) { + symmetricKey().validate(); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AuthenticationType.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AuthenticationType.java new file mode 100644 index 0000000000000..94b60bc068921 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AuthenticationType.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AuthenticationType. */ +public final class AuthenticationType extends ExpandableStringEnum { + /** Static value Invalid for AuthenticationType. */ + public static final AuthenticationType INVALID = fromString("Invalid"); + + /** Static value AzureActiveDirectory for AuthenticationType. */ + public static final AuthenticationType AZURE_ACTIVE_DIRECTORY = fromString("AzureActiveDirectory"); + + /** + * Creates or finds a AuthenticationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AuthenticationType. + */ + @JsonCreator + public static AuthenticationType fromString(String name) { + return fromString(name, AuthenticationType.class); + } + + /** @return known AuthenticationType values. */ + public static Collection values() { + return values(AuthenticationType.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AzureContainerDataFormat.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AzureContainerDataFormat.java new file mode 100644 index 0000000000000..27643bf2704a4 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AzureContainerDataFormat.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AzureContainerDataFormat. */ +public final class AzureContainerDataFormat extends ExpandableStringEnum { + /** Static value BlockBlob for AzureContainerDataFormat. */ + public static final AzureContainerDataFormat BLOCK_BLOB = fromString("BlockBlob"); + + /** Static value PageBlob for AzureContainerDataFormat. */ + public static final AzureContainerDataFormat PAGE_BLOB = fromString("PageBlob"); + + /** Static value AzureFile for AzureContainerDataFormat. */ + public static final AzureContainerDataFormat AZURE_FILE = fromString("AzureFile"); + + /** + * Creates or finds a AzureContainerDataFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureContainerDataFormat. + */ + @JsonCreator + public static AzureContainerDataFormat fromString(String name) { + return fromString(name, AzureContainerDataFormat.class); + } + + /** @return known AzureContainerDataFormat values. */ + public static Collection values() { + return values(AzureContainerDataFormat.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AzureContainerInfo.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AzureContainerInfo.java new file mode 100644 index 0000000000000..a2c2b6bd32c7b --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/AzureContainerInfo.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure container mapping of the endpoint. */ +@Fluent +public final class AzureContainerInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureContainerInfo.class); + + /* + * ID of the storage account credential used to access storage. + */ + @JsonProperty(value = "storageAccountCredentialId", required = true) + private String storageAccountCredentialId; + + /* + * Container name (Based on the data format specified, this represents the + * name of Azure Files/Page blob/Block blob). + */ + @JsonProperty(value = "containerName", required = true) + private String containerName; + + /* + * Storage format used for the file represented by the share. + */ + @JsonProperty(value = "dataFormat", required = true) + private AzureContainerDataFormat dataFormat; + + /** + * Get the storageAccountCredentialId property: ID of the storage account credential used to access storage. + * + * @return the storageAccountCredentialId value. + */ + public String storageAccountCredentialId() { + return this.storageAccountCredentialId; + } + + /** + * Set the storageAccountCredentialId property: ID of the storage account credential used to access storage. + * + * @param storageAccountCredentialId the storageAccountCredentialId value to set. + * @return the AzureContainerInfo object itself. + */ + public AzureContainerInfo withStorageAccountCredentialId(String storageAccountCredentialId) { + this.storageAccountCredentialId = storageAccountCredentialId; + return this; + } + + /** + * Get the containerName property: Container name (Based on the data format specified, this represents the name of + * Azure Files/Page blob/Block blob). + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: Container name (Based on the data format specified, this represents the name of + * Azure Files/Page blob/Block blob). + * + * @param containerName the containerName value to set. + * @return the AzureContainerInfo object itself. + */ + public AzureContainerInfo withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the dataFormat property: Storage format used for the file represented by the share. + * + * @return the dataFormat value. + */ + public AzureContainerDataFormat dataFormat() { + return this.dataFormat; + } + + /** + * Set the dataFormat property: Storage format used for the file represented by the share. + * + * @param dataFormat the dataFormat value to set. + * @return the AzureContainerInfo object itself. + */ + public AzureContainerInfo withDataFormat(AzureContainerDataFormat dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storageAccountCredentialId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storageAccountCredentialId in model AzureContainerInfo")); + } + if (containerName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property containerName in model AzureContainerInfo")); + } + if (dataFormat() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property dataFormat in model AzureContainerInfo")); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/BandwidthSchedule.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/BandwidthSchedule.java new file mode 100644 index 0000000000000..bec185f0c8286 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/BandwidthSchedule.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.databoxedge.fluent.models.BandwidthScheduleInner; +import java.util.List; + +/** An immutable client-side representation of BandwidthSchedule. */ +public interface BandwidthSchedule { + /** + * 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 start property: The start time of the schedule in UTC. + * + * @return the start value. + */ + String start(); + + /** + * Gets the stop property: The stop time of the schedule in UTC. + * + * @return the stop value. + */ + String stop(); + + /** + * Gets the rateInMbps property: The bandwidth rate in Mbps. + * + * @return the rateInMbps value. + */ + int rateInMbps(); + + /** + * Gets the days property: The days of the week when this schedule is applicable. + * + * @return the days value. + */ + List days(); + + /** + * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.BandwidthScheduleInner object. + * + * @return the inner object. + */ + BandwidthScheduleInner innerModel(); + + /** The entirety of the BandwidthSchedule definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithStart, + DefinitionStages.WithStop, + DefinitionStages.WithRateInMbps, + DefinitionStages.WithDays, + DefinitionStages.WithCreate { + } + /** The BandwidthSchedule definition stages. */ + interface DefinitionStages { + /** The first stage of the BandwidthSchedule definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the BandwidthSchedule definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies deviceName, resourceGroupName. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @return the next definition stage. + */ + WithStart withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName); + } + /** The stage of the BandwidthSchedule definition allowing to specify start. */ + interface WithStart { + /** + * Specifies the start property: The start time of the schedule in UTC.. + * + * @param start The start time of the schedule in UTC. + * @return the next definition stage. + */ + WithStop withStart(String start); + } + /** The stage of the BandwidthSchedule definition allowing to specify stop. */ + interface WithStop { + /** + * Specifies the stop property: The stop time of the schedule in UTC.. + * + * @param stop The stop time of the schedule in UTC. + * @return the next definition stage. + */ + WithRateInMbps withStop(String stop); + } + /** The stage of the BandwidthSchedule definition allowing to specify rateInMbps. */ + interface WithRateInMbps { + /** + * Specifies the rateInMbps property: The bandwidth rate in Mbps.. + * + * @param rateInMbps The bandwidth rate in Mbps. + * @return the next definition stage. + */ + WithDays withRateInMbps(int rateInMbps); + } + /** The stage of the BandwidthSchedule definition allowing to specify days. */ + interface WithDays { + /** + * Specifies the days property: The days of the week when this schedule is applicable.. + * + * @param days The days of the week when this schedule is applicable. + * @return the next definition stage. + */ + WithCreate withDays(List days); + } + /** + * The stage of the BandwidthSchedule 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. + */ + BandwidthSchedule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BandwidthSchedule create(Context context); + } + } + /** + * Begins update for the BandwidthSchedule resource. + * + * @return the stage of resource update. + */ + BandwidthSchedule.Update update(); + + /** The template for BandwidthSchedule update. */ + interface Update + extends UpdateStages.WithStart, UpdateStages.WithStop, UpdateStages.WithRateInMbps, UpdateStages.WithDays { + /** + * Executes the update request. + * + * @return the updated resource. + */ + BandwidthSchedule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + BandwidthSchedule apply(Context context); + } + /** The BandwidthSchedule update stages. */ + interface UpdateStages { + /** The stage of the BandwidthSchedule update allowing to specify start. */ + interface WithStart { + /** + * Specifies the start property: The start time of the schedule in UTC.. + * + * @param start The start time of the schedule in UTC. + * @return the next definition stage. + */ + Update withStart(String start); + } + /** The stage of the BandwidthSchedule update allowing to specify stop. */ + interface WithStop { + /** + * Specifies the stop property: The stop time of the schedule in UTC.. + * + * @param stop The stop time of the schedule in UTC. + * @return the next definition stage. + */ + Update withStop(String stop); + } + /** The stage of the BandwidthSchedule update allowing to specify rateInMbps. */ + interface WithRateInMbps { + /** + * Specifies the rateInMbps property: The bandwidth rate in Mbps.. + * + * @param rateInMbps The bandwidth rate in Mbps. + * @return the next definition stage. + */ + Update withRateInMbps(int rateInMbps); + } + /** The stage of the BandwidthSchedule update allowing to specify days. */ + interface WithDays { + /** + * Specifies the days property: The days of the week when this schedule is applicable.. + * + * @param days The days of the week when this schedule is applicable. + * @return the next definition stage. + */ + Update withDays(List days); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + BandwidthSchedule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + BandwidthSchedule refresh(Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/BandwidthSchedules.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/BandwidthSchedules.java new file mode 100644 index 0000000000000..411f3d9486d70 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/BandwidthSchedules.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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 BandwidthSchedules. */ +public interface BandwidthSchedules { + /** + * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + */ + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + + /** + * Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the bandwidth schedules for a Data Box Edge/Data Box Gateway device. + */ + PagedIterable listByDataBoxEdgeDevice( + String deviceName, String resourceGroupName, Context context); + + /** + * Gets the properties of the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified bandwidth schedule. + */ + BandwidthSchedule get(String deviceName, String name, String resourceGroupName); + + /** + * Gets the properties of the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified bandwidth schedule. + */ + Response getWithResponse( + String deviceName, String name, String resourceGroupName, Context context); + + /** + * Deletes the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String name, String resourceGroupName); + + /** + * Deletes the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String name, String resourceGroupName, Context context); + + /** + * Gets the properties of the specified bandwidth schedule. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified bandwidth schedule. + */ + BandwidthSchedule getById(String id); + + /** + * Gets the properties of the specified bandwidth schedule. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified bandwidth schedule. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified bandwidth schedule. + * + * @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 bandwidth schedule. + * + * @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 BandwidthSchedule resource. + * + * @param name resource name. + * @return the first stage of the new BandwidthSchedule definition. + */ + BandwidthSchedule.DefinitionStages.Blank define(String name); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/BandwidthSchedulesList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/BandwidthSchedulesList.java new file mode 100644 index 0000000000000..b9858657e9d3b --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/BandwidthSchedulesList.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.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.models.BandwidthScheduleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The collection of bandwidth schedules. */ +@Immutable +public final class BandwidthSchedulesList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BandwidthSchedulesList.class); + + /* + * The list of bandwidth schedules. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of bandwidth schedules. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to the next set 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/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClientAccessRight.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClientAccessRight.java new file mode 100644 index 0000000000000..ac5d2741846ed --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClientAccessRight.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.databoxedge.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 mapping between a particular client IP and the type of access client has on the NFS share. */ +@Fluent +public final class ClientAccessRight { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientAccessRight.class); + + /* + * IP of the client. + */ + @JsonProperty(value = "client", required = true) + private String client; + + /* + * Type of access to be allowed for the client. + */ + @JsonProperty(value = "accessPermission", required = true) + private ClientPermissionType accessPermission; + + /** + * Get the client property: IP of the client. + * + * @return the client value. + */ + public String client() { + return this.client; + } + + /** + * Set the client property: IP of the client. + * + * @param client the client value to set. + * @return the ClientAccessRight object itself. + */ + public ClientAccessRight withClient(String client) { + this.client = client; + return this; + } + + /** + * Get the accessPermission property: Type of access to be allowed for the client. + * + * @return the accessPermission value. + */ + public ClientPermissionType accessPermission() { + return this.accessPermission; + } + + /** + * Set the accessPermission property: Type of access to be allowed for the client. + * + * @param accessPermission the accessPermission value to set. + * @return the ClientAccessRight object itself. + */ + public ClientAccessRight withAccessPermission(ClientPermissionType accessPermission) { + this.accessPermission = accessPermission; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (client() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property client in model ClientAccessRight")); + } + if (accessPermission() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property accessPermission in model ClientAccessRight")); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClientPermissionType.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClientPermissionType.java new file mode 100644 index 0000000000000..d04e644ad1af6 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ClientPermissionType.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ClientPermissionType. */ +public final class ClientPermissionType extends ExpandableStringEnum { + /** Static value NoAccess for ClientPermissionType. */ + public static final ClientPermissionType NO_ACCESS = fromString("NoAccess"); + + /** Static value ReadOnly for ClientPermissionType. */ + public static final ClientPermissionType READ_ONLY = fromString("ReadOnly"); + + /** Static value ReadWrite for ClientPermissionType. */ + public static final ClientPermissionType READ_WRITE = fromString("ReadWrite"); + + /** + * Creates or finds a ClientPermissionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClientPermissionType. + */ + @JsonCreator + public static ClientPermissionType fromString(String name) { + return fromString(name, ClientPermissionType.class); + } + + /** @return known ClientPermissionType values. */ + public static Collection values() { + return values(ClientPermissionType.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ContactDetails.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ContactDetails.java new file mode 100644 index 0000000000000..e11200db9c6d4 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ContactDetails.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.databoxedge.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; + +/** Contains all the contact details of the customer. */ +@Fluent +public final class ContactDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContactDetails.class); + + /* + * The contact person name. + */ + @JsonProperty(value = "contactPerson", required = true) + private String contactPerson; + + /* + * The name of the company. + */ + @JsonProperty(value = "companyName", required = true) + private String companyName; + + /* + * The phone number. + */ + @JsonProperty(value = "phone", required = true) + private String phone; + + /* + * The email list. + */ + @JsonProperty(value = "emailList", required = true) + private List emailList; + + /** + * Get the contactPerson property: The contact person name. + * + * @return the contactPerson value. + */ + public String contactPerson() { + return this.contactPerson; + } + + /** + * Set the contactPerson property: The contact person name. + * + * @param contactPerson the contactPerson value to set. + * @return the ContactDetails object itself. + */ + public ContactDetails withContactPerson(String contactPerson) { + this.contactPerson = contactPerson; + return this; + } + + /** + * Get the companyName property: The name of the company. + * + * @return the companyName value. + */ + public String companyName() { + return this.companyName; + } + + /** + * Set the companyName property: The name of the company. + * + * @param companyName the companyName value to set. + * @return the ContactDetails object itself. + */ + public ContactDetails withCompanyName(String companyName) { + this.companyName = companyName; + return this; + } + + /** + * Get the phone property: The phone number. + * + * @return the phone value. + */ + public String phone() { + return this.phone; + } + + /** + * Set the phone property: The phone number. + * + * @param phone the phone value to set. + * @return the ContactDetails object itself. + */ + public ContactDetails withPhone(String phone) { + this.phone = phone; + return this; + } + + /** + * Get the emailList property: The email list. + * + * @return the emailList value. + */ + public List emailList() { + return this.emailList; + } + + /** + * Set the emailList property: The email list. + * + * @param emailList the emailList value to set. + * @return the ContactDetails object itself. + */ + public ContactDetails withEmailList(List emailList) { + this.emailList = emailList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (contactPerson() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property contactPerson in model ContactDetails")); + } + if (companyName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property companyName in model ContactDetails")); + } + if (phone() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property phone in model ContactDetails")); + } + if (emailList() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property emailList in model ContactDetails")); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Container.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Container.java new file mode 100644 index 0000000000000..16bdbdc4cebce --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Container.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.databoxedge.fluent.models.ContainerInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of Container. */ +public interface Container { + /** + * 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 containerStatus property: Current status of the container. + * + * @return the containerStatus value. + */ + ContainerStatus containerStatus(); + + /** + * Gets the dataFormat property: DataFormat for Container. + * + * @return the dataFormat value. + */ + AzureContainerDataFormat dataFormat(); + + /** + * Gets the refreshDetails property: Details of the refresh job on this container. + * + * @return the refreshDetails value. + */ + RefreshDetails refreshDetails(); + + /** + * Gets the createdDateTime property: The UTC time when container got created. + * + * @return the createdDateTime value. + */ + OffsetDateTime createdDateTime(); + + /** + * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.ContainerInner object. + * + * @return the inner object. + */ + ContainerInner innerModel(); + + /** The entirety of the Container definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithDataFormat, + DefinitionStages.WithCreate { + } + /** The Container definition stages. */ + interface DefinitionStages { + /** The first stage of the Container definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Container definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies deviceName, storageAccountName, resourceGroupName. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param resourceGroupName The resource group name. + * @return the next definition stage. + */ + WithDataFormat withExistingStorageAccount( + String deviceName, String storageAccountName, String resourceGroupName); + } + /** The stage of the Container definition allowing to specify dataFormat. */ + interface WithDataFormat { + /** + * Specifies the dataFormat property: DataFormat for Container. + * + * @param dataFormat DataFormat for Container. + * @return the next definition stage. + */ + WithCreate withDataFormat(AzureContainerDataFormat dataFormat); + } + /** + * The stage of the Container 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. + */ + Container create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Container create(Context context); + } + } + /** + * Begins update for the Container resource. + * + * @return the stage of resource update. + */ + Container.Update update(); + + /** The template for Container update. */ + interface Update extends UpdateStages.WithDataFormat { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Container apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Container apply(Context context); + } + /** The Container update stages. */ + interface UpdateStages { + /** The stage of the Container update allowing to specify dataFormat. */ + interface WithDataFormat { + /** + * Specifies the dataFormat property: DataFormat for Container. + * + * @param dataFormat DataFormat for Container. + * @return the next definition stage. + */ + Update withDataFormat(AzureContainerDataFormat dataFormat); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Container refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Container refresh(Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ContainerList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ContainerList.java new file mode 100644 index 0000000000000..1518c047f0c25 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ContainerList.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.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.models.ContainerInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of all the containers on the Data Box Edge/Gateway device. */ +@Immutable +public final class ContainerList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerList.class); + + /* + * The list of containers. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of containers. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to the next set 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/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ContainerStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ContainerStatus.java new file mode 100644 index 0000000000000..3b32fd51a1313 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ContainerStatus.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ContainerStatus. */ +public final class ContainerStatus extends ExpandableStringEnum { + /** Static value OK for ContainerStatus. */ + public static final ContainerStatus OK = fromString("OK"); + + /** Static value Offline for ContainerStatus. */ + public static final ContainerStatus OFFLINE = fromString("Offline"); + + /** Static value Unknown for ContainerStatus. */ + public static final ContainerStatus UNKNOWN = fromString("Unknown"); + + /** Static value Updating for ContainerStatus. */ + public static final ContainerStatus UPDATING = fromString("Updating"); + + /** Static value NeedsAttention for ContainerStatus. */ + public static final ContainerStatus NEEDS_ATTENTION = fromString("NeedsAttention"); + + /** + * Creates or finds a ContainerStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerStatus. + */ + @JsonCreator + public static ContainerStatus fromString(String name) { + return fromString(name, ContainerStatus.class); + } + + /** @return known ContainerStatus values. */ + public static Collection values() { + return values(ContainerStatus.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Containers.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Containers.java new file mode 100644 index 0000000000000..f524f69684ca9 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Containers.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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 Containers. */ +public interface Containers { + /** + * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The storage Account name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the containers on the Data Box Edge/Gateway device. + */ + PagedIterable listByStorageAccount( + String deviceName, String storageAccountName, String resourceGroupName); + + /** + * Lists all the containers of a storage Account in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The storage Account name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the containers on the Data Box Edge/Gateway device. + */ + PagedIterable listByStorageAccount( + String deviceName, String storageAccountName, String resourceGroupName, Context context); + + /** + * Gets a container by name. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container Name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 container by name. + */ + Container get(String deviceName, String storageAccountName, String containerName, String resourceGroupName); + + /** + * Gets a container by name. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container Name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 container by name. + */ + Response getWithResponse( + String deviceName, String storageAccountName, String containerName, String resourceGroupName, Context context); + + /** + * Deletes the container on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String storageAccountName, String containerName, String resourceGroupName); + + /** + * Deletes the container on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String storageAccountName, String containerName, String resourceGroupName, Context context); + + /** + * Refreshes the container metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 refresh(String deviceName, String storageAccountName, String containerName, String resourceGroupName); + + /** + * Refreshes the container metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param storageAccountName The Storage Account Name. + * @param containerName The container name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 refresh( + String deviceName, String storageAccountName, String containerName, String resourceGroupName, Context context); + + /** + * Gets a container by 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. + * @return a container by name. + */ + Container getById(String id); + + /** + * Gets a container by 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. + * @return a container by name. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the container on the Data Box Edge/Data Box Gateway device. + * + * @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 container on the Data Box Edge/Data Box Gateway device. + * + * @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 Container resource. + * + * @param name resource name. + * @return the first stage of the new Container definition. + */ + Container.DefinitionStages.Blank define(String name); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDevice.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDevice.java new file mode 100644 index 0000000000000..d89a15ec7d0b7 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDevice.java @@ -0,0 +1,482 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of DataBoxEdgeDevice. */ +public interface DataBoxEdgeDevice { + /** + * 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 location of the device. This is a supported and registered Azure geographical + * region (for example, West US, East US, or Southeast Asia). The geographical region of a device cannot be changed + * once it is created, but if an identical geographical region is specified on update, the request will succeed. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: The list of tags that describe the device. These tags can be used to view and group this + * device (across resource groups). + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the sku property: The SKU type. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the etag property: The etag for the devices. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the dataBoxEdgeDeviceStatus property: The status of the Data Box Edge/Gateway device. + * + * @return the dataBoxEdgeDeviceStatus value. + */ + DataBoxEdgeDeviceStatus dataBoxEdgeDeviceStatus(); + + /** + * Gets the serialNumber property: The Serial Number of Data Box Edge/Gateway device. + * + * @return the serialNumber value. + */ + String serialNumber(); + + /** + * Gets the description property: The Description of the Data Box Edge/Gateway device. + * + * @return the description value. + */ + String description(); + + /** + * Gets the modelDescription property: The description of the Data Box Edge/Gateway device model. + * + * @return the modelDescription value. + */ + String modelDescription(); + + /** + * Gets the deviceType property: The type of the Data Box Edge/Gateway device. + * + * @return the deviceType value. + */ + DeviceType deviceType(); + + /** + * Gets the friendlyName property: The Data Box Edge/Gateway device name. + * + * @return the friendlyName value. + */ + String friendlyName(); + + /** + * Gets the culture property: The Data Box Edge/Gateway device culture. + * + * @return the culture value. + */ + String culture(); + + /** + * Gets the deviceModel property: The Data Box Edge/Gateway device model. + * + * @return the deviceModel value. + */ + String deviceModel(); + + /** + * Gets the deviceSoftwareVersion property: The Data Box Edge/Gateway device software version. + * + * @return the deviceSoftwareVersion value. + */ + String deviceSoftwareVersion(); + + /** + * Gets the deviceLocalCapacity property: The Data Box Edge/Gateway device local capacity in MB. + * + * @return the deviceLocalCapacity value. + */ + Long deviceLocalCapacity(); + + /** + * Gets the timeZone property: The Data Box Edge/Gateway device timezone. + * + * @return the timeZone value. + */ + String timeZone(); + + /** + * Gets the deviceHcsVersion property: The device software version number of the device (eg: 1.2.18105.6). + * + * @return the deviceHcsVersion value. + */ + String deviceHcsVersion(); + + /** + * Gets the configuredRoleTypes property: Type of compute roles configured. + * + * @return the configuredRoleTypes value. + */ + List configuredRoleTypes(); + + /** + * Gets the nodeCount property: The number of nodes in the cluster. + * + * @return the nodeCount value. + */ + Integer nodeCount(); + + /** + * 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.databoxedge.fluent.models.DataBoxEdgeDeviceInner object. + * + * @return the inner object. + */ + DataBoxEdgeDeviceInner innerModel(); + + /** The entirety of the DataBoxEdgeDevice definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The DataBoxEdgeDevice definition stages. */ + interface DefinitionStages { + /** The first stage of the DataBoxEdgeDevice definition. */ + interface Blank extends WithLocation { + } + /** The stage of the DataBoxEdgeDevice definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The location of the device. This is a supported and registered Azure geographical region + * (for example, West US, East US, or Southeast Asia). The geographical region of a device cannot be + * changed once it is created, but if an identical geographical region is specified on update, the + * request will succeed. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The location of the device. This is a supported and registered Azure geographical region + * (for example, West US, East US, or Southeast Asia). The geographical region of a device cannot be + * changed once it is created, but if an identical geographical region is specified on update, the + * request will succeed. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the DataBoxEdgeDevice definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The resource group name. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the DataBoxEdgeDevice 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.WithSku, + DefinitionStages.WithEtag, + DefinitionStages.WithDataBoxEdgeDeviceStatus, + DefinitionStages.WithDescription, + DefinitionStages.WithModelDescription, + DefinitionStages.WithFriendlyName { + /** + * Executes the create request. + * + * @return the created resource. + */ + DataBoxEdgeDevice create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DataBoxEdgeDevice create(Context context); + } + /** The stage of the DataBoxEdgeDevice definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The list of tags that describe the device. These tags can be used to view + * and group this device (across resource groups).. + * + * @param tags The list of tags that describe the device. These tags can be used to view and group this + * device (across resource groups). + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the DataBoxEdgeDevice definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The SKU type.. + * + * @param sku The SKU type. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** The stage of the DataBoxEdgeDevice definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: The etag for the devices.. + * + * @param etag The etag for the devices. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the DataBoxEdgeDevice definition allowing to specify dataBoxEdgeDeviceStatus. */ + interface WithDataBoxEdgeDeviceStatus { + /** + * Specifies the dataBoxEdgeDeviceStatus property: The status of the Data Box Edge/Gateway device.. + * + * @param dataBoxEdgeDeviceStatus The status of the Data Box Edge/Gateway device. + * @return the next definition stage. + */ + WithCreate withDataBoxEdgeDeviceStatus(DataBoxEdgeDeviceStatus dataBoxEdgeDeviceStatus); + } + /** The stage of the DataBoxEdgeDevice definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The Description of the Data Box Edge/Gateway device.. + * + * @param description The Description of the Data Box Edge/Gateway device. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the DataBoxEdgeDevice definition allowing to specify modelDescription. */ + interface WithModelDescription { + /** + * Specifies the modelDescription property: The description of the Data Box Edge/Gateway device model.. + * + * @param modelDescription The description of the Data Box Edge/Gateway device model. + * @return the next definition stage. + */ + WithCreate withModelDescription(String modelDescription); + } + /** The stage of the DataBoxEdgeDevice definition allowing to specify friendlyName. */ + interface WithFriendlyName { + /** + * Specifies the friendlyName property: The Data Box Edge/Gateway device name.. + * + * @param friendlyName The Data Box Edge/Gateway device name. + * @return the next definition stage. + */ + WithCreate withFriendlyName(String friendlyName); + } + } + /** + * Begins update for the DataBoxEdgeDevice resource. + * + * @return the stage of resource update. + */ + DataBoxEdgeDevice.Update update(); + + /** The template for DataBoxEdgeDevice update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DataBoxEdgeDevice apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DataBoxEdgeDevice apply(Context context); + } + /** The DataBoxEdgeDevice update stages. */ + interface UpdateStages { + /** The stage of the DataBoxEdgeDevice update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The tags attached to the Data Box Edge/Gateway resource.. + * + * @param tags The tags attached to the Data Box Edge/Gateway resource. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DataBoxEdgeDevice refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DataBoxEdgeDevice refresh(Context context); + + /** + * Downloads the updates on a Data Box Edge/Data Box Gateway device. + * + * @throws com.azure.core.management.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 downloadUpdates(); + + /** + * Downloads the updates on a Data Box Edge/Data Box Gateway device. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 downloadUpdates(Context context); + + /** + * Gets additional information for the specified Data Box Edge/Data Box Gateway device. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return additional information for the specified Data Box Edge/Data Box Gateway device. + */ + DataBoxEdgeDeviceExtendedInfo getExtendedInformation(); + + /** + * Gets additional information for the specified Data Box Edge/Data Box Gateway device. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return additional information for the specified Data Box Edge/Data Box Gateway device. + */ + Response getExtendedInformationWithResponse(Context context); + + /** + * Installs the updates on the Data Box Edge/Data Box Gateway device. + * + * @throws com.azure.core.management.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 installUpdates(); + + /** + * Installs the updates on the Data Box Edge/Data Box Gateway device. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 installUpdates(Context context); + + /** + * Scans for updates on a Data Box Edge/Data Box Gateway device. + * + * @throws com.azure.core.management.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 scanForUpdates(); + + /** + * Scans for updates on a Data Box Edge/Data Box Gateway device. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 scanForUpdates(Context context); + + /** + * Uploads registration certificate for the device. + * + * @param parameters The upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload registration certificate response. + */ + UploadCertificateResponse uploadCertificate(UploadCertificateRequest parameters); + + /** + * Uploads registration certificate for the device. + * + * @param parameters The upload certificate request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload registration certificate response. + */ + Response uploadCertificateWithResponse( + UploadCertificateRequest parameters, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceExtendedInfo.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceExtendedInfo.java new file mode 100644 index 0000000000000..3c5993c0bb9dc --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceExtendedInfo.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceExtendedInfoInner; + +/** An immutable client-side representation of DataBoxEdgeDeviceExtendedInfo. */ +public interface DataBoxEdgeDeviceExtendedInfo { + /** + * 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 encryptionKeyThumbprint property: The digital signature of encrypted certificate. + * + * @return the encryptionKeyThumbprint value. + */ + String encryptionKeyThumbprint(); + + /** + * Gets the encryptionKey property: The public part of the encryption certificate. Client uses this to encrypt any + * secret. + * + * @return the encryptionKey value. + */ + String encryptionKey(); + + /** + * Gets the resourceKey property: The Resource ID of the Resource. + * + * @return the resourceKey value. + */ + String resourceKey(); + + /** + * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceExtendedInfoInner object. + * + * @return the inner object. + */ + DataBoxEdgeDeviceExtendedInfoInner innerModel(); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceList.java new file mode 100644 index 0000000000000..cdc2a34287a80 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceList.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.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The collection of Data Box Edge/Gateway devices. */ +@Immutable +public final class DataBoxEdgeDeviceList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataBoxEdgeDeviceList.class); + + /* + * The list of Data Box Edge/Gateway devices. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of Data Box Edge/Gateway devices. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to the next set 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/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDevicePatch.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDevicePatch.java new file mode 100644 index 0000000000000..ab437d4707f9d --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDevicePatch.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The Data Box Edge/Gateway device patch. */ +@Fluent +public final class DataBoxEdgeDevicePatch { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataBoxEdgeDevicePatch.class); + + /* + * The tags attached to the Data Box Edge/Gateway resource. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the tags property: The tags attached to the Data Box Edge/Gateway resource. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The tags attached to the Data Box Edge/Gateway resource. + * + * @param tags the tags value to set. + * @return the DataBoxEdgeDevicePatch object itself. + */ + public DataBoxEdgeDevicePatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceStatus.java new file mode 100644 index 0000000000000..4691260820b1e --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataBoxEdgeDeviceStatus.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DataBoxEdgeDeviceStatus. */ +public final class DataBoxEdgeDeviceStatus extends ExpandableStringEnum { + /** Static value ReadyToSetup for DataBoxEdgeDeviceStatus. */ + public static final DataBoxEdgeDeviceStatus READY_TO_SETUP = fromString("ReadyToSetup"); + + /** Static value Online for DataBoxEdgeDeviceStatus. */ + public static final DataBoxEdgeDeviceStatus ONLINE = fromString("Online"); + + /** Static value Offline for DataBoxEdgeDeviceStatus. */ + public static final DataBoxEdgeDeviceStatus OFFLINE = fromString("Offline"); + + /** Static value NeedsAttention for DataBoxEdgeDeviceStatus. */ + public static final DataBoxEdgeDeviceStatus NEEDS_ATTENTION = fromString("NeedsAttention"); + + /** Static value Disconnected for DataBoxEdgeDeviceStatus. */ + public static final DataBoxEdgeDeviceStatus DISCONNECTED = fromString("Disconnected"); + + /** Static value PartiallyDisconnected for DataBoxEdgeDeviceStatus. */ + public static final DataBoxEdgeDeviceStatus PARTIALLY_DISCONNECTED = fromString("PartiallyDisconnected"); + + /** Static value Maintenance for DataBoxEdgeDeviceStatus. */ + public static final DataBoxEdgeDeviceStatus MAINTENANCE = fromString("Maintenance"); + + /** + * Creates or finds a DataBoxEdgeDeviceStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataBoxEdgeDeviceStatus. + */ + @JsonCreator + public static DataBoxEdgeDeviceStatus fromString(String name) { + return fromString(name, DataBoxEdgeDeviceStatus.class); + } + + /** @return known DataBoxEdgeDeviceStatus values. */ + public static Collection values() { + return values(DataBoxEdgeDeviceStatus.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataPolicy.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataPolicy.java new file mode 100644 index 0000000000000..d524bbb7e6735 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DataPolicy.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DataPolicy. */ +public final class DataPolicy extends ExpandableStringEnum { + /** Static value Cloud for DataPolicy. */ + public static final DataPolicy CLOUD = fromString("Cloud"); + + /** Static value Local for DataPolicy. */ + public static final DataPolicy LOCAL = fromString("Local"); + + /** + * Creates or finds a DataPolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataPolicy. + */ + @JsonCreator + public static DataPolicy fromString(String name) { + return fromString(name, DataPolicy.class); + } + + /** @return known DataPolicy values. */ + public static Collection values() { + return values(DataPolicy.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DayOfWeek.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DayOfWeek.java new file mode 100644 index 0000000000000..b5738bb2abf66 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DayOfWeek.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DayOfWeek. */ +public final class DayOfWeek extends ExpandableStringEnum { + /** Static value Sunday for DayOfWeek. */ + public static final DayOfWeek SUNDAY = fromString("Sunday"); + + /** Static value Monday for DayOfWeek. */ + public static final DayOfWeek MONDAY = fromString("Monday"); + + /** Static value Tuesday for DayOfWeek. */ + public static final DayOfWeek TUESDAY = fromString("Tuesday"); + + /** Static value Wednesday for DayOfWeek. */ + public static final DayOfWeek WEDNESDAY = fromString("Wednesday"); + + /** Static value Thursday for DayOfWeek. */ + public static final DayOfWeek THURSDAY = fromString("Thursday"); + + /** Static value Friday for DayOfWeek. */ + public static final DayOfWeek FRIDAY = fromString("Friday"); + + /** Static value Saturday for DayOfWeek. */ + public static final DayOfWeek SATURDAY = fromString("Saturday"); + + /** + * Creates or finds a DayOfWeek from its string representation. + * + * @param name a name to look for. + * @return the corresponding DayOfWeek. + */ + @JsonCreator + public static DayOfWeek fromString(String name) { + return fromString(name, DayOfWeek.class); + } + + /** @return known DayOfWeek values. */ + public static Collection values() { + return values(DayOfWeek.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DeviceType.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DeviceType.java new file mode 100644 index 0000000000000..e733807546537 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DeviceType.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DeviceType. */ +public final class DeviceType extends ExpandableStringEnum { + /** Static value DataBoxEdgeDevice for DeviceType. */ + public static final DeviceType DATA_BOX_EDGE_DEVICE = fromString("DataBoxEdgeDevice"); + + /** + * Creates or finds a DeviceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeviceType. + */ + @JsonCreator + public static DeviceType fromString(String name) { + return fromString(name, DeviceType.class); + } + + /** @return known DeviceType values. */ + public static Collection values() { + return values(DeviceType.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Devices.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Devices.java new file mode 100644 index 0000000000000..a5cd9893b45e3 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Devices.java @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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 Devices. */ +public interface Devices { + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Data Box Edge/Data Box Gateway devices in a subscription. + */ + PagedIterable list(); + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + * + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the list. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Data Box Edge/Data Box Gateway devices in a subscription. + */ + PagedIterable list(String expand, Context context); + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + * + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Data Box Edge/Data Box Gateway devices in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + * + * @param resourceGroupName The resource group name. + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify + * $skipToken=<token> to populate the next page in the list. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the Data Box Edge/Data Box Gateway devices in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, String expand, Context context); + + /** + * Gets the properties of the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The resource group name. + * @param deviceName The device name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the Data Box Edge/Data Box Gateway device. + */ + DataBoxEdgeDevice getByResourceGroup(String resourceGroupName, String deviceName); + + /** + * Gets the properties of the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The resource group name. + * @param deviceName The device name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the Data Box Edge/Data Box Gateway device. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String deviceName, Context context); + + /** + * Deletes the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The resource group name. + * @param deviceName The device name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName); + + /** + * Deletes the Data Box Edge/Data Box Gateway device. + * + * @param resourceGroupName The resource group name. + * @param deviceName The device name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, Context context); + + /** + * Downloads the updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 downloadUpdates(String deviceName, String resourceGroupName); + + /** + * Downloads the updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 downloadUpdates(String deviceName, String resourceGroupName, Context context); + + /** + * Gets additional information for the specified Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return additional information for the specified Data Box Edge/Data Box Gateway device. + */ + DataBoxEdgeDeviceExtendedInfo getExtendedInformation(String deviceName, String resourceGroupName); + + /** + * Gets additional information for the specified Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return additional information for the specified Data Box Edge/Data Box Gateway device. + */ + Response getExtendedInformationWithResponse( + String deviceName, String resourceGroupName, Context context); + + /** + * Installs the updates on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 installUpdates(String deviceName, String resourceGroupName); + + /** + * Installs the updates on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 installUpdates(String deviceName, String resourceGroupName, Context context); + + /** + * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network settings of the specified Data Box Edge/Data Box Gateway device. + */ + NetworkSettings getNetworkSettings(String deviceName, String resourceGroupName); + + /** + * Gets the network settings of the specified Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network settings of the specified Data Box Edge/Data Box Gateway device. + */ + Response getNetworkSettingsWithResponse( + String deviceName, String resourceGroupName, Context context); + + /** + * Scans for updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 scanForUpdates(String deviceName, String resourceGroupName); + + /** + * Scans for updates on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 scanForUpdates(String deviceName, String resourceGroupName, Context context); + + /** + * Updates the security settings on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 createOrUpdateSecuritySettings(String deviceName, String resourceGroupName, SecuritySettings securitySettings); + + /** + * Updates the security settings on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 createOrUpdateSecuritySettings( + String deviceName, String resourceGroupName, SecuritySettings securitySettings, Context context); + + /** + * Gets information about the availability of updates based on the last scan of the device. It also gets information + * about any ongoing download or install jobs on the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the availability of updates based on the last scan of the device. + */ + UpdateSummary getUpdateSummary(String deviceName, String resourceGroupName); + + /** + * Gets information about the availability of updates based on the last scan of the device. It also gets information + * about any ongoing download or install jobs on the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the availability of updates based on the last scan of the device. + */ + Response getUpdateSummaryWithResponse(String deviceName, String resourceGroupName, Context context); + + /** + * Uploads registration certificate for the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload registration certificate response. + */ + UploadCertificateResponse uploadCertificate( + String deviceName, String resourceGroupName, UploadCertificateRequest parameters); + + /** + * Uploads registration certificate for the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The upload certificate request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload registration certificate response. + */ + Response uploadCertificateWithResponse( + String deviceName, String resourceGroupName, UploadCertificateRequest parameters, Context context); + + /** + * Gets the properties of the Data Box Edge/Data Box Gateway device. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the Data Box Edge/Data Box Gateway device. + */ + DataBoxEdgeDevice getById(String id); + + /** + * Gets the properties of the Data Box Edge/Data Box Gateway device. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the Data Box Edge/Data Box Gateway device. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the Data Box Edge/Data Box Gateway device. + * + * @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 Data Box Edge/Data Box Gateway device. + * + * @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 DataBoxEdgeDevice resource. + * + * @param name resource name. + * @return the first stage of the new DataBoxEdgeDevice definition. + */ + DataBoxEdgeDevice.DefinitionStages.Blank define(String name); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DownloadPhase.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DownloadPhase.java new file mode 100644 index 0000000000000..6857cd252d7d4 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/DownloadPhase.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DownloadPhase. */ +public final class DownloadPhase extends ExpandableStringEnum { + /** Static value Unknown for DownloadPhase. */ + public static final DownloadPhase UNKNOWN = fromString("Unknown"); + + /** Static value Initializing for DownloadPhase. */ + public static final DownloadPhase INITIALIZING = fromString("Initializing"); + + /** Static value Downloading for DownloadPhase. */ + public static final DownloadPhase DOWNLOADING = fromString("Downloading"); + + /** Static value Verifying for DownloadPhase. */ + public static final DownloadPhase VERIFYING = fromString("Verifying"); + + /** + * Creates or finds a DownloadPhase from its string representation. + * + * @param name a name to look for. + * @return the corresponding DownloadPhase. + */ + @JsonCreator + public static DownloadPhase fromString(String name) { + return fromString(name, DownloadPhase.class); + } + + /** @return known DownloadPhase values. */ + public static Collection values() { + return values(DownloadPhase.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/EncryptionAlgorithm.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/EncryptionAlgorithm.java new file mode 100644 index 0000000000000..2ad36344cdc81 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/EncryptionAlgorithm.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EncryptionAlgorithm. */ +public final class EncryptionAlgorithm extends ExpandableStringEnum { + /** Static value None for EncryptionAlgorithm. */ + public static final EncryptionAlgorithm NONE = fromString("None"); + + /** Static value AES256 for EncryptionAlgorithm. */ + public static final EncryptionAlgorithm AES256 = fromString("AES256"); + + /** Static value RSAES_PKCS1_v_1_5 for EncryptionAlgorithm. */ + public static final EncryptionAlgorithm RSAES_PKCS1_V_1_5 = fromString("RSAES_PKCS1_v_1_5"); + + /** + * Creates or finds a EncryptionAlgorithm from its string representation. + * + * @param name a name to look for. + * @return the corresponding EncryptionAlgorithm. + */ + @JsonCreator + public static EncryptionAlgorithm fromString(String name) { + return fromString(name, EncryptionAlgorithm.class); + } + + /** @return known EncryptionAlgorithm values. */ + public static Collection values() { + return values(EncryptionAlgorithm.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/FileEventTrigger.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/FileEventTrigger.java new file mode 100644 index 0000000000000..430a2e8475e36 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/FileEventTrigger.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.models.TriggerInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Trigger details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("FileEvent") +@JsonFlatten +@Fluent +public class FileEventTrigger extends TriggerInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FileEventTrigger.class); + + /* + * File event source details. + */ + @JsonProperty(value = "properties.sourceInfo", required = true) + private FileSourceInfo sourceInfo; + + /* + * Role sink info. + */ + @JsonProperty(value = "properties.sinkInfo", required = true) + private RoleSinkInfo sinkInfo; + + /* + * A custom context tag typically used to correlate the trigger against its + * usage. For example, if a periodic timer trigger is intended for certain + * specific IoT modules in the device, the tag can be the name or the image + * URL of the module. + */ + @JsonProperty(value = "properties.customContextTag") + private String customContextTag; + + /** + * Get the sourceInfo property: File event source details. + * + * @return the sourceInfo value. + */ + public FileSourceInfo sourceInfo() { + return this.sourceInfo; + } + + /** + * Set the sourceInfo property: File event source details. + * + * @param sourceInfo the sourceInfo value to set. + * @return the FileEventTrigger object itself. + */ + public FileEventTrigger withSourceInfo(FileSourceInfo sourceInfo) { + this.sourceInfo = sourceInfo; + return this; + } + + /** + * Get the sinkInfo property: Role sink info. + * + * @return the sinkInfo value. + */ + public RoleSinkInfo sinkInfo() { + return this.sinkInfo; + } + + /** + * Set the sinkInfo property: Role sink info. + * + * @param sinkInfo the sinkInfo value to set. + * @return the FileEventTrigger object itself. + */ + public FileEventTrigger withSinkInfo(RoleSinkInfo sinkInfo) { + this.sinkInfo = sinkInfo; + return this; + } + + /** + * Get the customContextTag property: A custom context tag typically used to correlate the trigger against its + * usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the + * tag can be the name or the image URL of the module. + * + * @return the customContextTag value. + */ + public String customContextTag() { + return this.customContextTag; + } + + /** + * Set the customContextTag property: A custom context tag typically used to correlate the trigger against its + * usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the + * tag can be the name or the image URL of the module. + * + * @param customContextTag the customContextTag value to set. + * @return the FileEventTrigger object itself. + */ + public FileEventTrigger withCustomContextTag(String customContextTag) { + this.customContextTag = customContextTag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (sourceInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property sourceInfo in model FileEventTrigger")); + } else { + sourceInfo().validate(); + } + if (sinkInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property sinkInfo in model FileEventTrigger")); + } else { + sinkInfo().validate(); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/FileSourceInfo.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/FileSourceInfo.java new file mode 100644 index 0000000000000..46b987de3f9aa --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/FileSourceInfo.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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; + +/** File source details. */ +@Fluent +public final class FileSourceInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FileSourceInfo.class); + + /* + * File share ID. + */ + @JsonProperty(value = "shareId", required = true) + private String shareId; + + /** + * Get the shareId property: File share ID. + * + * @return the shareId value. + */ + public String shareId() { + return this.shareId; + } + + /** + * Set the shareId property: File share ID. + * + * @param shareId the shareId value to set. + * @return the FileSourceInfo object itself. + */ + public FileSourceInfo withShareId(String shareId) { + this.shareId = shareId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (shareId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property shareId in model FileSourceInfo")); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/InstallRebootBehavior.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/InstallRebootBehavior.java new file mode 100644 index 0000000000000..f79383e5d2163 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/InstallRebootBehavior.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for InstallRebootBehavior. */ +public final class InstallRebootBehavior extends ExpandableStringEnum { + /** Static value NeverReboots for InstallRebootBehavior. */ + public static final InstallRebootBehavior NEVER_REBOOTS = fromString("NeverReboots"); + + /** Static value RequiresReboot for InstallRebootBehavior. */ + public static final InstallRebootBehavior REQUIRES_REBOOT = fromString("RequiresReboot"); + + /** Static value RequestReboot for InstallRebootBehavior. */ + public static final InstallRebootBehavior REQUEST_REBOOT = fromString("RequestReboot"); + + /** + * Creates or finds a InstallRebootBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding InstallRebootBehavior. + */ + @JsonCreator + public static InstallRebootBehavior fromString(String name) { + return fromString(name, InstallRebootBehavior.class); + } + + /** @return known InstallRebootBehavior values. */ + public static Collection values() { + return values(InstallRebootBehavior.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/IoTDeviceInfo.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/IoTDeviceInfo.java new file mode 100644 index 0000000000000..74f9a70b23935 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/IoTDeviceInfo.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Metadata of IoT device/IoT Edge device to be configured. */ +@Fluent +public final class IoTDeviceInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IoTDeviceInfo.class); + + /* + * ID of the IoT device/edge device. + */ + @JsonProperty(value = "deviceId", required = true) + private String deviceId; + + /* + * Host name for the IoT hub associated to the device. + */ + @JsonProperty(value = "ioTHostHub", required = true) + private String ioTHostHub; + + /* + * Id for the IoT hub associated to the device. + */ + @JsonProperty(value = "ioTHostHubId") + private String ioTHostHubId; + + /* + * IoT device authentication info. + */ + @JsonProperty(value = "authentication") + private Authentication authentication; + + /** + * Get the deviceId property: ID of the IoT device/edge device. + * + * @return the deviceId value. + */ + public String deviceId() { + return this.deviceId; + } + + /** + * Set the deviceId property: ID of the IoT device/edge device. + * + * @param deviceId the deviceId value to set. + * @return the IoTDeviceInfo object itself. + */ + public IoTDeviceInfo withDeviceId(String deviceId) { + this.deviceId = deviceId; + return this; + } + + /** + * Get the ioTHostHub property: Host name for the IoT hub associated to the device. + * + * @return the ioTHostHub value. + */ + public String ioTHostHub() { + return this.ioTHostHub; + } + + /** + * Set the ioTHostHub property: Host name for the IoT hub associated to the device. + * + * @param ioTHostHub the ioTHostHub value to set. + * @return the IoTDeviceInfo object itself. + */ + public IoTDeviceInfo withIoTHostHub(String ioTHostHub) { + this.ioTHostHub = ioTHostHub; + return this; + } + + /** + * Get the ioTHostHubId property: Id for the IoT hub associated to the device. + * + * @return the ioTHostHubId value. + */ + public String ioTHostHubId() { + return this.ioTHostHubId; + } + + /** + * Set the ioTHostHubId property: Id for the IoT hub associated to the device. + * + * @param ioTHostHubId the ioTHostHubId value to set. + * @return the IoTDeviceInfo object itself. + */ + public IoTDeviceInfo withIoTHostHubId(String ioTHostHubId) { + this.ioTHostHubId = ioTHostHubId; + return this; + } + + /** + * Get the authentication property: IoT device authentication info. + * + * @return the authentication value. + */ + public Authentication authentication() { + return this.authentication; + } + + /** + * Set the authentication property: IoT device authentication info. + * + * @param authentication the authentication value to set. + * @return the IoTDeviceInfo object itself. + */ + public IoTDeviceInfo withAuthentication(Authentication authentication) { + this.authentication = authentication; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (deviceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property deviceId in model IoTDeviceInfo")); + } + if (ioTHostHub() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property ioTHostHub in model IoTDeviceInfo")); + } + if (authentication() != null) { + authentication().validate(); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/IoTRole.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/IoTRole.java new file mode 100644 index 0000000000000..1075a2480e11b --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/IoTRole.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.models.RoleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Compute role. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("IOT") +@JsonFlatten +@Fluent +public class IoTRole extends RoleInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IoTRole.class); + + /* + * Host OS supported by the IoT role. + */ + @JsonProperty(value = "properties.hostPlatform") + private PlatformType hostPlatform; + + /* + * IoT device metadata to which data box edge device needs to be connected. + */ + @JsonProperty(value = "properties.ioTDeviceDetails") + private IoTDeviceInfo ioTDeviceDetails; + + /* + * IoT edge device to which the IoT role needs to be configured. + */ + @JsonProperty(value = "properties.ioTEdgeDeviceDetails") + private IoTDeviceInfo ioTEdgeDeviceDetails; + + /* + * Mount points of shares in role(s). + */ + @JsonProperty(value = "properties.shareMappings") + private List shareMappings; + + /* + * Role status. + */ + @JsonProperty(value = "properties.roleStatus") + private RoleStatus roleStatus; + + /** + * Get the hostPlatform property: Host OS supported by the IoT role. + * + * @return the hostPlatform value. + */ + public PlatformType hostPlatform() { + return this.hostPlatform; + } + + /** + * Set the hostPlatform property: Host OS supported by the IoT role. + * + * @param hostPlatform the hostPlatform value to set. + * @return the IoTRole object itself. + */ + public IoTRole withHostPlatform(PlatformType hostPlatform) { + this.hostPlatform = hostPlatform; + return this; + } + + /** + * Get the ioTDeviceDetails property: IoT device metadata to which data box edge device needs to be connected. + * + * @return the ioTDeviceDetails value. + */ + public IoTDeviceInfo ioTDeviceDetails() { + return this.ioTDeviceDetails; + } + + /** + * Set the ioTDeviceDetails property: IoT device metadata to which data box edge device needs to be connected. + * + * @param ioTDeviceDetails the ioTDeviceDetails value to set. + * @return the IoTRole object itself. + */ + public IoTRole withIoTDeviceDetails(IoTDeviceInfo ioTDeviceDetails) { + this.ioTDeviceDetails = ioTDeviceDetails; + return this; + } + + /** + * Get the ioTEdgeDeviceDetails property: IoT edge device to which the IoT role needs to be configured. + * + * @return the ioTEdgeDeviceDetails value. + */ + public IoTDeviceInfo ioTEdgeDeviceDetails() { + return this.ioTEdgeDeviceDetails; + } + + /** + * Set the ioTEdgeDeviceDetails property: IoT edge device to which the IoT role needs to be configured. + * + * @param ioTEdgeDeviceDetails the ioTEdgeDeviceDetails value to set. + * @return the IoTRole object itself. + */ + public IoTRole withIoTEdgeDeviceDetails(IoTDeviceInfo ioTEdgeDeviceDetails) { + this.ioTEdgeDeviceDetails = ioTEdgeDeviceDetails; + return this; + } + + /** + * Get the shareMappings property: Mount points of shares in role(s). + * + * @return the shareMappings value. + */ + public List shareMappings() { + return this.shareMappings; + } + + /** + * Set the shareMappings property: Mount points of shares in role(s). + * + * @param shareMappings the shareMappings value to set. + * @return the IoTRole object itself. + */ + public IoTRole withShareMappings(List shareMappings) { + this.shareMappings = shareMappings; + return this; + } + + /** + * Get the roleStatus property: Role status. + * + * @return the roleStatus value. + */ + public RoleStatus roleStatus() { + return this.roleStatus; + } + + /** + * Set the roleStatus property: Role status. + * + * @param roleStatus the roleStatus value to set. + * @return the IoTRole object itself. + */ + public IoTRole withRoleStatus(RoleStatus roleStatus) { + this.roleStatus = roleStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (ioTDeviceDetails() != null) { + ioTDeviceDetails().validate(); + } + if (ioTEdgeDeviceDetails() != null) { + ioTEdgeDeviceDetails().validate(); + } + if (shareMappings() != null) { + shareMappings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Ipv4Config.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Ipv4Config.java new file mode 100644 index 0000000000000..d539783041614 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Ipv4Config.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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; + +/** Details related to the IPv4 address configuration. */ +@Immutable +public final class Ipv4Config { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Ipv4Config.class); + + /* + * The IPv4 address of the network adapter. + */ + @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /* + * The IPv4 subnet of the network adapter. + */ + @JsonProperty(value = "subnet", access = JsonProperty.Access.WRITE_ONLY) + private String subnet; + + /* + * The IPv4 gateway of the network adapter. + */ + @JsonProperty(value = "gateway", access = JsonProperty.Access.WRITE_ONLY) + private String gateway; + + /** + * Get the ipAddress property: The IPv4 address of the network adapter. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Get the subnet property: The IPv4 subnet of the network adapter. + * + * @return the subnet value. + */ + public String subnet() { + return this.subnet; + } + + /** + * Get the gateway property: The IPv4 gateway of the network adapter. + * + * @return the gateway value. + */ + public String gateway() { + return this.gateway; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Ipv6Config.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Ipv6Config.java new file mode 100644 index 0000000000000..98cd90d65a6ca --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Ipv6Config.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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; + +/** Details related to the IPv6 address configuration. */ +@Immutable +public final class Ipv6Config { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Ipv6Config.class); + + /* + * The IPv6 address of the network adapter. + */ + @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /* + * The IPv6 prefix of the network adapter. + */ + @JsonProperty(value = "prefixLength", access = JsonProperty.Access.WRITE_ONLY) + private Integer prefixLength; + + /* + * The IPv6 gateway of the network adapter. + */ + @JsonProperty(value = "gateway", access = JsonProperty.Access.WRITE_ONLY) + private String gateway; + + /** + * Get the ipAddress property: The IPv6 address of the network adapter. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Get the prefixLength property: The IPv6 prefix of the network adapter. + * + * @return the prefixLength value. + */ + public Integer prefixLength() { + return this.prefixLength; + } + + /** + * Get the gateway property: The IPv6 gateway of the network adapter. + * + * @return the gateway value. + */ + public String gateway() { + return this.gateway; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Job.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Job.java new file mode 100644 index 0000000000000..c0770057cd764 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Job.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.resourcemanager.databoxedge.fluent.models.JobInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of Job. */ +public interface Job { + /** + * Gets the id property: The path ID that uniquely identifies the object. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the object. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The hierarchical type of the object. + * + * @return the type value. + */ + String type(); + + /** + * Gets the status property: The current status of the job. + * + * @return the status value. + */ + JobStatus status(); + + /** + * Gets the startTime property: The UTC date and time at which the job started. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: The UTC date and time at which the job completed. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the percentComplete property: The percentage of the job that is complete. + * + * @return the percentComplete value. + */ + Integer percentComplete(); + + /** + * Gets the error property: The error details. + * + * @return the error value. + */ + JobErrorDetails error(); + + /** + * Gets the jobType property: The type of the job. + * + * @return the jobType value. + */ + JobType jobType(); + + /** + * Gets the currentStage property: Current stage of the update operation. + * + * @return the currentStage value. + */ + UpdateOperationStage currentStage(); + + /** + * Gets the downloadProgress property: The download progress. + * + * @return the downloadProgress value. + */ + UpdateDownloadProgress downloadProgress(); + + /** + * Gets the installProgress property: The install progress. + * + * @return the installProgress value. + */ + UpdateInstallProgress installProgress(); + + /** + * Gets the totalRefreshErrors property: Total number of errors encountered during the refresh process. + * + * @return the totalRefreshErrors value. + */ + Integer totalRefreshErrors(); + + /** + * Gets the errorManifestFile property: Local share/remote container relative path to the error manifest file of the + * refresh. + * + * @return the errorManifestFile value. + */ + String errorManifestFile(); + + /** + * Gets the refreshedEntityId property: ARM ID of the entity that was refreshed. + * + * @return the refreshedEntityId value. + */ + String refreshedEntityId(); + + /** + * Gets the folder property: If only subfolders need to be refreshed, then the subfolder path inside the share or + * container. (The path is empty if there are no subfolders.). + * + * @return the folder value. + */ + String folder(); + + /** + * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.JobInner object. + * + * @return the inner object. + */ + JobInner innerModel(); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobErrorDetails.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobErrorDetails.java new file mode 100644 index 0000000000000..4de80561e7c20 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobErrorDetails.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The job error information containing the list of job errors. */ +@Immutable +public final class JobErrorDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobErrorDetails.class); + + /* + * The error details. + */ + @JsonProperty(value = "errorDetails", access = JsonProperty.Access.WRITE_ONLY) + private List errorDetails; + + /* + * The code intended for programmatic access. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * The message that describes the error in detail. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get the errorDetails property: The error details. + * + * @return the errorDetails value. + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Get the code property: The code intended for programmatic access. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the message property: The message that describes the error in detail. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (errorDetails() != null) { + errorDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobErrorItem.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobErrorItem.java new file mode 100644 index 0000000000000..208e33cea1d1e --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobErrorItem.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The job error items. */ +@Immutable +public final class JobErrorItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JobErrorItem.class); + + /* + * The recommended actions. + */ + @JsonProperty(value = "recommendations", access = JsonProperty.Access.WRITE_ONLY) + private List recommendations; + + /* + * The code intended for programmatic access. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * The message that describes the error in detail. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get the recommendations property: The recommended actions. + * + * @return the recommendations value. + */ + public List recommendations() { + return this.recommendations; + } + + /** + * Get the code property: The code intended for programmatic access. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the message property: The message that describes the error in detail. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobStatus.java new file mode 100644 index 0000000000000..f42b37bcbc3d2 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobStatus.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for JobStatus. */ +public final class JobStatus extends ExpandableStringEnum { + /** Static value Invalid for JobStatus. */ + public static final JobStatus INVALID = fromString("Invalid"); + + /** Static value Running for JobStatus. */ + public static final JobStatus RUNNING = fromString("Running"); + + /** Static value Succeeded for JobStatus. */ + public static final JobStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for JobStatus. */ + public static final JobStatus FAILED = fromString("Failed"); + + /** Static value Canceled for JobStatus. */ + public static final JobStatus CANCELED = fromString("Canceled"); + + /** Static value Paused for JobStatus. */ + public static final JobStatus PAUSED = fromString("Paused"); + + /** Static value Scheduled for JobStatus. */ + public static final JobStatus SCHEDULED = fromString("Scheduled"); + + /** + * Creates or finds a JobStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobStatus. + */ + @JsonCreator + public static JobStatus fromString(String name) { + return fromString(name, JobStatus.class); + } + + /** @return known JobStatus values. */ + public static Collection values() { + return values(JobStatus.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobType.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobType.java new file mode 100644 index 0000000000000..06a1b3820e580 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/JobType.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for JobType. */ +public final class JobType extends ExpandableStringEnum { + /** Static value Invalid for JobType. */ + public static final JobType INVALID = fromString("Invalid"); + + /** Static value ScanForUpdates for JobType. */ + public static final JobType SCAN_FOR_UPDATES = fromString("ScanForUpdates"); + + /** Static value DownloadUpdates for JobType. */ + public static final JobType DOWNLOAD_UPDATES = fromString("DownloadUpdates"); + + /** Static value InstallUpdates for JobType. */ + public static final JobType INSTALL_UPDATES = fromString("InstallUpdates"); + + /** Static value RefreshShare for JobType. */ + public static final JobType REFRESH_SHARE = fromString("RefreshShare"); + + /** Static value RefreshContainer for JobType. */ + public static final JobType REFRESH_CONTAINER = fromString("RefreshContainer"); + + /** + * Creates or finds a JobType from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobType. + */ + @JsonCreator + public static JobType fromString(String name) { + return fromString(name, JobType.class); + } + + /** @return known JobType values. */ + public static Collection values() { + return values(JobType.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Jobs.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Jobs.java new file mode 100644 index 0000000000000..7c6e8fe2ed92c --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Jobs.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Jobs. */ +public interface Jobs { + /** + * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a specified job on a Data Box Edge/Data Box Gateway device. + */ + Job get(String deviceName, String name, String resourceGroupName); + + /** + * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a specified job on a Data Box Edge/Data Box Gateway device. + */ + Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricAggregationType.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricAggregationType.java new file mode 100644 index 0000000000000..c59e711a8a720 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricAggregationType.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MetricAggregationType. */ +public final class MetricAggregationType extends ExpandableStringEnum { + /** Static value NotSpecified for MetricAggregationType. */ + public static final MetricAggregationType NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value None for MetricAggregationType. */ + public static final MetricAggregationType NONE = fromString("None"); + + /** Static value Average for MetricAggregationType. */ + public static final MetricAggregationType AVERAGE = fromString("Average"); + + /** Static value Minimum for MetricAggregationType. */ + public static final MetricAggregationType MINIMUM = fromString("Minimum"); + + /** Static value Maximum for MetricAggregationType. */ + public static final MetricAggregationType MAXIMUM = fromString("Maximum"); + + /** Static value Total for MetricAggregationType. */ + public static final MetricAggregationType TOTAL = fromString("Total"); + + /** Static value Count for MetricAggregationType. */ + public static final MetricAggregationType COUNT = fromString("Count"); + + /** + * Creates or finds a MetricAggregationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MetricAggregationType. + */ + @JsonCreator + public static MetricAggregationType fromString(String name) { + return fromString(name, MetricAggregationType.class); + } + + /** @return known MetricAggregationType values. */ + public static Collection values() { + return values(MetricAggregationType.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricCategory.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricCategory.java new file mode 100644 index 0000000000000..284b56037e6fb --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricCategory.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MetricCategory. */ +public final class MetricCategory extends ExpandableStringEnum { + /** Static value Capacity for MetricCategory. */ + public static final MetricCategory CAPACITY = fromString("Capacity"); + + /** Static value Transaction for MetricCategory. */ + public static final MetricCategory TRANSACTION = fromString("Transaction"); + + /** + * Creates or finds a MetricCategory from its string representation. + * + * @param name a name to look for. + * @return the corresponding MetricCategory. + */ + @JsonCreator + public static MetricCategory fromString(String name) { + return fromString(name, MetricCategory.class); + } + + /** @return known MetricCategory values. */ + public static Collection values() { + return values(MetricCategory.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricDimensionV1.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricDimensionV1.java new file mode 100644 index 0000000000000..de135540394f3 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricDimensionV1.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.databoxedge.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; + +/** Metric Dimension v1. */ +@Fluent +public final class MetricDimensionV1 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricDimensionV1.class); + + /* + * Name of the metrics dimension. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Display name of the metrics dimension. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * To be exported to shoe box. + */ + @JsonProperty(value = "toBeExportedForShoebox") + private Boolean toBeExportedForShoebox; + + /** + * Get the name property: Name of the metrics dimension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the metrics dimension. + * + * @param name the name value to set. + * @return the MetricDimensionV1 object itself. + */ + public MetricDimensionV1 withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Display name of the metrics dimension. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the metrics dimension. + * + * @param displayName the displayName value to set. + * @return the MetricDimensionV1 object itself. + */ + public MetricDimensionV1 withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the toBeExportedForShoebox property: To be exported to shoe box. + * + * @return the toBeExportedForShoebox value. + */ + public Boolean toBeExportedForShoebox() { + return this.toBeExportedForShoebox; + } + + /** + * Set the toBeExportedForShoebox property: To be exported to shoe box. + * + * @param toBeExportedForShoebox the toBeExportedForShoebox value to set. + * @return the MetricDimensionV1 object itself. + */ + public MetricDimensionV1 withToBeExportedForShoebox(Boolean toBeExportedForShoebox) { + this.toBeExportedForShoebox = toBeExportedForShoebox; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricSpecificationV1.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricSpecificationV1.java new file mode 100644 index 0000000000000..4f9dcc6bc5c20 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricSpecificationV1.java @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Metric specification version 1. */ +@Fluent +public final class MetricSpecificationV1 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricSpecificationV1.class); + + /* + * Name of the metric. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Display name of the metric. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Description of the metric to be displayed. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /* + * Metric units. + */ + @JsonProperty(value = "unit") + private MetricUnit unit; + + /* + * Metric aggregation type. + */ + @JsonProperty(value = "aggregationType") + private MetricAggregationType aggregationType; + + /* + * Metric dimensions, other than default dimension which is resource. + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /* + * Set true to fill the gaps with zero. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /* + * Metric category. + */ + @JsonProperty(value = "category") + private MetricCategory category; + + /* + * Resource name override. + */ + @JsonProperty(value = "resourceIdDimensionNameOverride") + private String resourceIdDimensionNameOverride; + + /* + * Support granularity of metrics. + */ + @JsonProperty(value = "supportedTimeGrainTypes") + private List supportedTimeGrainTypes; + + /* + * Support metric aggregation type. + */ + @JsonProperty(value = "supportedAggregationTypes") + private List supportedAggregationTypes; + + /** + * Get the name property: Name of the metric. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the metric. + * + * @param name the name value to set. + * @return the MetricSpecificationV1 object itself. + */ + public MetricSpecificationV1 withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Display name of the metric. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the metric. + * + * @param displayName the displayName value to set. + * @return the MetricSpecificationV1 object itself. + */ + public MetricSpecificationV1 withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the displayDescription property: Description of the metric to be displayed. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: Description of the metric to be displayed. + * + * @param displayDescription the displayDescription value to set. + * @return the MetricSpecificationV1 object itself. + */ + public MetricSpecificationV1 withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get the unit property: Metric units. + * + * @return the unit value. + */ + public MetricUnit unit() { + return this.unit; + } + + /** + * Set the unit property: Metric units. + * + * @param unit the unit value to set. + * @return the MetricSpecificationV1 object itself. + */ + public MetricSpecificationV1 withUnit(MetricUnit unit) { + this.unit = unit; + return this; + } + + /** + * Get the aggregationType property: Metric aggregation type. + * + * @return the aggregationType value. + */ + public MetricAggregationType aggregationType() { + return this.aggregationType; + } + + /** + * Set the aggregationType property: Metric aggregation type. + * + * @param aggregationType the aggregationType value to set. + * @return the MetricSpecificationV1 object itself. + */ + public MetricSpecificationV1 withAggregationType(MetricAggregationType aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get the dimensions property: Metric dimensions, other than default dimension which is resource. + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: Metric dimensions, other than default dimension which is resource. + * + * @param dimensions the dimensions value to set. + * @return the MetricSpecificationV1 object itself. + */ + public MetricSpecificationV1 withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get the fillGapWithZero property: Set true to fill the gaps with zero. + * + * @return the fillGapWithZero value. + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set the fillGapWithZero property: Set true to fill the gaps with zero. + * + * @param fillGapWithZero the fillGapWithZero value to set. + * @return the MetricSpecificationV1 object itself. + */ + public MetricSpecificationV1 withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get the category property: Metric category. + * + * @return the category value. + */ + public MetricCategory category() { + return this.category; + } + + /** + * Set the category property: Metric category. + * + * @param category the category value to set. + * @return the MetricSpecificationV1 object itself. + */ + public MetricSpecificationV1 withCategory(MetricCategory category) { + this.category = category; + return this; + } + + /** + * Get the resourceIdDimensionNameOverride property: Resource name override. + * + * @return the resourceIdDimensionNameOverride value. + */ + public String resourceIdDimensionNameOverride() { + return this.resourceIdDimensionNameOverride; + } + + /** + * Set the resourceIdDimensionNameOverride property: Resource name override. + * + * @param resourceIdDimensionNameOverride the resourceIdDimensionNameOverride value to set. + * @return the MetricSpecificationV1 object itself. + */ + public MetricSpecificationV1 withResourceIdDimensionNameOverride(String resourceIdDimensionNameOverride) { + this.resourceIdDimensionNameOverride = resourceIdDimensionNameOverride; + return this; + } + + /** + * Get the supportedTimeGrainTypes property: Support granularity of metrics. + * + * @return the supportedTimeGrainTypes value. + */ + public List supportedTimeGrainTypes() { + return this.supportedTimeGrainTypes; + } + + /** + * Set the supportedTimeGrainTypes property: Support granularity of metrics. + * + * @param supportedTimeGrainTypes the supportedTimeGrainTypes value to set. + * @return the MetricSpecificationV1 object itself. + */ + public MetricSpecificationV1 withSupportedTimeGrainTypes(List supportedTimeGrainTypes) { + this.supportedTimeGrainTypes = supportedTimeGrainTypes; + return this; + } + + /** + * Get the supportedAggregationTypes property: Support metric aggregation type. + * + * @return the supportedAggregationTypes value. + */ + public List supportedAggregationTypes() { + return this.supportedAggregationTypes; + } + + /** + * Set the supportedAggregationTypes property: Support metric aggregation type. + * + * @param supportedAggregationTypes the supportedAggregationTypes value to set. + * @return the MetricSpecificationV1 object itself. + */ + public MetricSpecificationV1 withSupportedAggregationTypes(List supportedAggregationTypes) { + this.supportedAggregationTypes = supportedAggregationTypes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricUnit.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricUnit.java new file mode 100644 index 0000000000000..76682a918810f --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MetricUnit.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MetricUnit. */ +public final class MetricUnit extends ExpandableStringEnum { + /** Static value NotSpecified for MetricUnit. */ + public static final MetricUnit NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Percent for MetricUnit. */ + public static final MetricUnit PERCENT = fromString("Percent"); + + /** Static value Count for MetricUnit. */ + public static final MetricUnit COUNT = fromString("Count"); + + /** Static value Seconds for MetricUnit. */ + public static final MetricUnit SECONDS = fromString("Seconds"); + + /** Static value Milliseconds for MetricUnit. */ + public static final MetricUnit MILLISECONDS = fromString("Milliseconds"); + + /** Static value Bytes for MetricUnit. */ + public static final MetricUnit BYTES = fromString("Bytes"); + + /** Static value BytesPerSecond for MetricUnit. */ + public static final MetricUnit BYTES_PER_SECOND = fromString("BytesPerSecond"); + + /** Static value CountPerSecond for MetricUnit. */ + public static final MetricUnit COUNT_PER_SECOND = fromString("CountPerSecond"); + + /** + * Creates or finds a MetricUnit from its string representation. + * + * @param name a name to look for. + * @return the corresponding MetricUnit. + */ + @JsonCreator + public static MetricUnit fromString(String name) { + return fromString(name, MetricUnit.class); + } + + /** @return known MetricUnit values. */ + public static Collection values() { + return values(MetricUnit.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MonitoringStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MonitoringStatus.java new file mode 100644 index 0000000000000..345a31b40f925 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MonitoringStatus.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MonitoringStatus. */ +public final class MonitoringStatus extends ExpandableStringEnum { + /** Static value Enabled for MonitoringStatus. */ + public static final MonitoringStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for MonitoringStatus. */ + public static final MonitoringStatus DISABLED = fromString("Disabled"); + + /** + * Creates or finds a MonitoringStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding MonitoringStatus. + */ + @JsonCreator + public static MonitoringStatus fromString(String name) { + return fromString(name, MonitoringStatus.class); + } + + /** @return known MonitoringStatus values. */ + public static Collection values() { + return values(MonitoringStatus.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MountPointMap.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MountPointMap.java new file mode 100644 index 0000000000000..fa15964372061 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/MountPointMap.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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 share mount point. */ +@Fluent +public final class MountPointMap { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MountPointMap.class); + + /* + * ID of the share mounted to the role VM. + */ + @JsonProperty(value = "shareId", required = true) + private String shareId; + + /* + * ID of the role to which share is mounted. + */ + @JsonProperty(value = "roleId", access = JsonProperty.Access.WRITE_ONLY) + private String roleId; + + /* + * Mount point for the share. + */ + @JsonProperty(value = "mountPoint", access = JsonProperty.Access.WRITE_ONLY) + private String mountPoint; + + /* + * Role type. + */ + @JsonProperty(value = "roleType", access = JsonProperty.Access.WRITE_ONLY) + private RoleTypes roleType; + + /** + * Get the shareId property: ID of the share mounted to the role VM. + * + * @return the shareId value. + */ + public String shareId() { + return this.shareId; + } + + /** + * Set the shareId property: ID of the share mounted to the role VM. + * + * @param shareId the shareId value to set. + * @return the MountPointMap object itself. + */ + public MountPointMap withShareId(String shareId) { + this.shareId = shareId; + return this; + } + + /** + * Get the roleId property: ID of the role to which share is mounted. + * + * @return the roleId value. + */ + public String roleId() { + return this.roleId; + } + + /** + * Get the mountPoint property: Mount point for the share. + * + * @return the mountPoint value. + */ + public String mountPoint() { + return this.mountPoint; + } + + /** + * Get the roleType property: Role type. + * + * @return the roleType value. + */ + public RoleTypes roleType() { + return this.roleType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (shareId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property shareId in model MountPointMap")); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapter.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapter.java new file mode 100644 index 0000000000000..0fe6285db7f61 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapter.java @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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; + +/** Represents the networkAdapter on a device. */ +@Fluent +public final class NetworkAdapter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkAdapter.class); + + /* + * Instance ID of network adapter. + */ + @JsonProperty(value = "adapterId", access = JsonProperty.Access.WRITE_ONLY) + private String adapterId; + + /* + * Hardware position of network adapter. + */ + @JsonProperty(value = "adapterPosition", access = JsonProperty.Access.WRITE_ONLY) + private NetworkAdapterPosition adapterPosition; + + /* + * Logical index of the adapter. + */ + @JsonProperty(value = "index", access = JsonProperty.Access.WRITE_ONLY) + private Integer index; + + /* + * Node ID of the network adapter. + */ + @JsonProperty(value = "nodeId", access = JsonProperty.Access.WRITE_ONLY) + private String nodeId; + + /* + * Network adapter name. + */ + @JsonProperty(value = "networkAdapterName", access = JsonProperty.Access.WRITE_ONLY) + private String networkAdapterName; + + /* + * Hardware label for the adapter. + */ + @JsonProperty(value = "label", access = JsonProperty.Access.WRITE_ONLY) + private String label; + + /* + * MAC address. + */ + @JsonProperty(value = "macAddress", access = JsonProperty.Access.WRITE_ONLY) + private String macAddress; + + /* + * Link speed. + */ + @JsonProperty(value = "linkSpeed", access = JsonProperty.Access.WRITE_ONLY) + private Long linkSpeed; + + /* + * Value indicating whether this adapter is valid. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private NetworkAdapterStatus status; + + /* + * Value indicating whether this adapter is RDMA capable. + */ + @JsonProperty(value = "rdmaStatus") + private NetworkAdapterRdmaStatus rdmaStatus; + + /* + * Value indicating whether this adapter has DHCP enabled. + */ + @JsonProperty(value = "dhcpStatus") + private NetworkAdapterDhcpStatus dhcpStatus; + + /* + * The IPv4 configuration of the network adapter. + */ + @JsonProperty(value = "ipv4Configuration", access = JsonProperty.Access.WRITE_ONLY) + private Ipv4Config ipv4Configuration; + + /* + * The IPv6 configuration of the network adapter. + */ + @JsonProperty(value = "ipv6Configuration", access = JsonProperty.Access.WRITE_ONLY) + private Ipv6Config ipv6Configuration; + + /* + * The IPv6 local address. + */ + @JsonProperty(value = "ipv6LinkLocalAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipv6LinkLocalAddress; + + /* + * The list of DNS Servers of the device. + */ + @JsonProperty(value = "dnsServers", access = JsonProperty.Access.WRITE_ONLY) + private List dnsServers; + + /** + * Get the adapterId property: Instance ID of network adapter. + * + * @return the adapterId value. + */ + public String adapterId() { + return this.adapterId; + } + + /** + * Get the adapterPosition property: Hardware position of network adapter. + * + * @return the adapterPosition value. + */ + public NetworkAdapterPosition adapterPosition() { + return this.adapterPosition; + } + + /** + * Get the index property: Logical index of the adapter. + * + * @return the index value. + */ + public Integer index() { + return this.index; + } + + /** + * Get the nodeId property: Node ID of the network adapter. + * + * @return the nodeId value. + */ + public String nodeId() { + return this.nodeId; + } + + /** + * Get the networkAdapterName property: Network adapter name. + * + * @return the networkAdapterName value. + */ + public String networkAdapterName() { + return this.networkAdapterName; + } + + /** + * Get the label property: Hardware label for the adapter. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Get the macAddress property: MAC address. + * + * @return the macAddress value. + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Get the linkSpeed property: Link speed. + * + * @return the linkSpeed value. + */ + public Long linkSpeed() { + return this.linkSpeed; + } + + /** + * Get the status property: Value indicating whether this adapter is valid. + * + * @return the status value. + */ + public NetworkAdapterStatus status() { + return this.status; + } + + /** + * Get the rdmaStatus property: Value indicating whether this adapter is RDMA capable. + * + * @return the rdmaStatus value. + */ + public NetworkAdapterRdmaStatus rdmaStatus() { + return this.rdmaStatus; + } + + /** + * Set the rdmaStatus property: Value indicating whether this adapter is RDMA capable. + * + * @param rdmaStatus the rdmaStatus value to set. + * @return the NetworkAdapter object itself. + */ + public NetworkAdapter withRdmaStatus(NetworkAdapterRdmaStatus rdmaStatus) { + this.rdmaStatus = rdmaStatus; + return this; + } + + /** + * Get the dhcpStatus property: Value indicating whether this adapter has DHCP enabled. + * + * @return the dhcpStatus value. + */ + public NetworkAdapterDhcpStatus dhcpStatus() { + return this.dhcpStatus; + } + + /** + * Set the dhcpStatus property: Value indicating whether this adapter has DHCP enabled. + * + * @param dhcpStatus the dhcpStatus value to set. + * @return the NetworkAdapter object itself. + */ + public NetworkAdapter withDhcpStatus(NetworkAdapterDhcpStatus dhcpStatus) { + this.dhcpStatus = dhcpStatus; + return this; + } + + /** + * Get the ipv4Configuration property: The IPv4 configuration of the network adapter. + * + * @return the ipv4Configuration value. + */ + public Ipv4Config ipv4Configuration() { + return this.ipv4Configuration; + } + + /** + * Get the ipv6Configuration property: The IPv6 configuration of the network adapter. + * + * @return the ipv6Configuration value. + */ + public Ipv6Config ipv6Configuration() { + return this.ipv6Configuration; + } + + /** + * Get the ipv6LinkLocalAddress property: The IPv6 local address. + * + * @return the ipv6LinkLocalAddress value. + */ + public String ipv6LinkLocalAddress() { + return this.ipv6LinkLocalAddress; + } + + /** + * Get the dnsServers property: The list of DNS Servers of the device. + * + * @return the dnsServers value. + */ + public List dnsServers() { + return this.dnsServers; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (adapterPosition() != null) { + adapterPosition().validate(); + } + if (ipv4Configuration() != null) { + ipv4Configuration().validate(); + } + if (ipv6Configuration() != null) { + ipv6Configuration().validate(); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterDhcpStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterDhcpStatus.java new file mode 100644 index 0000000000000..134269dc8c5dc --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterDhcpStatus.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NetworkAdapterDhcpStatus. */ +public final class NetworkAdapterDhcpStatus extends ExpandableStringEnum { + /** Static value Disabled for NetworkAdapterDhcpStatus. */ + public static final NetworkAdapterDhcpStatus DISABLED = fromString("Disabled"); + + /** Static value Enabled for NetworkAdapterDhcpStatus. */ + public static final NetworkAdapterDhcpStatus ENABLED = fromString("Enabled"); + + /** + * Creates or finds a NetworkAdapterDhcpStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkAdapterDhcpStatus. + */ + @JsonCreator + public static NetworkAdapterDhcpStatus fromString(String name) { + return fromString(name, NetworkAdapterDhcpStatus.class); + } + + /** @return known NetworkAdapterDhcpStatus values. */ + public static Collection values() { + return values(NetworkAdapterDhcpStatus.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterPosition.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterPosition.java new file mode 100644 index 0000000000000..f3ee8664921d3 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterPosition.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.databoxedge.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 network adapter position. */ +@Immutable +public final class NetworkAdapterPosition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkAdapterPosition.class); + + /* + * The network group. + */ + @JsonProperty(value = "networkGroup", access = JsonProperty.Access.WRITE_ONLY) + private NetworkGroup networkGroup; + + /* + * The port. + */ + @JsonProperty(value = "port", access = JsonProperty.Access.WRITE_ONLY) + private Integer port; + + /** + * Get the networkGroup property: The network group. + * + * @return the networkGroup value. + */ + public NetworkGroup networkGroup() { + return this.networkGroup; + } + + /** + * Get the port property: The port. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterRdmaStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterRdmaStatus.java new file mode 100644 index 0000000000000..120898e5f2d17 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterRdmaStatus.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NetworkAdapterRdmaStatus. */ +public final class NetworkAdapterRdmaStatus extends ExpandableStringEnum { + /** Static value Incapable for NetworkAdapterRdmaStatus. */ + public static final NetworkAdapterRdmaStatus INCAPABLE = fromString("Incapable"); + + /** Static value Capable for NetworkAdapterRdmaStatus. */ + public static final NetworkAdapterRdmaStatus CAPABLE = fromString("Capable"); + + /** + * Creates or finds a NetworkAdapterRdmaStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkAdapterRdmaStatus. + */ + @JsonCreator + public static NetworkAdapterRdmaStatus fromString(String name) { + return fromString(name, NetworkAdapterRdmaStatus.class); + } + + /** @return known NetworkAdapterRdmaStatus values. */ + public static Collection values() { + return values(NetworkAdapterRdmaStatus.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterStatus.java new file mode 100644 index 0000000000000..7355e46171108 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkAdapterStatus.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NetworkAdapterStatus. */ +public final class NetworkAdapterStatus extends ExpandableStringEnum { + /** Static value Inactive for NetworkAdapterStatus. */ + public static final NetworkAdapterStatus INACTIVE = fromString("Inactive"); + + /** Static value Active for NetworkAdapterStatus. */ + public static final NetworkAdapterStatus ACTIVE = fromString("Active"); + + /** + * Creates or finds a NetworkAdapterStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkAdapterStatus. + */ + @JsonCreator + public static NetworkAdapterStatus fromString(String name) { + return fromString(name, NetworkAdapterStatus.class); + } + + /** @return known NetworkAdapterStatus values. */ + public static Collection values() { + return values(NetworkAdapterStatus.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkGroup.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkGroup.java new file mode 100644 index 0000000000000..92d67f4a55831 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkGroup.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NetworkGroup. */ +public final class NetworkGroup extends ExpandableStringEnum { + /** Static value None for NetworkGroup. */ + public static final NetworkGroup NONE = fromString("None"); + + /** Static value NonRDMA for NetworkGroup. */ + public static final NetworkGroup NON_RDMA = fromString("NonRDMA"); + + /** Static value RDMA for NetworkGroup. */ + public static final NetworkGroup RDMA = fromString("RDMA"); + + /** + * Creates or finds a NetworkGroup from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkGroup. + */ + @JsonCreator + public static NetworkGroup fromString(String name) { + return fromString(name, NetworkGroup.class); + } + + /** @return known NetworkGroup values. */ + public static Collection values() { + return values(NetworkGroup.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkSettings.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkSettings.java new file mode 100644 index 0000000000000..e225b91167736 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NetworkSettings.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.databoxedge.models; + +import com.azure.resourcemanager.databoxedge.fluent.models.NetworkSettingsInner; +import java.util.List; + +/** An immutable client-side representation of NetworkSettings. */ +public interface NetworkSettings { + /** + * 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 networkAdapters property: The network adapter list on the device. + * + * @return the networkAdapters value. + */ + List networkAdapters(); + + /** + * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.NetworkSettingsInner object. + * + * @return the inner object. + */ + NetworkSettingsInner innerModel(); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Node.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Node.java new file mode 100644 index 0000000000000..e45efed82723e --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Node.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.resourcemanager.databoxedge.fluent.models.NodeInner; + +/** An immutable client-side representation of Node. */ +public interface Node { + /** + * 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 nodeStatus property: The current status of the individual node. + * + * @return the nodeStatus value. + */ + NodeStatus nodeStatus(); + + /** + * Gets the nodeChassisSerialNumber property: Serial number of the Chassis. + * + * @return the nodeChassisSerialNumber value. + */ + String nodeChassisSerialNumber(); + + /** + * Gets the nodeSerialNumber property: Serial number of the individual node. + * + * @return the nodeSerialNumber value. + */ + String nodeSerialNumber(); + + /** + * Gets the nodeDisplayName property: Display Name of the individual node. + * + * @return the nodeDisplayName value. + */ + String nodeDisplayName(); + + /** + * Gets the nodeFriendlySoftwareVersion property: Friendly software version name that is currently installed on the + * node. + * + * @return the nodeFriendlySoftwareVersion value. + */ + String nodeFriendlySoftwareVersion(); + + /** + * Gets the nodeHcsVersion property: HCS version that is currently installed on the node. + * + * @return the nodeHcsVersion value. + */ + String nodeHcsVersion(); + + /** + * Gets the nodeInstanceId property: Guid instance id of the node. + * + * @return the nodeInstanceId value. + */ + String nodeInstanceId(); + + /** + * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.NodeInner object. + * + * @return the inner object. + */ + NodeInner innerModel(); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NodeList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NodeList.java new file mode 100644 index 0000000000000..5898dde5532d6 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NodeList.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.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.models.NodeInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of Nodes. */ +@Immutable +public final class NodeList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NodeList.class); + + /* + * The list of Nodes. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the value property: The list of Nodes. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NodeStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NodeStatus.java new file mode 100644 index 0000000000000..5cea2803fc1e7 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/NodeStatus.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NodeStatus. */ +public final class NodeStatus extends ExpandableStringEnum { + /** Static value Unknown for NodeStatus. */ + public static final NodeStatus UNKNOWN = fromString("Unknown"); + + /** Static value Up for NodeStatus. */ + public static final NodeStatus UP = fromString("Up"); + + /** Static value Down for NodeStatus. */ + public static final NodeStatus DOWN = fromString("Down"); + + /** Static value Rebooting for NodeStatus. */ + public static final NodeStatus REBOOTING = fromString("Rebooting"); + + /** Static value ShuttingDown for NodeStatus. */ + public static final NodeStatus SHUTTING_DOWN = fromString("ShuttingDown"); + + /** + * Creates or finds a NodeStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding NodeStatus. + */ + @JsonCreator + public static NodeStatus fromString(String name) { + return fromString(name, NodeStatus.class); + } + + /** @return known NodeStatus values. */ + public static Collection values() { + return values(NodeStatus.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Nodes.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Nodes.java new file mode 100644 index 0000000000000..eda51ed2a76f0 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Nodes.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.databoxedge.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Nodes. */ +public interface Nodes { + /** + * Gets all the nodes currently configured under this Data Box Edge device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the nodes currently configured under this Data Box Edge device. + */ + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + + /** + * Gets all the nodes currently configured under this Data Box Edge device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the nodes currently configured under this Data Box Edge device. + */ + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Operation.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Operation.java new file mode 100644 index 0000000000000..773d19cfaec27 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Operation.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.resourcemanager.databoxedge.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: Name of the operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: Properties displayed for the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: Origin of the operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the serviceSpecification property: Service specification. + * + * @return the serviceSpecification value. + */ + ServiceSpecification serviceSpecification(); + + /** + * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OperationDisplay.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OperationDisplay.java new file mode 100644 index 0000000000000..db4728c54a7b3 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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; + +/** Operation display properties. */ +@Fluent +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * Provider name. + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * The type of resource in which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * Operation to be performed on the resource. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Description of the operation to be performed. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider property: Provider name. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Provider name. + * + * @param provider the provider value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: The type of resource in which the operation is performed. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: The type of resource in which the operation is performed. + * + * @param resource the resource value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: Operation to be performed on the resource. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Operation to be performed on the resource. + * + * @param operation the operation value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: Description of the operation to be performed. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the operation to be performed. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Operations.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Operations.java new file mode 100644 index 0000000000000..2ca754c52ec3c --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/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.databoxedge.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * List all the supported 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 operations used for the discovery of available provider operations. + */ + PagedIterable list(); + + /** + * List all the supported 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 operations used for the discovery of available provider operations. + */ + PagedIterable list(Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OperationsList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OperationsList.java new file mode 100644 index 0000000000000..f1855e5bab608 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OperationsList.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.databoxedge.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of operations used for the discovery of available provider operations. */ +@Fluent +public final class OperationsList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsList.class); + + /* + * The value. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value. + * + * @param value the value value to set. + * @return the OperationsList object itself. + */ + public OperationsList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the OperationsList object itself. + */ + public OperationsList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model OperationsList")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OperationsStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OperationsStatus.java new file mode 100644 index 0000000000000..bc4912e87118f --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OperationsStatus.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of OperationsStatus. */ +public interface OperationsStatus { + /** + * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a specified job on a Data Box Edge/Data Box Gateway device. + */ + Job get(String deviceName, String name, String resourceGroupName); + + /** + * Gets the details of a specified job on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a specified job on a Data Box Edge/Data Box Gateway device. + */ + Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Order.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Order.java new file mode 100644 index 0000000000000..a4546284bf4b8 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Order.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.databoxedge.models; + +import com.azure.resourcemanager.databoxedge.fluent.models.OrderInner; +import java.util.List; + +/** An immutable client-side representation of Order. */ +public interface Order { + /** + * 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 contactInformation property: The contact details. + * + * @return the contactInformation value. + */ + ContactDetails contactInformation(); + + /** + * Gets the shippingAddress property: The shipping address. + * + * @return the shippingAddress value. + */ + Address shippingAddress(); + + /** + * Gets the currentStatus property: Current status of the order. + * + * @return the currentStatus value. + */ + OrderStatus currentStatus(); + + /** + * Gets the orderHistory property: List of status changes in the order. + * + * @return the orderHistory value. + */ + List orderHistory(); + + /** + * Gets the serialNumber property: Serial number of the device. + * + * @return the serialNumber value. + */ + String serialNumber(); + + /** + * Gets the deliveryTrackingInfo property: Tracking information for the package delivered to the customer whether it + * has an original or a replacement device. + * + * @return the deliveryTrackingInfo value. + */ + List deliveryTrackingInfo(); + + /** + * Gets the returnTrackingInfo property: Tracking information for the package returned from the customer whether it + * has an original or a replacement device. + * + * @return the returnTrackingInfo value. + */ + List returnTrackingInfo(); + + /** + * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.OrderInner object. + * + * @return the inner object. + */ + OrderInner innerModel(); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OrderList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OrderList.java new file mode 100644 index 0000000000000..0f570ed21ae16 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OrderList.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.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.models.OrderInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of order entities. */ +@Immutable +public final class OrderList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OrderList.class); + + /* + * The list of orders. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of orders. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to the next set 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/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OrderState.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OrderState.java new file mode 100644 index 0000000000000..ba3c467e57f58 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OrderState.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OrderState. */ +public final class OrderState extends ExpandableStringEnum { + /** Static value Untracked for OrderState. */ + public static final OrderState UNTRACKED = fromString("Untracked"); + + /** Static value AwaitingFulfilment for OrderState. */ + public static final OrderState AWAITING_FULFILMENT = fromString("AwaitingFulfilment"); + + /** Static value AwaitingPreparation for OrderState. */ + public static final OrderState AWAITING_PREPARATION = fromString("AwaitingPreparation"); + + /** Static value AwaitingShipment for OrderState. */ + public static final OrderState AWAITING_SHIPMENT = fromString("AwaitingShipment"); + + /** Static value Shipped for OrderState. */ + public static final OrderState SHIPPED = fromString("Shipped"); + + /** Static value Arriving for OrderState. */ + public static final OrderState ARRIVING = fromString("Arriving"); + + /** Static value Delivered for OrderState. */ + public static final OrderState DELIVERED = fromString("Delivered"); + + /** Static value ReplacementRequested for OrderState. */ + public static final OrderState REPLACEMENT_REQUESTED = fromString("ReplacementRequested"); + + /** Static value LostDevice for OrderState. */ + public static final OrderState LOST_DEVICE = fromString("LostDevice"); + + /** Static value Declined for OrderState. */ + public static final OrderState DECLINED = fromString("Declined"); + + /** Static value ReturnInitiated for OrderState. */ + public static final OrderState RETURN_INITIATED = fromString("ReturnInitiated"); + + /** Static value AwaitingReturnShipment for OrderState. */ + public static final OrderState AWAITING_RETURN_SHIPMENT = fromString("AwaitingReturnShipment"); + + /** Static value ShippedBack for OrderState. */ + public static final OrderState SHIPPED_BACK = fromString("ShippedBack"); + + /** Static value CollectedAtMicrosoft for OrderState. */ + public static final OrderState COLLECTED_AT_MICROSOFT = fromString("CollectedAtMicrosoft"); + + /** + * Creates or finds a OrderState from its string representation. + * + * @param name a name to look for. + * @return the corresponding OrderState. + */ + @JsonCreator + public static OrderState fromString(String name) { + return fromString(name, OrderState.class); + } + + /** @return known OrderState values. */ + public static Collection values() { + return values(OrderState.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OrderStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OrderStatus.java new file mode 100644 index 0000000000000..917d425588982 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/OrderStatus.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Represents a single status change. */ +@Fluent +public final class OrderStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OrderStatus.class); + + /* + * Status of the order as per the allowed status types. + */ + @JsonProperty(value = "status", required = true) + private OrderState status; + + /* + * Time of status update. + */ + @JsonProperty(value = "updateDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime updateDateTime; + + /* + * Comments related to this status change. + */ + @JsonProperty(value = "comments") + private String comments; + + /* + * Dictionary to hold generic information which is not stored + * by the already existing properties + */ + @JsonProperty(value = "additionalOrderDetails", access = JsonProperty.Access.WRITE_ONLY) + private Map additionalOrderDetails; + + /** + * Get the status property: Status of the order as per the allowed status types. + * + * @return the status value. + */ + public OrderState status() { + return this.status; + } + + /** + * Set the status property: Status of the order as per the allowed status types. + * + * @param status the status value to set. + * @return the OrderStatus object itself. + */ + public OrderStatus withStatus(OrderState status) { + this.status = status; + return this; + } + + /** + * Get the updateDateTime property: Time of status update. + * + * @return the updateDateTime value. + */ + public OffsetDateTime updateDateTime() { + return this.updateDateTime; + } + + /** + * Get the comments property: Comments related to this status change. + * + * @return the comments value. + */ + public String comments() { + return this.comments; + } + + /** + * Set the comments property: Comments related to this status change. + * + * @param comments the comments value to set. + * @return the OrderStatus object itself. + */ + public OrderStatus withComments(String comments) { + this.comments = comments; + return this; + } + + /** + * Get the additionalOrderDetails property: Dictionary to hold generic information which is not stored by the + * already existing properties. + * + * @return the additionalOrderDetails value. + */ + public Map additionalOrderDetails() { + return this.additionalOrderDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property status in model OrderStatus")); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Orders.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Orders.java new file mode 100644 index 0000000000000..3825466359cea --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Orders.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.databoxedge.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.databoxedge.fluent.models.OrderInner; + +/** Resource collection API of Orders. */ +public interface Orders { + /** + * Lists all the orders related to a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order entities. + */ + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + + /** + * Lists all the orders related to a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of order entities. + */ + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context); + + /** + * Gets a specific order by name. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 specific order by name. + */ + Order get(String deviceName, String resourceGroupName); + + /** + * Gets a specific order by name. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 specific order by name. + */ + Response getWithResponse(String deviceName, String resourceGroupName, Context context); + + /** + * Creates or updates an order. + * + * @param deviceName The order details of a device. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the order details. + */ + Order createOrUpdate(String deviceName, String resourceGroupName, OrderInner order); + + /** + * Creates or updates an order. + * + * @param deviceName The order details of a device. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the order details. + */ + Order createOrUpdate(String deviceName, String resourceGroupName, OrderInner order, Context context); + + /** + * Deletes the order related to the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String resourceGroupName); + + /** + * Deletes the order related to the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String resourceGroupName, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/PeriodicTimerEventTrigger.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/PeriodicTimerEventTrigger.java new file mode 100644 index 0000000000000..0b88eed6d6754 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/PeriodicTimerEventTrigger.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.models.TriggerInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Trigger details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("PeriodicTimerEvent") +@JsonFlatten +@Fluent +public class PeriodicTimerEventTrigger extends TriggerInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PeriodicTimerEventTrigger.class); + + /* + * Periodic timer details. + */ + @JsonProperty(value = "properties.sourceInfo", required = true) + private PeriodicTimerSourceInfo sourceInfo; + + /* + * Role Sink information. + */ + @JsonProperty(value = "properties.sinkInfo", required = true) + private RoleSinkInfo sinkInfo; + + /* + * A custom context tag typically used to correlate the trigger against its + * usage. For example, if a periodic timer trigger is intended for certain + * specific IoT modules in the device, the tag can be the name or the image + * URL of the module. + */ + @JsonProperty(value = "properties.customContextTag") + private String customContextTag; + + /** + * Get the sourceInfo property: Periodic timer details. + * + * @return the sourceInfo value. + */ + public PeriodicTimerSourceInfo sourceInfo() { + return this.sourceInfo; + } + + /** + * Set the sourceInfo property: Periodic timer details. + * + * @param sourceInfo the sourceInfo value to set. + * @return the PeriodicTimerEventTrigger object itself. + */ + public PeriodicTimerEventTrigger withSourceInfo(PeriodicTimerSourceInfo sourceInfo) { + this.sourceInfo = sourceInfo; + return this; + } + + /** + * Get the sinkInfo property: Role Sink information. + * + * @return the sinkInfo value. + */ + public RoleSinkInfo sinkInfo() { + return this.sinkInfo; + } + + /** + * Set the sinkInfo property: Role Sink information. + * + * @param sinkInfo the sinkInfo value to set. + * @return the PeriodicTimerEventTrigger object itself. + */ + public PeriodicTimerEventTrigger withSinkInfo(RoleSinkInfo sinkInfo) { + this.sinkInfo = sinkInfo; + return this; + } + + /** + * Get the customContextTag property: A custom context tag typically used to correlate the trigger against its + * usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the + * tag can be the name or the image URL of the module. + * + * @return the customContextTag value. + */ + public String customContextTag() { + return this.customContextTag; + } + + /** + * Set the customContextTag property: A custom context tag typically used to correlate the trigger against its + * usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the + * tag can be the name or the image URL of the module. + * + * @param customContextTag the customContextTag value to set. + * @return the PeriodicTimerEventTrigger object itself. + */ + public PeriodicTimerEventTrigger withCustomContextTag(String customContextTag) { + this.customContextTag = customContextTag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (sourceInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceInfo in model PeriodicTimerEventTrigger")); + } else { + sourceInfo().validate(); + } + if (sinkInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sinkInfo in model PeriodicTimerEventTrigger")); + } else { + sinkInfo().validate(); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/PeriodicTimerSourceInfo.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/PeriodicTimerSourceInfo.java new file mode 100644 index 0000000000000..27f37c75c7559 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/PeriodicTimerSourceInfo.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Periodic timer event source. */ +@Fluent +public final class PeriodicTimerSourceInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PeriodicTimerSourceInfo.class); + + /* + * The time of the day that results in a valid trigger. Schedule is + * computed with reference to the time specified upto seconds. If timezone + * is not specified the time will considered to be in device timezone. The + * value will always be returned as UTC time. + */ + @JsonProperty(value = "startTime", required = true) + private OffsetDateTime startTime; + + /* + * Periodic frequency at which timer event needs to be raised. Supports + * daily, hourly, minutes, and seconds. + */ + @JsonProperty(value = "schedule", required = true) + private String schedule; + + /* + * Topic where periodic events are published to IoT device. + */ + @JsonProperty(value = "topic") + private String topic; + + /** + * Get the startTime property: The time of the day that results in a valid trigger. Schedule is computed with + * reference to the time specified upto seconds. If timezone is not specified the time will considered to be in + * device timezone. The value will always be returned as UTC time. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The time of the day that results in a valid trigger. Schedule is computed with + * reference to the time specified upto seconds. If timezone is not specified the time will considered to be in + * device timezone. The value will always be returned as UTC time. + * + * @param startTime the startTime value to set. + * @return the PeriodicTimerSourceInfo object itself. + */ + public PeriodicTimerSourceInfo withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the schedule property: Periodic frequency at which timer event needs to be raised. Supports daily, hourly, + * minutes, and seconds. + * + * @return the schedule value. + */ + public String schedule() { + return this.schedule; + } + + /** + * Set the schedule property: Periodic frequency at which timer event needs to be raised. Supports daily, hourly, + * minutes, and seconds. + * + * @param schedule the schedule value to set. + * @return the PeriodicTimerSourceInfo object itself. + */ + public PeriodicTimerSourceInfo withSchedule(String schedule) { + this.schedule = schedule; + return this; + } + + /** + * Get the topic property: Topic where periodic events are published to IoT device. + * + * @return the topic value. + */ + public String topic() { + return this.topic; + } + + /** + * Set the topic property: Topic where periodic events are published to IoT device. + * + * @param topic the topic value to set. + * @return the PeriodicTimerSourceInfo object itself. + */ + public PeriodicTimerSourceInfo withTopic(String topic) { + this.topic = topic; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (startTime() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property startTime in model PeriodicTimerSourceInfo")); + } + if (schedule() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property schedule in model PeriodicTimerSourceInfo")); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/PlatformType.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/PlatformType.java new file mode 100644 index 0000000000000..741fcfa287af8 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/PlatformType.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PlatformType. */ +public final class PlatformType extends ExpandableStringEnum { + /** Static value Windows for PlatformType. */ + public static final PlatformType WINDOWS = fromString("Windows"); + + /** Static value Linux for PlatformType. */ + public static final PlatformType LINUX = fromString("Linux"); + + /** + * Creates or finds a PlatformType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PlatformType. + */ + @JsonCreator + public static PlatformType fromString(String name) { + return fromString(name, PlatformType.class); + } + + /** @return known PlatformType values. */ + public static Collection values() { + return values(PlatformType.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RefreshDetails.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RefreshDetails.java new file mode 100644 index 0000000000000..3efc2b962b820 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RefreshDetails.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Fields for tracking refresh job on the share or container. */ +@Fluent +public final class RefreshDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RefreshDetails.class); + + /* + * If a refresh job is currently in progress on this share or container, + * this field indicates the ARM resource ID of that job. The field is empty + * if no job is in progress. + */ + @JsonProperty(value = "inProgressRefreshJobId") + private String inProgressRefreshJobId; + + /* + * Indicates the completed time for the last refresh job on this particular + * share or container, if any.This could be a failed job or a successful + * job. + */ + @JsonProperty(value = "lastCompletedRefreshJobTimeInUTC") + private OffsetDateTime lastCompletedRefreshJobTimeInUtc; + + /* + * Indicates the relative path of the error xml for the last refresh job on + * this particular share or container, if any. This could be a failed job + * or a successful job. + */ + @JsonProperty(value = "errorManifestFile") + private String errorManifestFile; + + /* + * Indicates the id of the last refresh job on this particular share or + * container,if any. This could be a failed job or a successful job. + */ + @JsonProperty(value = "lastJob") + private String lastJob; + + /** + * Get the inProgressRefreshJobId property: If a refresh job is currently in progress on this share or container, + * this field indicates the ARM resource ID of that job. The field is empty if no job is in progress. + * + * @return the inProgressRefreshJobId value. + */ + public String inProgressRefreshJobId() { + return this.inProgressRefreshJobId; + } + + /** + * Set the inProgressRefreshJobId property: If a refresh job is currently in progress on this share or container, + * this field indicates the ARM resource ID of that job. The field is empty if no job is in progress. + * + * @param inProgressRefreshJobId the inProgressRefreshJobId value to set. + * @return the RefreshDetails object itself. + */ + public RefreshDetails withInProgressRefreshJobId(String inProgressRefreshJobId) { + this.inProgressRefreshJobId = inProgressRefreshJobId; + return this; + } + + /** + * Get the lastCompletedRefreshJobTimeInUtc property: Indicates the completed time for the last refresh job on this + * particular share or container, if any.This could be a failed job or a successful job. + * + * @return the lastCompletedRefreshJobTimeInUtc value. + */ + public OffsetDateTime lastCompletedRefreshJobTimeInUtc() { + return this.lastCompletedRefreshJobTimeInUtc; + } + + /** + * Set the lastCompletedRefreshJobTimeInUtc property: Indicates the completed time for the last refresh job on this + * particular share or container, if any.This could be a failed job or a successful job. + * + * @param lastCompletedRefreshJobTimeInUtc the lastCompletedRefreshJobTimeInUtc value to set. + * @return the RefreshDetails object itself. + */ + public RefreshDetails withLastCompletedRefreshJobTimeInUtc(OffsetDateTime lastCompletedRefreshJobTimeInUtc) { + this.lastCompletedRefreshJobTimeInUtc = lastCompletedRefreshJobTimeInUtc; + return this; + } + + /** + * Get the errorManifestFile property: Indicates the relative path of the error xml for the last refresh job on this + * particular share or container, if any. This could be a failed job or a successful job. + * + * @return the errorManifestFile value. + */ + public String errorManifestFile() { + return this.errorManifestFile; + } + + /** + * Set the errorManifestFile property: Indicates the relative path of the error xml for the last refresh job on this + * particular share or container, if any. This could be a failed job or a successful job. + * + * @param errorManifestFile the errorManifestFile value to set. + * @return the RefreshDetails object itself. + */ + public RefreshDetails withErrorManifestFile(String errorManifestFile) { + this.errorManifestFile = errorManifestFile; + return this; + } + + /** + * Get the lastJob property: Indicates the id of the last refresh job on this particular share or container,if any. + * This could be a failed job or a successful job. + * + * @return the lastJob value. + */ + public String lastJob() { + return this.lastJob; + } + + /** + * Set the lastJob property: Indicates the id of the last refresh job on this particular share or container,if any. + * This could be a failed job or a successful job. + * + * @param lastJob the lastJob value to set. + * @return the RefreshDetails object itself. + */ + public RefreshDetails withLastJob(String lastJob) { + this.lastJob = lastJob; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ResourceTypeSku.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ResourceTypeSku.java new file mode 100644 index 0000000000000..9812b27f45da6 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ResourceTypeSku.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.resourcemanager.databoxedge.fluent.models.ResourceTypeSkuInner; +import java.util.List; + +/** An immutable client-side representation of ResourceTypeSku. */ +public interface ResourceTypeSku { + /** + * Gets the resourceType property: The type of the resource. + * + * @return the resourceType value. + */ + String resourceType(); + + /** + * Gets the name property: The Sku name. + * + * @return the name value. + */ + SkuName name(); + + /** + * Gets the kind property: The Sku kind. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the tier property: The Sku tier. + * + * @return the tier value. + */ + SkuTier tier(); + + /** + * Gets the family property: The Sku family. + * + * @return the family value. + */ + String family(); + + /** + * Gets the locations property: Availability of the SKU for the region. + * + * @return the locations value. + */ + List locations(); + + /** + * Gets the apiVersions property: The API versions in which SKU is available. + * + * @return the apiVersions value. + */ + List apiVersions(); + + /** + * Gets the locationInfo property: Availability of the SKU for the location/zone. + * + * @return the locationInfo value. + */ + List locationInfo(); + + /** + * Gets the costs property: The pricing info of the Sku. + * + * @return the costs value. + */ + List costs(); + + /** + * Gets the restrictions property: Restrictions of the SKU availability. + * + * @return the restrictions value. + */ + List restrictions(); + + /** + * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.ResourceTypeSkuInner object. + * + * @return the inner object. + */ + ResourceTypeSkuInner innerModel(); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Role.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Role.java new file mode 100644 index 0000000000000..a470ff9e54474 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Role.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.resourcemanager.databoxedge.fluent.models.RoleInner; + +/** An immutable client-side representation of Role. */ +public interface Role { + /** + * 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 inner com.azure.resourcemanager.databoxedge.fluent.models.RoleInner object. + * + * @return the inner object. + */ + RoleInner innerModel(); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RoleList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RoleList.java new file mode 100644 index 0000000000000..7815f31ad9be7 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RoleList.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.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.models.RoleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of all the roles on the Data Box Edge device. */ +@Immutable +public final class RoleList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RoleList.class); + + /* + * The Value. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The Value. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to the next set 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/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RoleSinkInfo.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RoleSinkInfo.java new file mode 100644 index 0000000000000..25330d663d027 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RoleSinkInfo.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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; + +/** Compute role against which events will be raised. */ +@Fluent +public final class RoleSinkInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RoleSinkInfo.class); + + /* + * Compute role ID. + */ + @JsonProperty(value = "roleId", required = true) + private String roleId; + + /** + * Get the roleId property: Compute role ID. + * + * @return the roleId value. + */ + public String roleId() { + return this.roleId; + } + + /** + * Set the roleId property: Compute role ID. + * + * @param roleId the roleId value to set. + * @return the RoleSinkInfo object itself. + */ + public RoleSinkInfo withRoleId(String roleId) { + this.roleId = roleId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (roleId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property roleId in model RoleSinkInfo")); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RoleStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RoleStatus.java new file mode 100644 index 0000000000000..e0782b764c892 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RoleStatus.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RoleStatus. */ +public final class RoleStatus extends ExpandableStringEnum { + /** Static value Enabled for RoleStatus. */ + public static final RoleStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for RoleStatus. */ + public static final RoleStatus DISABLED = fromString("Disabled"); + + /** + * Creates or finds a RoleStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding RoleStatus. + */ + @JsonCreator + public static RoleStatus fromString(String name) { + return fromString(name, RoleStatus.class); + } + + /** @return known RoleStatus values. */ + public static Collection values() { + return values(RoleStatus.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RoleTypes.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RoleTypes.java new file mode 100644 index 0000000000000..77d85cf669660 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/RoleTypes.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RoleTypes. */ +public final class RoleTypes extends ExpandableStringEnum { + /** Static value IOT for RoleTypes. */ + public static final RoleTypes IOT = fromString("IOT"); + + /** Static value ASA for RoleTypes. */ + public static final RoleTypes ASA = fromString("ASA"); + + /** Static value Functions for RoleTypes. */ + public static final RoleTypes FUNCTIONS = fromString("Functions"); + + /** Static value Cognitive for RoleTypes. */ + public static final RoleTypes COGNITIVE = fromString("Cognitive"); + + /** + * Creates or finds a RoleTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding RoleTypes. + */ + @JsonCreator + public static RoleTypes fromString(String name) { + return fromString(name, RoleTypes.class); + } + + /** @return known RoleTypes values. */ + public static Collection values() { + return values(RoleTypes.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Roles.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Roles.java new file mode 100644 index 0000000000000..9a944afebc200 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Roles.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.databoxedge.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.databoxedge.fluent.models.RoleInner; + +/** Resource collection API of Roles. */ +public interface Roles { + /** + * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the roles on the Data Box Edge device. + */ + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + + /** + * Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the roles on the Data Box Edge device. + */ + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context); + + /** + * Gets a specific role by name. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 specific role by name. + */ + Role get(String deviceName, String name, String resourceGroupName); + + /** + * Gets a specific role by name. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 specific role by name. + */ + Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); + + /** + * Create or update a role. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param role The role properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return compute role. + */ + Role createOrUpdate(String deviceName, String name, String resourceGroupName, RoleInner role); + + /** + * Create or update a role. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param role The role properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return compute role. + */ + Role createOrUpdate(String deviceName, String name, String resourceGroupName, RoleInner role, Context context); + + /** + * Deletes the role on the device. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String name, String resourceGroupName); + + /** + * Deletes the role on the device. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String name, String resourceGroupName, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SecuritySettings.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SecuritySettings.java new file mode 100644 index 0000000000000..aab9264af01ae --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SecuritySettings.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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 security settings of a device. */ +@JsonFlatten +@Fluent +public class SecuritySettings extends ArmBaseModel { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecuritySettings.class); + + /* + * Device administrator password as an encrypted string (encrypted using + * RSA PKCS #1) is used to sign into the local web UI of the device. The + * Actual password should have at least 8 characters that are a combination + * of uppercase, lowercase, numeric, and special characters. + */ + @JsonProperty(value = "properties.deviceAdminPassword", required = true) + private AsymmetricEncryptedSecret deviceAdminPassword; + + /** + * Get the deviceAdminPassword property: Device administrator password as an encrypted string (encrypted using RSA + * PKCS #1) is used to sign into the local web UI of the device. The Actual password should have at least 8 + * characters that are a combination of uppercase, lowercase, numeric, and special characters. + * + * @return the deviceAdminPassword value. + */ + public AsymmetricEncryptedSecret deviceAdminPassword() { + return this.deviceAdminPassword; + } + + /** + * Set the deviceAdminPassword property: Device administrator password as an encrypted string (encrypted using RSA + * PKCS #1) is used to sign into the local web UI of the device. The Actual password should have at least 8 + * characters that are a combination of uppercase, lowercase, numeric, and special characters. + * + * @param deviceAdminPassword the deviceAdminPassword value to set. + * @return the SecuritySettings object itself. + */ + public SecuritySettings withDeviceAdminPassword(AsymmetricEncryptedSecret deviceAdminPassword) { + this.deviceAdminPassword = deviceAdminPassword; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (deviceAdminPassword() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property deviceAdminPassword in model SecuritySettings")); + } else { + deviceAdminPassword().validate(); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ServiceSpecification.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ServiceSpecification.java new file mode 100644 index 0000000000000..166993c9e860b --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ServiceSpecification.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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; + +/** Service specification. */ +@Fluent +public final class ServiceSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceSpecification.class); + + /* + * Metric specification as defined by shoebox. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Get the metricSpecifications property: Metric specification as defined by shoebox. + * + * @return the metricSpecifications value. + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set the metricSpecifications property: Metric specification as defined by shoebox. + * + * @param metricSpecifications the metricSpecifications value to set. + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metricSpecifications() != null) { + metricSpecifications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Share.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Share.java new file mode 100644 index 0000000000000..72dffc3710a86 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Share.java @@ -0,0 +1,403 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.databoxedge.fluent.models.ShareInner; +import java.util.List; + +/** An immutable client-side representation of Share. */ +public interface Share { + /** + * 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 description property: Description for the share. + * + * @return the description value. + */ + String description(); + + /** + * Gets the shareStatus property: Current status of the share. + * + * @return the shareStatus value. + */ + ShareStatus shareStatus(); + + /** + * Gets the monitoringStatus property: Current monitoring status of the share. + * + * @return the monitoringStatus value. + */ + MonitoringStatus monitoringStatus(); + + /** + * Gets the azureContainerInfo property: Azure container mapping for the share. + * + * @return the azureContainerInfo value. + */ + AzureContainerInfo azureContainerInfo(); + + /** + * Gets the accessProtocol property: Access protocol to be used by the share. + * + * @return the accessProtocol value. + */ + ShareAccessProtocol accessProtocol(); + + /** + * Gets the userAccessRights property: Mapping of users and corresponding access rights on the share (required for + * SMB protocol). + * + * @return the userAccessRights value. + */ + List userAccessRights(); + + /** + * Gets the clientAccessRights property: List of IP addresses and corresponding access rights on the share(required + * for NFS protocol). + * + * @return the clientAccessRights value. + */ + List clientAccessRights(); + + /** + * Gets the refreshDetails property: Details of the refresh job on this share. + * + * @return the refreshDetails value. + */ + RefreshDetails refreshDetails(); + + /** + * Gets the shareMappings property: Share mount point to the role. + * + * @return the shareMappings value. + */ + List shareMappings(); + + /** + * Gets the dataPolicy property: Data policy of the share. + * + * @return the dataPolicy value. + */ + DataPolicy dataPolicy(); + + /** + * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.ShareInner object. + * + * @return the inner object. + */ + ShareInner innerModel(); + + /** The entirety of the Share definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithShareStatus, + DefinitionStages.WithMonitoringStatus, + DefinitionStages.WithAccessProtocol, + DefinitionStages.WithCreate { + } + /** The Share definition stages. */ + interface DefinitionStages { + /** The first stage of the Share definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Share definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies deviceName, resourceGroupName. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @return the next definition stage. + */ + WithShareStatus withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName); + } + /** The stage of the Share definition allowing to specify shareStatus. */ + interface WithShareStatus { + /** + * Specifies the shareStatus property: Current status of the share.. + * + * @param shareStatus Current status of the share. + * @return the next definition stage. + */ + WithMonitoringStatus withShareStatus(ShareStatus shareStatus); + } + /** The stage of the Share definition allowing to specify monitoringStatus. */ + interface WithMonitoringStatus { + /** + * Specifies the monitoringStatus property: Current monitoring status of the share.. + * + * @param monitoringStatus Current monitoring status of the share. + * @return the next definition stage. + */ + WithAccessProtocol withMonitoringStatus(MonitoringStatus monitoringStatus); + } + /** The stage of the Share definition allowing to specify accessProtocol. */ + interface WithAccessProtocol { + /** + * Specifies the accessProtocol property: Access protocol to be used by the share.. + * + * @param accessProtocol Access protocol to be used by the share. + * @return the next definition stage. + */ + WithCreate withAccessProtocol(ShareAccessProtocol accessProtocol); + } + /** + * The stage of the Share 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.WithDescription, + DefinitionStages.WithAzureContainerInfo, + DefinitionStages.WithUserAccessRights, + DefinitionStages.WithClientAccessRights, + DefinitionStages.WithRefreshDetails, + DefinitionStages.WithDataPolicy { + /** + * Executes the create request. + * + * @return the created resource. + */ + Share create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Share create(Context context); + } + /** The stage of the Share definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Description for the share.. + * + * @param description Description for the share. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the Share definition allowing to specify azureContainerInfo. */ + interface WithAzureContainerInfo { + /** + * Specifies the azureContainerInfo property: Azure container mapping for the share.. + * + * @param azureContainerInfo Azure container mapping for the share. + * @return the next definition stage. + */ + WithCreate withAzureContainerInfo(AzureContainerInfo azureContainerInfo); + } + /** The stage of the Share definition allowing to specify userAccessRights. */ + interface WithUserAccessRights { + /** + * Specifies the userAccessRights property: Mapping of users and corresponding access rights on the share + * (required for SMB protocol).. + * + * @param userAccessRights Mapping of users and corresponding access rights on the share (required for SMB + * protocol). + * @return the next definition stage. + */ + WithCreate withUserAccessRights(List userAccessRights); + } + /** The stage of the Share definition allowing to specify clientAccessRights. */ + interface WithClientAccessRights { + /** + * Specifies the clientAccessRights property: List of IP addresses and corresponding access rights on the + * share(required for NFS protocol).. + * + * @param clientAccessRights List of IP addresses and corresponding access rights on the share(required for + * NFS protocol). + * @return the next definition stage. + */ + WithCreate withClientAccessRights(List clientAccessRights); + } + /** The stage of the Share definition allowing to specify refreshDetails. */ + interface WithRefreshDetails { + /** + * Specifies the refreshDetails property: Details of the refresh job on this share.. + * + * @param refreshDetails Details of the refresh job on this share. + * @return the next definition stage. + */ + WithCreate withRefreshDetails(RefreshDetails refreshDetails); + } + /** The stage of the Share definition allowing to specify dataPolicy. */ + interface WithDataPolicy { + /** + * Specifies the dataPolicy property: Data policy of the share.. + * + * @param dataPolicy Data policy of the share. + * @return the next definition stage. + */ + WithCreate withDataPolicy(DataPolicy dataPolicy); + } + } + /** + * Begins update for the Share resource. + * + * @return the stage of resource update. + */ + Share.Update update(); + + /** The template for Share update. */ + interface Update + extends UpdateStages.WithDescription, + UpdateStages.WithShareStatus, + UpdateStages.WithMonitoringStatus, + UpdateStages.WithAzureContainerInfo, + UpdateStages.WithAccessProtocol, + UpdateStages.WithUserAccessRights, + UpdateStages.WithClientAccessRights, + UpdateStages.WithRefreshDetails, + UpdateStages.WithDataPolicy { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Share apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Share apply(Context context); + } + /** The Share update stages. */ + interface UpdateStages { + /** The stage of the Share update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Description for the share.. + * + * @param description Description for the share. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the Share update allowing to specify shareStatus. */ + interface WithShareStatus { + /** + * Specifies the shareStatus property: Current status of the share.. + * + * @param shareStatus Current status of the share. + * @return the next definition stage. + */ + Update withShareStatus(ShareStatus shareStatus); + } + /** The stage of the Share update allowing to specify monitoringStatus. */ + interface WithMonitoringStatus { + /** + * Specifies the monitoringStatus property: Current monitoring status of the share.. + * + * @param monitoringStatus Current monitoring status of the share. + * @return the next definition stage. + */ + Update withMonitoringStatus(MonitoringStatus monitoringStatus); + } + /** The stage of the Share update allowing to specify azureContainerInfo. */ + interface WithAzureContainerInfo { + /** + * Specifies the azureContainerInfo property: Azure container mapping for the share.. + * + * @param azureContainerInfo Azure container mapping for the share. + * @return the next definition stage. + */ + Update withAzureContainerInfo(AzureContainerInfo azureContainerInfo); + } + /** The stage of the Share update allowing to specify accessProtocol. */ + interface WithAccessProtocol { + /** + * Specifies the accessProtocol property: Access protocol to be used by the share.. + * + * @param accessProtocol Access protocol to be used by the share. + * @return the next definition stage. + */ + Update withAccessProtocol(ShareAccessProtocol accessProtocol); + } + /** The stage of the Share update allowing to specify userAccessRights. */ + interface WithUserAccessRights { + /** + * Specifies the userAccessRights property: Mapping of users and corresponding access rights on the share + * (required for SMB protocol).. + * + * @param userAccessRights Mapping of users and corresponding access rights on the share (required for SMB + * protocol). + * @return the next definition stage. + */ + Update withUserAccessRights(List userAccessRights); + } + /** The stage of the Share update allowing to specify clientAccessRights. */ + interface WithClientAccessRights { + /** + * Specifies the clientAccessRights property: List of IP addresses and corresponding access rights on the + * share(required for NFS protocol).. + * + * @param clientAccessRights List of IP addresses and corresponding access rights on the share(required for + * NFS protocol). + * @return the next definition stage. + */ + Update withClientAccessRights(List clientAccessRights); + } + /** The stage of the Share update allowing to specify refreshDetails. */ + interface WithRefreshDetails { + /** + * Specifies the refreshDetails property: Details of the refresh job on this share.. + * + * @param refreshDetails Details of the refresh job on this share. + * @return the next definition stage. + */ + Update withRefreshDetails(RefreshDetails refreshDetails); + } + /** The stage of the Share update allowing to specify dataPolicy. */ + interface WithDataPolicy { + /** + * Specifies the dataPolicy property: Data policy of the share.. + * + * @param dataPolicy Data policy of the share. + * @return the next definition stage. + */ + Update withDataPolicy(DataPolicy dataPolicy); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Share refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Share refresh(Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareAccessProtocol.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareAccessProtocol.java new file mode 100644 index 0000000000000..e25a0bb86b123 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareAccessProtocol.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ShareAccessProtocol. */ +public final class ShareAccessProtocol extends ExpandableStringEnum { + /** Static value SMB for ShareAccessProtocol. */ + public static final ShareAccessProtocol SMB = fromString("SMB"); + + /** Static value NFS for ShareAccessProtocol. */ + public static final ShareAccessProtocol NFS = fromString("NFS"); + + /** + * Creates or finds a ShareAccessProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding ShareAccessProtocol. + */ + @JsonCreator + public static ShareAccessProtocol fromString(String name) { + return fromString(name, ShareAccessProtocol.class); + } + + /** @return known ShareAccessProtocol values. */ + public static Collection values() { + return values(ShareAccessProtocol.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareAccessRight.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareAccessRight.java new file mode 100644 index 0000000000000..1e34abad55cbb --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareAccessRight.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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; + +/** Specifies the mapping between this particular user and the type of access he has on shares on this device. */ +@Fluent +public final class ShareAccessRight { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ShareAccessRight.class); + + /* + * The share ID. + */ + @JsonProperty(value = "shareId", required = true) + private String shareId; + + /* + * Type of access to be allowed on the share for this user. + */ + @JsonProperty(value = "accessType", required = true) + private ShareAccessType accessType; + + /** + * Get the shareId property: The share ID. + * + * @return the shareId value. + */ + public String shareId() { + return this.shareId; + } + + /** + * Set the shareId property: The share ID. + * + * @param shareId the shareId value to set. + * @return the ShareAccessRight object itself. + */ + public ShareAccessRight withShareId(String shareId) { + this.shareId = shareId; + return this; + } + + /** + * Get the accessType property: Type of access to be allowed on the share for this user. + * + * @return the accessType value. + */ + public ShareAccessType accessType() { + return this.accessType; + } + + /** + * Set the accessType property: Type of access to be allowed on the share for this user. + * + * @param accessType the accessType value to set. + * @return the ShareAccessRight object itself. + */ + public ShareAccessRight withAccessType(ShareAccessType accessType) { + this.accessType = accessType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (shareId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property shareId in model ShareAccessRight")); + } + if (accessType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property accessType in model ShareAccessRight")); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareAccessType.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareAccessType.java new file mode 100644 index 0000000000000..3bbb8f4d9ada7 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareAccessType.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ShareAccessType. */ +public final class ShareAccessType extends ExpandableStringEnum { + /** Static value Change for ShareAccessType. */ + public static final ShareAccessType CHANGE = fromString("Change"); + + /** Static value Read for ShareAccessType. */ + public static final ShareAccessType READ = fromString("Read"); + + /** Static value Custom for ShareAccessType. */ + public static final ShareAccessType CUSTOM = fromString("Custom"); + + /** + * Creates or finds a ShareAccessType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ShareAccessType. + */ + @JsonCreator + public static ShareAccessType fromString(String name) { + return fromString(name, ShareAccessType.class); + } + + /** @return known ShareAccessType values. */ + public static Collection values() { + return values(ShareAccessType.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareList.java new file mode 100644 index 0000000000000..69316787a4f0a --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareList.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.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.models.ShareInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of all the shares on the Data Box Edge/Gateway device. */ +@Immutable +public final class ShareList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ShareList.class); + + /* + * The list of shares. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of shares. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to the next set 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/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareStatus.java new file mode 100644 index 0000000000000..19be822a5444f --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/ShareStatus.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ShareStatus. */ +public final class ShareStatus extends ExpandableStringEnum { + /** Static value Offline for ShareStatus. */ + public static final ShareStatus OFFLINE = fromString("Offline"); + + /** Static value Unknown for ShareStatus. */ + public static final ShareStatus UNKNOWN = fromString("Unknown"); + + /** Static value OK for ShareStatus. */ + public static final ShareStatus OK = fromString("OK"); + + /** Static value Updating for ShareStatus. */ + public static final ShareStatus UPDATING = fromString("Updating"); + + /** Static value NeedsAttention for ShareStatus. */ + public static final ShareStatus NEEDS_ATTENTION = fromString("NeedsAttention"); + + /** + * Creates or finds a ShareStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ShareStatus. + */ + @JsonCreator + public static ShareStatus fromString(String name) { + return fromString(name, ShareStatus.class); + } + + /** @return known ShareStatus values. */ + public static Collection values() { + return values(ShareStatus.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Shares.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Shares.java new file mode 100644 index 0000000000000..e0835f7259bc0 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Shares.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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 Shares. */ +public interface Shares { + /** + * Lists all the shares in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the shares on the Data Box Edge/Gateway device. + */ + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + + /** + * Lists all the shares in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the shares on the Data Box Edge/Gateway device. + */ + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context); + + /** + * Gets a share by name. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 share by name. + */ + Share get(String deviceName, String name, String resourceGroupName); + + /** + * Gets a share by name. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 share by name. + */ + Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); + + /** + * Deletes the share on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String name, String resourceGroupName); + + /** + * Deletes the share on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String name, String resourceGroupName, Context context); + + /** + * Refreshes the share metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 refresh(String deviceName, String name, String resourceGroupName); + + /** + * Refreshes the share metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 refresh(String deviceName, String name, String resourceGroupName, Context context); + + /** + * Gets a share by 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. + * @return a share by name. + */ + Share getById(String id); + + /** + * Gets a share by 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. + * @return a share by name. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the share on the Data Box Edge/Data Box Gateway device. + * + * @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 share on the Data Box Edge/Data Box Gateway device. + * + * @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 Share resource. + * + * @param name resource name. + * @return the first stage of the new Share definition. + */ + Share.DefinitionStages.Blank define(String name); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Sku.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Sku.java new file mode 100644 index 0000000000000..dc92865c757a4 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Sku.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SKU type. */ +@Fluent +public final class Sku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); + + /* + * SKU name. + */ + @JsonProperty(value = "name") + private SkuName name; + + /* + * The SKU tier. This is based on the SKU name. + */ + @JsonProperty(value = "tier") + private SkuTier tier; + + /** + * Get the name property: SKU name. + * + * @return the name value. + */ + public SkuName name() { + return this.name; + } + + /** + * Set the name property: SKU name. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The SKU tier. This is based on the SKU name. + * + * @return the tier value. + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: The SKU tier. This is based on the SKU name. + * + * @param tier the tier value to set. + * @return the Sku object itself. + */ + public Sku withTier(SkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuCost.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuCost.java new file mode 100644 index 0000000000000..d90f1c5a98367 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuCost.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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 metadata for retrieving price info. */ +@Immutable +public final class SkuCost { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuCost.class); + + /* + * Used for querying price from commerce. + */ + @JsonProperty(value = "meterId", access = JsonProperty.Access.WRITE_ONLY) + private String meterId; + + /* + * The cost quantity. + */ + @JsonProperty(value = "quantity", access = JsonProperty.Access.WRITE_ONLY) + private Long quantity; + + /* + * Restriction of the SKU for the location/zone + */ + @JsonProperty(value = "extendedUnit", access = JsonProperty.Access.WRITE_ONLY) + private String extendedUnit; + + /** + * Get the meterId property: Used for querying price from commerce. + * + * @return the meterId value. + */ + public String meterId() { + return this.meterId; + } + + /** + * Get the quantity property: The cost quantity. + * + * @return the quantity value. + */ + public Long quantity() { + return this.quantity; + } + + /** + * Get the extendedUnit property: Restriction of the SKU for the location/zone. + * + * @return the extendedUnit value. + */ + public String extendedUnit() { + return this.extendedUnit; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuInformationList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuInformationList.java new file mode 100644 index 0000000000000..08c1420a730fc --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuInformationList.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.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.models.ResourceTypeSkuInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of SKU Information objects. */ +@Immutable +public final class SkuInformationList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuInformationList.class); + + /* + * List of ResourceType Sku + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Links to the next set of results + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of ResourceType Sku. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Links to the next set 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/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuLocationInfo.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuLocationInfo.java new file mode 100644 index 0000000000000..defd26917c1e9 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuLocationInfo.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The location info. */ +@Immutable +public final class SkuLocationInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuLocationInfo.class); + + /* + * The location. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * The zones. + */ + @JsonProperty(value = "zones", access = JsonProperty.Access.WRITE_ONLY) + private List zones; + + /* + * The sites. + */ + @JsonProperty(value = "sites", access = JsonProperty.Access.WRITE_ONLY) + private List sites; + + /** + * Get the location property: The location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the zones property: The zones. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Get the sites property: The sites. + * + * @return the sites value. + */ + public List sites() { + return this.sites; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuName.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuName.java new file mode 100644 index 0000000000000..4fbb2fb050570 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuName.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuName. */ +public final class SkuName extends ExpandableStringEnum { + /** Static value Gateway for SkuName. */ + public static final SkuName GATEWAY = fromString("Gateway"); + + /** Static value Edge for SkuName. */ + public static final SkuName EDGE = fromString("Edge"); + + /** Static value TEA_1Node for SkuName. */ + public static final SkuName TEA_1NODE = fromString("TEA_1Node"); + + /** Static value TEA_1Node_UPS for SkuName. */ + public static final SkuName TEA_1NODE_UPS = fromString("TEA_1Node_UPS"); + + /** Static value TEA_1Node_Heater for SkuName. */ + public static final SkuName TEA_1NODE_HEATER = fromString("TEA_1Node_Heater"); + + /** Static value TEA_1Node_UPS_Heater for SkuName. */ + public static final SkuName TEA_1NODE_UPS_HEATER = fromString("TEA_1Node_UPS_Heater"); + + /** Static value TEA_4Node_Heater for SkuName. */ + public static final SkuName TEA_4NODE_HEATER = fromString("TEA_4Node_Heater"); + + /** Static value TEA_4Node_UPS_Heater for SkuName. */ + public static final SkuName TEA_4NODE_UPS_HEATER = fromString("TEA_4Node_UPS_Heater"); + + /** Static value TMA for SkuName. */ + public static final SkuName TMA = fromString("TMA"); + + /** + * Creates or finds a SkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuName. + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** @return known SkuName values. */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuRestriction.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuRestriction.java new file mode 100644 index 0000000000000..1f1f9bca17ffc --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuRestriction.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The restrictions because of which SKU cannot be used. */ +@Immutable +public final class SkuRestriction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuRestriction.class); + + /* + * The type of the restriction. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The locations where sku is restricted. + */ + @JsonProperty(value = "values", access = JsonProperty.Access.WRITE_ONLY) + private List values; + + /* + * The SKU restriction reason. + */ + @JsonProperty(value = "reasonCode", access = JsonProperty.Access.WRITE_ONLY) + private SkuRestrictionReasonCode reasonCode; + + /* + * Restriction of the SKU for the location/zone + */ + @JsonProperty(value = "restrictionInfo", access = JsonProperty.Access.WRITE_ONLY) + private SkuRestrictionInfo restrictionInfo; + + /** + * Get the type property: The type of the restriction. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the values property: The locations where sku is restricted. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Get the reasonCode property: The SKU restriction reason. + * + * @return the reasonCode value. + */ + public SkuRestrictionReasonCode reasonCode() { + return this.reasonCode; + } + + /** + * Get the restrictionInfo property: Restriction of the SKU for the location/zone. + * + * @return the restrictionInfo value. + */ + public SkuRestrictionInfo restrictionInfo() { + return this.restrictionInfo; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (restrictionInfo() != null) { + restrictionInfo().validate(); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuRestrictionInfo.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuRestrictionInfo.java new file mode 100644 index 0000000000000..74d76c8f4687b --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuRestrictionInfo.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The restriction info with locations and zones. */ +@Immutable +public final class SkuRestrictionInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuRestrictionInfo.class); + + /* + * The locations. + */ + @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) + private List locations; + + /* + * The zones. + */ + @JsonProperty(value = "zones", access = JsonProperty.Access.WRITE_ONLY) + private List zones; + + /** + * Get the locations property: The locations. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Get the zones property: The zones. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuRestrictionReasonCode.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuRestrictionReasonCode.java new file mode 100644 index 0000000000000..30312411d9492 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuRestrictionReasonCode.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuRestrictionReasonCode. */ +public final class SkuRestrictionReasonCode extends ExpandableStringEnum { + /** Static value NotAvailableForSubscription for SkuRestrictionReasonCode. */ + public static final SkuRestrictionReasonCode NOT_AVAILABLE_FOR_SUBSCRIPTION = + fromString("NotAvailableForSubscription"); + + /** Static value QuotaId for SkuRestrictionReasonCode. */ + public static final SkuRestrictionReasonCode QUOTA_ID = fromString("QuotaId"); + + /** + * Creates or finds a SkuRestrictionReasonCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuRestrictionReasonCode. + */ + @JsonCreator + public static SkuRestrictionReasonCode fromString(String name) { + return fromString(name, SkuRestrictionReasonCode.class); + } + + /** @return known SkuRestrictionReasonCode values. */ + public static Collection values() { + return values(SkuRestrictionReasonCode.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuTier.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuTier.java new file mode 100644 index 0000000000000..3ad20942b228e --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SkuTier.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuTier. */ +public final class SkuTier extends ExpandableStringEnum { + /** Static value Standard for SkuTier. */ + public static final SkuTier STANDARD = fromString("Standard"); + + /** + * Creates or finds a SkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuTier. + */ + @JsonCreator + public static SkuTier fromString(String name) { + return fromString(name, SkuTier.class); + } + + /** @return known SkuTier values. */ + public static Collection values() { + return values(SkuTier.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Skus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Skus.java new file mode 100644 index 0000000000000..1af91b41addcf --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Skus.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.databoxedge.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Skus. */ +public interface Skus { + /** + * List all the available Skus in the region and information related to them. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU Information objects. + */ + PagedIterable list(); + + /** + * List all the available Skus in the region and information related to them. + * + * @param filter Specify $filter='location eq <location>' to filter on location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SKU Information objects. + */ + PagedIterable list(String filter, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SslStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SslStatus.java new file mode 100644 index 0000000000000..2adc8265b8052 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SslStatus.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SslStatus. */ +public final class SslStatus extends ExpandableStringEnum { + /** Static value Enabled for SslStatus. */ + public static final SslStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for SslStatus. */ + public static final SslStatus DISABLED = fromString("Disabled"); + + /** + * Creates or finds a SslStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SslStatus. + */ + @JsonCreator + public static SslStatus fromString(String name) { + return fromString(name, SslStatus.class); + } + + /** @return known SslStatus values. */ + public static Collection values() { + return values(SslStatus.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccount.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccount.java new file mode 100644 index 0000000000000..33b382d1360d0 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccount.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountInner; + +/** An immutable client-side representation of StorageAccount. */ +public interface StorageAccount { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the description property: Description for the storage Account. + * + * @return the description value. + */ + String description(); + + /** + * Gets the storageAccountStatus property: Current status of the storage account. + * + * @return the storageAccountStatus value. + */ + StorageAccountStatus storageAccountStatus(); + + /** + * Gets the dataPolicy property: Data policy of the storage Account. + * + * @return the dataPolicy value. + */ + DataPolicy dataPolicy(); + + /** + * Gets the storageAccountCredentialId property: Storage Account Credential Id. + * + * @return the storageAccountCredentialId value. + */ + String storageAccountCredentialId(); + + /** + * Gets the blobEndpoint property: BlobEndpoint of Storage Account. + * + * @return the blobEndpoint value. + */ + String blobEndpoint(); + + /** + * Gets the containerCount property: The Container Count. Present only for Storage Accounts with DataPolicy set to + * Cloud. + * + * @return the containerCount value. + */ + Integer containerCount(); + + /** + * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountInner object. + * + * @return the inner object. + */ + StorageAccountInner innerModel(); + + /** The entirety of the StorageAccount definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The StorageAccount definition stages. */ + interface DefinitionStages { + /** The first stage of the StorageAccount definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the StorageAccount definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies deviceName, resourceGroupName. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @return the next definition stage. + */ + WithCreate withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName); + } + /** + * The stage of the StorageAccount definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithDescription, + DefinitionStages.WithStorageAccountStatus, + DefinitionStages.WithDataPolicy, + DefinitionStages.WithStorageAccountCredentialId { + /** + * Executes the create request. + * + * @return the created resource. + */ + StorageAccount create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + StorageAccount create(Context context); + } + /** The stage of the StorageAccount definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Description for the storage Account.. + * + * @param description Description for the storage Account. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the StorageAccount definition allowing to specify storageAccountStatus. */ + interface WithStorageAccountStatus { + /** + * Specifies the storageAccountStatus property: Current status of the storage account. + * + * @param storageAccountStatus Current status of the storage account. + * @return the next definition stage. + */ + WithCreate withStorageAccountStatus(StorageAccountStatus storageAccountStatus); + } + /** The stage of the StorageAccount definition allowing to specify dataPolicy. */ + interface WithDataPolicy { + /** + * Specifies the dataPolicy property: Data policy of the storage Account.. + * + * @param dataPolicy Data policy of the storage Account. + * @return the next definition stage. + */ + WithCreate withDataPolicy(DataPolicy dataPolicy); + } + /** The stage of the StorageAccount definition allowing to specify storageAccountCredentialId. */ + interface WithStorageAccountCredentialId { + /** + * Specifies the storageAccountCredentialId property: Storage Account Credential Id. + * + * @param storageAccountCredentialId Storage Account Credential Id. + * @return the next definition stage. + */ + WithCreate withStorageAccountCredentialId(String storageAccountCredentialId); + } + } + /** + * Begins update for the StorageAccount resource. + * + * @return the stage of resource update. + */ + StorageAccount.Update update(); + + /** The template for StorageAccount update. */ + interface Update + extends UpdateStages.WithDescription, + UpdateStages.WithStorageAccountStatus, + UpdateStages.WithDataPolicy, + UpdateStages.WithStorageAccountCredentialId { + /** + * Executes the update request. + * + * @return the updated resource. + */ + StorageAccount apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + StorageAccount apply(Context context); + } + /** The StorageAccount update stages. */ + interface UpdateStages { + /** The stage of the StorageAccount update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Description for the storage Account.. + * + * @param description Description for the storage Account. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the StorageAccount update allowing to specify storageAccountStatus. */ + interface WithStorageAccountStatus { + /** + * Specifies the storageAccountStatus property: Current status of the storage account. + * + * @param storageAccountStatus Current status of the storage account. + * @return the next definition stage. + */ + Update withStorageAccountStatus(StorageAccountStatus storageAccountStatus); + } + /** The stage of the StorageAccount update allowing to specify dataPolicy. */ + interface WithDataPolicy { + /** + * Specifies the dataPolicy property: Data policy of the storage Account.. + * + * @param dataPolicy Data policy of the storage Account. + * @return the next definition stage. + */ + Update withDataPolicy(DataPolicy dataPolicy); + } + /** The stage of the StorageAccount update allowing to specify storageAccountCredentialId. */ + interface WithStorageAccountCredentialId { + /** + * Specifies the storageAccountCredentialId property: Storage Account Credential Id. + * + * @param storageAccountCredentialId Storage Account Credential Id. + * @return the next definition stage. + */ + Update withStorageAccountCredentialId(String storageAccountCredentialId); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + StorageAccount refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + StorageAccount refresh(Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountCredential.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountCredential.java new file mode 100644 index 0000000000000..d84a6b6654c33 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountCredential.java @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountCredentialInner; + +/** An immutable client-side representation of StorageAccountCredential. */ +public interface StorageAccountCredential { + /** + * 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 alias property: Alias for the storage account. + * + * @return the alias value. + */ + String alias(); + + /** + * Gets the username property: Username for the storage account. + * + * @return the username value. + */ + String username(); + + /** + * Gets the accountKey property: Encrypted storage key. + * + * @return the accountKey value. + */ + AsymmetricEncryptedSecret accountKey(); + + /** + * Gets the connectionString property: Connection string for the storage account. Use this string if username and + * account key are not specified. + * + * @return the connectionString value. + */ + String connectionString(); + + /** + * Gets the sslStatus property: Signifies whether SSL needs to be enabled or not. + * + * @return the sslStatus value. + */ + SslStatus sslStatus(); + + /** + * Gets the blobDomainName property: Blob end point for private clouds. + * + * @return the blobDomainName value. + */ + String blobDomainName(); + + /** + * Gets the accountType property: Type of storage accessed on the storage account. + * + * @return the accountType value. + */ + AccountType accountType(); + + /** + * Gets the storageAccountId property: Id of the storage account. + * + * @return the storageAccountId value. + */ + String storageAccountId(); + + /** + * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountCredentialInner object. + * + * @return the inner object. + */ + StorageAccountCredentialInner innerModel(); + + /** The entirety of the StorageAccountCredential definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithAlias, + DefinitionStages.WithSslStatus, + DefinitionStages.WithAccountType, + DefinitionStages.WithCreate { + } + /** The StorageAccountCredential definition stages. */ + interface DefinitionStages { + /** The first stage of the StorageAccountCredential definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the StorageAccountCredential definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies deviceName, resourceGroupName. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @return the next definition stage. + */ + WithAlias withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName); + } + /** The stage of the StorageAccountCredential definition allowing to specify alias. */ + interface WithAlias { + /** + * Specifies the alias property: Alias for the storage account.. + * + * @param alias Alias for the storage account. + * @return the next definition stage. + */ + WithSslStatus withAlias(String alias); + } + /** The stage of the StorageAccountCredential definition allowing to specify sslStatus. */ + interface WithSslStatus { + /** + * Specifies the sslStatus property: Signifies whether SSL needs to be enabled or not.. + * + * @param sslStatus Signifies whether SSL needs to be enabled or not. + * @return the next definition stage. + */ + WithAccountType withSslStatus(SslStatus sslStatus); + } + /** The stage of the StorageAccountCredential definition allowing to specify accountType. */ + interface WithAccountType { + /** + * Specifies the accountType property: Type of storage accessed on the storage account.. + * + * @param accountType Type of storage accessed on the storage account. + * @return the next definition stage. + */ + WithCreate withAccountType(AccountType accountType); + } + /** + * The stage of the StorageAccountCredential 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.WithUsername, + DefinitionStages.WithAccountKey, + DefinitionStages.WithConnectionString, + DefinitionStages.WithBlobDomainName, + DefinitionStages.WithStorageAccountId { + /** + * Executes the create request. + * + * @return the created resource. + */ + StorageAccountCredential create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + StorageAccountCredential create(Context context); + } + /** The stage of the StorageAccountCredential definition allowing to specify username. */ + interface WithUsername { + /** + * Specifies the username property: Username for the storage account.. + * + * @param username Username for the storage account. + * @return the next definition stage. + */ + WithCreate withUsername(String username); + } + /** The stage of the StorageAccountCredential definition allowing to specify accountKey. */ + interface WithAccountKey { + /** + * Specifies the accountKey property: Encrypted storage key.. + * + * @param accountKey Encrypted storage key. + * @return the next definition stage. + */ + WithCreate withAccountKey(AsymmetricEncryptedSecret accountKey); + } + /** The stage of the StorageAccountCredential definition allowing to specify connectionString. */ + interface WithConnectionString { + /** + * Specifies the connectionString property: Connection string for the storage account. Use this string if + * username and account key are not specified.. + * + * @param connectionString Connection string for the storage account. Use this string if username and + * account key are not specified. + * @return the next definition stage. + */ + WithCreate withConnectionString(String connectionString); + } + /** The stage of the StorageAccountCredential definition allowing to specify blobDomainName. */ + interface WithBlobDomainName { + /** + * Specifies the blobDomainName property: Blob end point for private clouds.. + * + * @param blobDomainName Blob end point for private clouds. + * @return the next definition stage. + */ + WithCreate withBlobDomainName(String blobDomainName); + } + /** The stage of the StorageAccountCredential definition allowing to specify storageAccountId. */ + interface WithStorageAccountId { + /** + * Specifies the storageAccountId property: Id of the storage account.. + * + * @param storageAccountId Id of the storage account. + * @return the next definition stage. + */ + WithCreate withStorageAccountId(String storageAccountId); + } + } + /** + * Begins update for the StorageAccountCredential resource. + * + * @return the stage of resource update. + */ + StorageAccountCredential.Update update(); + + /** The template for StorageAccountCredential update. */ + interface Update + extends UpdateStages.WithAlias, + UpdateStages.WithUsername, + UpdateStages.WithAccountKey, + UpdateStages.WithConnectionString, + UpdateStages.WithSslStatus, + UpdateStages.WithBlobDomainName, + UpdateStages.WithAccountType, + UpdateStages.WithStorageAccountId { + /** + * Executes the update request. + * + * @return the updated resource. + */ + StorageAccountCredential apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + StorageAccountCredential apply(Context context); + } + /** The StorageAccountCredential update stages. */ + interface UpdateStages { + /** The stage of the StorageAccountCredential update allowing to specify alias. */ + interface WithAlias { + /** + * Specifies the alias property: Alias for the storage account.. + * + * @param alias Alias for the storage account. + * @return the next definition stage. + */ + Update withAlias(String alias); + } + /** The stage of the StorageAccountCredential update allowing to specify username. */ + interface WithUsername { + /** + * Specifies the username property: Username for the storage account.. + * + * @param username Username for the storage account. + * @return the next definition stage. + */ + Update withUsername(String username); + } + /** The stage of the StorageAccountCredential update allowing to specify accountKey. */ + interface WithAccountKey { + /** + * Specifies the accountKey property: Encrypted storage key.. + * + * @param accountKey Encrypted storage key. + * @return the next definition stage. + */ + Update withAccountKey(AsymmetricEncryptedSecret accountKey); + } + /** The stage of the StorageAccountCredential update allowing to specify connectionString. */ + interface WithConnectionString { + /** + * Specifies the connectionString property: Connection string for the storage account. Use this string if + * username and account key are not specified.. + * + * @param connectionString Connection string for the storage account. Use this string if username and + * account key are not specified. + * @return the next definition stage. + */ + Update withConnectionString(String connectionString); + } + /** The stage of the StorageAccountCredential update allowing to specify sslStatus. */ + interface WithSslStatus { + /** + * Specifies the sslStatus property: Signifies whether SSL needs to be enabled or not.. + * + * @param sslStatus Signifies whether SSL needs to be enabled or not. + * @return the next definition stage. + */ + Update withSslStatus(SslStatus sslStatus); + } + /** The stage of the StorageAccountCredential update allowing to specify blobDomainName. */ + interface WithBlobDomainName { + /** + * Specifies the blobDomainName property: Blob end point for private clouds.. + * + * @param blobDomainName Blob end point for private clouds. + * @return the next definition stage. + */ + Update withBlobDomainName(String blobDomainName); + } + /** The stage of the StorageAccountCredential update allowing to specify accountType. */ + interface WithAccountType { + /** + * Specifies the accountType property: Type of storage accessed on the storage account.. + * + * @param accountType Type of storage accessed on the storage account. + * @return the next definition stage. + */ + Update withAccountType(AccountType accountType); + } + /** The stage of the StorageAccountCredential update allowing to specify storageAccountId. */ + interface WithStorageAccountId { + /** + * Specifies the storageAccountId property: Id of the storage account.. + * + * @param storageAccountId Id of the storage account. + * @return the next definition stage. + */ + Update withStorageAccountId(String storageAccountId); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + StorageAccountCredential refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + StorageAccountCredential refresh(Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountCredentialList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountCredentialList.java new file mode 100644 index 0000000000000..0308118c1e0f9 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountCredentialList.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.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountCredentialInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The collection of storage account credentials. */ +@Immutable +public final class StorageAccountCredentialList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountCredentialList.class); + + /* + * The value. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The value. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to the next set 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/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountCredentials.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountCredentials.java new file mode 100644 index 0000000000000..a2226125b5782 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountCredentials.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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 StorageAccountCredentials. */ +public interface StorageAccountCredentials { + /** + * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the storage account credentials in a Data Box Edge/Data Box Gateway device. + */ + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + + /** + * Gets all the storage account credentials in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the storage account credentials in a Data Box Edge/Data Box Gateway device. + */ + PagedIterable listByDataBoxEdgeDevice( + String deviceName, String resourceGroupName, Context context); + + /** + * Gets the properties of the specified storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified storage account credential. + */ + StorageAccountCredential get(String deviceName, String name, String resourceGroupName); + + /** + * Gets the properties of the specified storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified storage account credential. + */ + Response getWithResponse( + String deviceName, String name, String resourceGroupName, Context context); + + /** + * Deletes the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String name, String resourceGroupName); + + /** + * Deletes the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String name, String resourceGroupName, Context context); + + /** + * Gets the properties of the specified storage account credential. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified storage account credential. + */ + StorageAccountCredential getById(String id); + + /** + * Gets the properties of the specified storage account credential. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified storage account credential. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the storage account credential. + * + * @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 storage account credential. + * + * @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 StorageAccountCredential resource. + * + * @param name resource name. + * @return the first stage of the new StorageAccountCredential definition. + */ + StorageAccountCredential.DefinitionStages.Blank define(String name); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountList.java new file mode 100644 index 0000000000000..ed696b7937358 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountList.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.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.models.StorageAccountInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of all the Storage Accounts on the Data Box Edge/Gateway device. */ +@Immutable +public final class StorageAccountList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccountList.class); + + /* + * The list of storageAccounts. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of storageAccounts. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to the next set 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/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountStatus.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountStatus.java new file mode 100644 index 0000000000000..6bb2ec2449472 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccountStatus.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for StorageAccountStatus. */ +public final class StorageAccountStatus extends ExpandableStringEnum { + /** Static value OK for StorageAccountStatus. */ + public static final StorageAccountStatus OK = fromString("OK"); + + /** Static value Offline for StorageAccountStatus. */ + public static final StorageAccountStatus OFFLINE = fromString("Offline"); + + /** Static value Unknown for StorageAccountStatus. */ + public static final StorageAccountStatus UNKNOWN = fromString("Unknown"); + + /** Static value Updating for StorageAccountStatus. */ + public static final StorageAccountStatus UPDATING = fromString("Updating"); + + /** Static value NeedsAttention for StorageAccountStatus. */ + public static final StorageAccountStatus NEEDS_ATTENTION = fromString("NeedsAttention"); + + /** + * Creates or finds a StorageAccountStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding StorageAccountStatus. + */ + @JsonCreator + public static StorageAccountStatus fromString(String name) { + return fromString(name, StorageAccountStatus.class); + } + + /** @return known StorageAccountStatus values. */ + public static Collection values() { + return values(StorageAccountStatus.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccounts.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccounts.java new file mode 100644 index 0000000000000..b0697bb7f8396 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/StorageAccounts.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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 { + /** + * Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the Storage Accounts on the Data Box Edge/Gateway device. + */ + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + + /** + * Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all the Storage Accounts on the Data Box Edge/Gateway device. + */ + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName, Context context); + + /** + * Gets a StorageAccount by name. + * + * @param deviceName The device name. + * @param storageAccountName The storage account name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 StorageAccount by name. + */ + StorageAccount get(String deviceName, String storageAccountName, String resourceGroupName); + + /** + * Gets a StorageAccount by name. + * + * @param deviceName The device name. + * @param storageAccountName The storage account name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 StorageAccount by name. + */ + Response getWithResponse( + String deviceName, String storageAccountName, String resourceGroupName, Context context); + + /** + * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String storageAccountName, String resourceGroupName); + + /** + * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param storageAccountName The StorageAccount name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String storageAccountName, String resourceGroupName, Context context); + + /** + * Gets a StorageAccount by 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. + * @return a StorageAccount by name. + */ + StorageAccount getById(String id); + + /** + * Gets a StorageAccount by 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. + * @return a StorageAccount by name. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + * + * @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 StorageAccount on the Data Box Edge/Data Box Gateway device. + * + * @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 StorageAccount resource. + * + * @param name resource name. + * @return the first stage of the new StorageAccount definition. + */ + StorageAccount.DefinitionStages.Blank define(String name); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SymmetricKey.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SymmetricKey.java new file mode 100644 index 0000000000000..d9ac4ba1befdd --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/SymmetricKey.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.databoxedge.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; + +/** Symmetric key for authentication. */ +@Fluent +public final class SymmetricKey { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SymmetricKey.class); + + /* + * Connection string based on the symmetric key. + */ + @JsonProperty(value = "connectionString") + private AsymmetricEncryptedSecret connectionString; + + /** + * Get the connectionString property: Connection string based on the symmetric key. + * + * @return the connectionString value. + */ + public AsymmetricEncryptedSecret connectionString() { + return this.connectionString; + } + + /** + * Set the connectionString property: Connection string based on the symmetric key. + * + * @param connectionString the connectionString value to set. + * @return the SymmetricKey object itself. + */ + public SymmetricKey withConnectionString(AsymmetricEncryptedSecret connectionString) { + this.connectionString = connectionString; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connectionString() != null) { + connectionString().validate(); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/TimeGrain.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/TimeGrain.java new file mode 100644 index 0000000000000..ea705bc75a6db --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/TimeGrain.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TimeGrain. */ +public final class TimeGrain extends ExpandableStringEnum { + /** Static value PT1M for TimeGrain. */ + public static final TimeGrain PT1M = fromString("PT1M"); + + /** Static value PT5M for TimeGrain. */ + public static final TimeGrain PT5M = fromString("PT5M"); + + /** Static value PT15M for TimeGrain. */ + public static final TimeGrain PT15M = fromString("PT15M"); + + /** Static value PT30M for TimeGrain. */ + public static final TimeGrain PT30M = fromString("PT30M"); + + /** Static value PT1H for TimeGrain. */ + public static final TimeGrain PT1H = fromString("PT1H"); + + /** Static value PT6H for TimeGrain. */ + public static final TimeGrain PT6H = fromString("PT6H"); + + /** Static value PT12H for TimeGrain. */ + public static final TimeGrain PT12H = fromString("PT12H"); + + /** Static value PT1D for TimeGrain. */ + public static final TimeGrain PT1D = fromString("PT1D"); + + /** + * Creates or finds a TimeGrain from its string representation. + * + * @param name a name to look for. + * @return the corresponding TimeGrain. + */ + @JsonCreator + public static TimeGrain fromString(String name) { + return fromString(name, TimeGrain.class); + } + + /** @return known TimeGrain values. */ + public static Collection values() { + return values(TimeGrain.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/TrackingInfo.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/TrackingInfo.java new file mode 100644 index 0000000000000..478a395811576 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/TrackingInfo.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.databoxedge.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; + +/** Tracking courier information. */ +@Fluent +public final class TrackingInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TrackingInfo.class); + + /* + * Serial number of the device being tracked. + */ + @JsonProperty(value = "serialNumber") + private String serialNumber; + + /* + * Name of the carrier used in the delivery. + */ + @JsonProperty(value = "carrierName") + private String carrierName; + + /* + * Tracking ID of the shipment. + */ + @JsonProperty(value = "trackingId") + private String trackingId; + + /* + * Tracking URL of the shipment. + */ + @JsonProperty(value = "trackingUrl") + private String trackingUrl; + + /** + * Get the serialNumber property: Serial number of the device being tracked. + * + * @return the serialNumber value. + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Set the serialNumber property: Serial number of the device being tracked. + * + * @param serialNumber the serialNumber value to set. + * @return the TrackingInfo object itself. + */ + public TrackingInfo withSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** + * Get the carrierName property: Name of the carrier used in the delivery. + * + * @return the carrierName value. + */ + public String carrierName() { + return this.carrierName; + } + + /** + * Set the carrierName property: Name of the carrier used in the delivery. + * + * @param carrierName the carrierName value to set. + * @return the TrackingInfo object itself. + */ + public TrackingInfo withCarrierName(String carrierName) { + this.carrierName = carrierName; + return this; + } + + /** + * Get the trackingId property: Tracking ID of the shipment. + * + * @return the trackingId value. + */ + public String trackingId() { + return this.trackingId; + } + + /** + * Set the trackingId property: Tracking ID of the shipment. + * + * @param trackingId the trackingId value to set. + * @return the TrackingInfo object itself. + */ + public TrackingInfo withTrackingId(String trackingId) { + this.trackingId = trackingId; + return this; + } + + /** + * Get the trackingUrl property: Tracking URL of the shipment. + * + * @return the trackingUrl value. + */ + public String trackingUrl() { + return this.trackingUrl; + } + + /** + * Set the trackingUrl property: Tracking URL of the shipment. + * + * @param trackingUrl the trackingUrl value to set. + * @return the TrackingInfo object itself. + */ + public TrackingInfo withTrackingUrl(String trackingUrl) { + this.trackingUrl = trackingUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Trigger.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Trigger.java new file mode 100644 index 0000000000000..a05d1d29d3083 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Trigger.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.resourcemanager.databoxedge.fluent.models.TriggerInner; + +/** An immutable client-side representation of Trigger. */ +public interface Trigger { + /** + * 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 inner com.azure.resourcemanager.databoxedge.fluent.models.TriggerInner object. + * + * @return the inner object. + */ + TriggerInner innerModel(); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/TriggerEventType.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/TriggerEventType.java new file mode 100644 index 0000000000000..f0c3d610b17dc --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/TriggerEventType.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TriggerEventType. */ +public final class TriggerEventType extends ExpandableStringEnum { + /** Static value FileEvent for TriggerEventType. */ + public static final TriggerEventType FILE_EVENT = fromString("FileEvent"); + + /** Static value PeriodicTimerEvent for TriggerEventType. */ + public static final TriggerEventType PERIODIC_TIMER_EVENT = fromString("PeriodicTimerEvent"); + + /** + * Creates or finds a TriggerEventType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TriggerEventType. + */ + @JsonCreator + public static TriggerEventType fromString(String name) { + return fromString(name, TriggerEventType.class); + } + + /** @return known TriggerEventType values. */ + public static Collection values() { + return values(TriggerEventType.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/TriggerList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/TriggerList.java new file mode 100644 index 0000000000000..4a284f498fff2 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/TriggerList.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.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.models.TriggerInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of all trigger on the data box edge device. */ +@Immutable +public final class TriggerList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TriggerList.class); + + /* + * The list of triggers. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of triggers. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to the next set 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/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Triggers.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Triggers.java new file mode 100644 index 0000000000000..d41f8fc623d3e --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Triggers.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.databoxedge.fluent.models.TriggerInner; + +/** Resource collection API of Triggers. */ +public interface Triggers { + /** + * Lists all the triggers configured in the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all trigger on the data box edge device. + */ + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + + /** + * Lists all the triggers configured in the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param filter Specify $filter='CustomContextTag eq <tag>' to filter on custom context tag property. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of all trigger on the data box edge device. + */ + PagedIterable listByDataBoxEdgeDevice( + String deviceName, String resourceGroupName, String filter, Context context); + + /** + * Get a specific trigger by name. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 specific trigger by name. + */ + Trigger get(String deviceName, String name, String resourceGroupName); + + /** + * Get a specific trigger by name. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 specific trigger by name. + */ + Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); + + /** + * Creates or updates a trigger. + * + * @param deviceName Creates or updates a trigger. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param trigger The trigger. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return trigger details. + */ + Trigger createOrUpdate(String deviceName, String name, String resourceGroupName, TriggerInner trigger); + + /** + * Creates or updates a trigger. + * + * @param deviceName Creates or updates a trigger. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param trigger The trigger. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return trigger details. + */ + Trigger createOrUpdate( + String deviceName, String name, String resourceGroupName, TriggerInner trigger, Context context); + + /** + * Deletes the trigger on the gateway device. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String name, String resourceGroupName); + + /** + * Deletes the trigger on the gateway device. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String name, String resourceGroupName, Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateDownloadProgress.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateDownloadProgress.java new file mode 100644 index 0000000000000..f33974ea89e28 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateDownloadProgress.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.databoxedge.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; + +/** Details about the download progress of update. */ +@Immutable +public final class UpdateDownloadProgress { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateDownloadProgress.class); + + /* + * The download phase. + */ + @JsonProperty(value = "downloadPhase", access = JsonProperty.Access.WRITE_ONLY) + private DownloadPhase downloadPhase; + + /* + * Percentage of completion. + */ + @JsonProperty(value = "percentComplete", access = JsonProperty.Access.WRITE_ONLY) + private Integer percentComplete; + + /* + * Total bytes to download. + */ + @JsonProperty(value = "totalBytesToDownload", access = JsonProperty.Access.WRITE_ONLY) + private Double totalBytesToDownload; + + /* + * Total bytes downloaded. + */ + @JsonProperty(value = "totalBytesDownloaded", access = JsonProperty.Access.WRITE_ONLY) + private Double totalBytesDownloaded; + + /* + * Number of updates to download. + */ + @JsonProperty(value = "numberOfUpdatesToDownload", access = JsonProperty.Access.WRITE_ONLY) + private Integer numberOfUpdatesToDownload; + + /* + * Number of updates downloaded. + */ + @JsonProperty(value = "numberOfUpdatesDownloaded", access = JsonProperty.Access.WRITE_ONLY) + private Integer numberOfUpdatesDownloaded; + + /** + * Get the downloadPhase property: The download phase. + * + * @return the downloadPhase value. + */ + public DownloadPhase downloadPhase() { + return this.downloadPhase; + } + + /** + * Get the percentComplete property: Percentage of completion. + * + * @return the percentComplete value. + */ + public Integer percentComplete() { + return this.percentComplete; + } + + /** + * Get the totalBytesToDownload property: Total bytes to download. + * + * @return the totalBytesToDownload value. + */ + public Double totalBytesToDownload() { + return this.totalBytesToDownload; + } + + /** + * Get the totalBytesDownloaded property: Total bytes downloaded. + * + * @return the totalBytesDownloaded value. + */ + public Double totalBytesDownloaded() { + return this.totalBytesDownloaded; + } + + /** + * Get the numberOfUpdatesToDownload property: Number of updates to download. + * + * @return the numberOfUpdatesToDownload value. + */ + public Integer numberOfUpdatesToDownload() { + return this.numberOfUpdatesToDownload; + } + + /** + * Get the numberOfUpdatesDownloaded property: Number of updates downloaded. + * + * @return the numberOfUpdatesDownloaded value. + */ + public Integer numberOfUpdatesDownloaded() { + return this.numberOfUpdatesDownloaded; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateInstallProgress.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateInstallProgress.java new file mode 100644 index 0000000000000..e909e17a07533 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateInstallProgress.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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; + +/** Progress details during installation of updates. */ +@Immutable +public final class UpdateInstallProgress { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateInstallProgress.class); + + /* + * Percentage completed. + */ + @JsonProperty(value = "percentComplete", access = JsonProperty.Access.WRITE_ONLY) + private Integer percentComplete; + + /* + * Number of updates to install. + */ + @JsonProperty(value = "numberOfUpdatesToInstall", access = JsonProperty.Access.WRITE_ONLY) + private Integer numberOfUpdatesToInstall; + + /* + * Number of updates installed. + */ + @JsonProperty(value = "numberOfUpdatesInstalled", access = JsonProperty.Access.WRITE_ONLY) + private Integer numberOfUpdatesInstalled; + + /** + * Get the percentComplete property: Percentage completed. + * + * @return the percentComplete value. + */ + public Integer percentComplete() { + return this.percentComplete; + } + + /** + * Get the numberOfUpdatesToInstall property: Number of updates to install. + * + * @return the numberOfUpdatesToInstall value. + */ + public Integer numberOfUpdatesToInstall() { + return this.numberOfUpdatesToInstall; + } + + /** + * Get the numberOfUpdatesInstalled property: Number of updates installed. + * + * @return the numberOfUpdatesInstalled value. + */ + public Integer numberOfUpdatesInstalled() { + return this.numberOfUpdatesInstalled; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateOperation.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateOperation.java new file mode 100644 index 0000000000000..5025e0f6fa825 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateOperation.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for UpdateOperation. */ +public final class UpdateOperation extends ExpandableStringEnum { + /** Static value None for UpdateOperation. */ + public static final UpdateOperation NONE = fromString("None"); + + /** Static value Scan for UpdateOperation. */ + public static final UpdateOperation SCAN = fromString("Scan"); + + /** Static value Download for UpdateOperation. */ + public static final UpdateOperation DOWNLOAD = fromString("Download"); + + /** Static value Install for UpdateOperation. */ + public static final UpdateOperation INSTALL = fromString("Install"); + + /** + * Creates or finds a UpdateOperation from its string representation. + * + * @param name a name to look for. + * @return the corresponding UpdateOperation. + */ + @JsonCreator + public static UpdateOperation fromString(String name) { + return fromString(name, UpdateOperation.class); + } + + /** @return known UpdateOperation values. */ + public static Collection values() { + return values(UpdateOperation.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateOperationStage.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateOperationStage.java new file mode 100644 index 0000000000000..29f7dd1798888 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateOperationStage.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for UpdateOperationStage. */ +public final class UpdateOperationStage extends ExpandableStringEnum { + /** Static value Unknown for UpdateOperationStage. */ + public static final UpdateOperationStage UNKNOWN = fromString("Unknown"); + + /** Static value Initial for UpdateOperationStage. */ + public static final UpdateOperationStage INITIAL = fromString("Initial"); + + /** Static value ScanStarted for UpdateOperationStage. */ + public static final UpdateOperationStage SCAN_STARTED = fromString("ScanStarted"); + + /** Static value ScanComplete for UpdateOperationStage. */ + public static final UpdateOperationStage SCAN_COMPLETE = fromString("ScanComplete"); + + /** Static value ScanFailed for UpdateOperationStage. */ + public static final UpdateOperationStage SCAN_FAILED = fromString("ScanFailed"); + + /** Static value DownloadStarted for UpdateOperationStage. */ + public static final UpdateOperationStage DOWNLOAD_STARTED = fromString("DownloadStarted"); + + /** Static value DownloadComplete for UpdateOperationStage. */ + public static final UpdateOperationStage DOWNLOAD_COMPLETE = fromString("DownloadComplete"); + + /** Static value DownloadFailed for UpdateOperationStage. */ + public static final UpdateOperationStage DOWNLOAD_FAILED = fromString("DownloadFailed"); + + /** Static value InstallStarted for UpdateOperationStage. */ + public static final UpdateOperationStage INSTALL_STARTED = fromString("InstallStarted"); + + /** Static value InstallComplete for UpdateOperationStage. */ + public static final UpdateOperationStage INSTALL_COMPLETE = fromString("InstallComplete"); + + /** Static value InstallFailed for UpdateOperationStage. */ + public static final UpdateOperationStage INSTALL_FAILED = fromString("InstallFailed"); + + /** Static value RebootInitiated for UpdateOperationStage. */ + public static final UpdateOperationStage REBOOT_INITIATED = fromString("RebootInitiated"); + + /** Static value Success for UpdateOperationStage. */ + public static final UpdateOperationStage SUCCESS = fromString("Success"); + + /** Static value Failure for UpdateOperationStage. */ + public static final UpdateOperationStage FAILURE = fromString("Failure"); + + /** Static value RescanStarted for UpdateOperationStage. */ + public static final UpdateOperationStage RESCAN_STARTED = fromString("RescanStarted"); + + /** Static value RescanComplete for UpdateOperationStage. */ + public static final UpdateOperationStage RESCAN_COMPLETE = fromString("RescanComplete"); + + /** Static value RescanFailed for UpdateOperationStage. */ + public static final UpdateOperationStage RESCAN_FAILED = fromString("RescanFailed"); + + /** + * Creates or finds a UpdateOperationStage from its string representation. + * + * @param name a name to look for. + * @return the corresponding UpdateOperationStage. + */ + @JsonCreator + public static UpdateOperationStage fromString(String name) { + return fromString(name, UpdateOperationStage.class); + } + + /** @return known UpdateOperationStage values. */ + public static Collection values() { + return values(UpdateOperationStage.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateSummary.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateSummary.java new file mode 100644 index 0000000000000..0ddca1b351a2d --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UpdateSummary.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.resourcemanager.databoxedge.fluent.models.UpdateSummaryInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of UpdateSummary. */ +public interface UpdateSummary { + /** + * 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 deviceVersionNumber property: The current version of the device in format: 1.2.17312.13.",. + * + * @return the deviceVersionNumber value. + */ + String deviceVersionNumber(); + + /** + * Gets the friendlyDeviceVersionName property: The current version of the device in text format. + * + * @return the friendlyDeviceVersionName value. + */ + String friendlyDeviceVersionName(); + + /** + * Gets the deviceLastScannedDateTime property: The last time when a scan was done on the device. + * + * @return the deviceLastScannedDateTime value. + */ + OffsetDateTime deviceLastScannedDateTime(); + + /** + * Gets the lastCompletedScanJobDateTime property: The time when the last scan job was completed + * (success/cancelled/failed) on the appliance. + * + * @return the lastCompletedScanJobDateTime value. + */ + OffsetDateTime lastCompletedScanJobDateTime(); + + /** + * Gets the lastCompletedDownloadJobDateTime property: The time when the last Download job was completed + * (success/cancelled/failed) on the appliance. + * + * @return the lastCompletedDownloadJobDateTime value. + */ + OffsetDateTime lastCompletedDownloadJobDateTime(); + + /** + * Gets the lastCompletedInstallJobDateTime property: The time when the last Install job was completed + * (success/cancelled/failed) on the appliance. + * + * @return the lastCompletedInstallJobDateTime value. + */ + OffsetDateTime lastCompletedInstallJobDateTime(); + + /** + * Gets the totalNumberOfUpdatesAvailable property: The number of updates available for the current device version + * as per the last device scan. + * + * @return the totalNumberOfUpdatesAvailable value. + */ + Integer totalNumberOfUpdatesAvailable(); + + /** + * Gets the totalNumberOfUpdatesPendingDownload property: The total number of items pending download. + * + * @return the totalNumberOfUpdatesPendingDownload value. + */ + Integer totalNumberOfUpdatesPendingDownload(); + + /** + * Gets the totalNumberOfUpdatesPendingInstall property: The total number of items pending install. + * + * @return the totalNumberOfUpdatesPendingInstall value. + */ + Integer totalNumberOfUpdatesPendingInstall(); + + /** + * Gets the rebootBehavior property: Indicates if updates are available and at least one of the updates needs a + * reboot. + * + * @return the rebootBehavior value. + */ + InstallRebootBehavior rebootBehavior(); + + /** + * Gets the ongoingUpdateOperation property: The current update operation. + * + * @return the ongoingUpdateOperation value. + */ + UpdateOperation ongoingUpdateOperation(); + + /** + * Gets the inProgressDownloadJobId property: The job ID of the download job in progress. + * + * @return the inProgressDownloadJobId value. + */ + String inProgressDownloadJobId(); + + /** + * Gets the inProgressInstallJobId property: The job ID of the install job in progress. + * + * @return the inProgressInstallJobId value. + */ + String inProgressInstallJobId(); + + /** + * Gets the inProgressDownloadJobStartedDateTime property: The time when the currently running download (if any) + * started. + * + * @return the inProgressDownloadJobStartedDateTime value. + */ + OffsetDateTime inProgressDownloadJobStartedDateTime(); + + /** + * Gets the inProgressInstallJobStartedDateTime property: The time when the currently running install (if any) + * started. + * + * @return the inProgressInstallJobStartedDateTime value. + */ + OffsetDateTime inProgressInstallJobStartedDateTime(); + + /** + * Gets the updateTitles property: The list of updates available for install. + * + * @return the updateTitles value. + */ + List updateTitles(); + + /** + * Gets the totalUpdateSizeInBytes property: The total size of updates available for download in bytes. + * + * @return the totalUpdateSizeInBytes value. + */ + Double totalUpdateSizeInBytes(); + + /** + * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.UpdateSummaryInner object. + * + * @return the inner object. + */ + UpdateSummaryInner innerModel(); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UploadCertificateRequest.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UploadCertificateRequest.java new file mode 100644 index 0000000000000..4bc42a44682e9 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UploadCertificateRequest.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.databoxedge.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 upload certificate request. */ +@JsonFlatten +@Fluent +public class UploadCertificateRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UploadCertificateRequest.class); + + /* + * The authentication type. + */ + @JsonProperty(value = "properties.authenticationType") + private AuthenticationType authenticationType; + + /* + * The base64 encoded certificate raw data. + */ + @JsonProperty(value = "properties.certificate", required = true) + private String certificate; + + /** + * Get the authenticationType property: The authentication type. + * + * @return the authenticationType value. + */ + public AuthenticationType authenticationType() { + return this.authenticationType; + } + + /** + * Set the authenticationType property: The authentication type. + * + * @param authenticationType the authenticationType value to set. + * @return the UploadCertificateRequest object itself. + */ + public UploadCertificateRequest withAuthenticationType(AuthenticationType authenticationType) { + this.authenticationType = authenticationType; + return this; + } + + /** + * Get the certificate property: The base64 encoded certificate raw data. + * + * @return the certificate value. + */ + public String certificate() { + return this.certificate; + } + + /** + * Set the certificate property: The base64 encoded certificate raw data. + * + * @param certificate the certificate value to set. + * @return the UploadCertificateRequest object itself. + */ + public UploadCertificateRequest withCertificate(String certificate) { + this.certificate = certificate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (certificate() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property certificate in model UploadCertificateRequest")); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UploadCertificateResponse.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UploadCertificateResponse.java new file mode 100644 index 0000000000000..91b41978e9220 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UploadCertificateResponse.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.resourcemanager.databoxedge.fluent.models.UploadCertificateResponseInner; + +/** An immutable client-side representation of UploadCertificateResponse. */ +public interface UploadCertificateResponse { + /** + * Gets the authType property: Specifies authentication type. + * + * @return the authType value. + */ + AuthenticationType authType(); + + /** + * Gets the resourceId property: The resource ID of the Data Box Edge/Gateway device. + * + * @return the resourceId value. + */ + String resourceId(); + + /** + * Gets the aadAuthority property: Azure Active Directory tenant authority. + * + * @return the aadAuthority value. + */ + String aadAuthority(); + + /** + * Gets the aadTenantId property: Azure Active Directory tenant ID. + * + * @return the aadTenantId value. + */ + String aadTenantId(); + + /** + * Gets the servicePrincipalClientId property: Azure Active Directory service principal client ID. + * + * @return the servicePrincipalClientId value. + */ + String servicePrincipalClientId(); + + /** + * Gets the servicePrincipalObjectId property: Azure Active Directory service principal object ID. + * + * @return the servicePrincipalObjectId value. + */ + String servicePrincipalObjectId(); + + /** + * Gets the azureManagementEndpointAudience property: The azure management endpoint audience. + * + * @return the azureManagementEndpointAudience value. + */ + String azureManagementEndpointAudience(); + + /** + * Gets the aadAudience property: Identifier of the target resource that is the recipient of the requested token. + * + * @return the aadAudience value. + */ + String aadAudience(); + + /** + * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.UploadCertificateResponseInner object. + * + * @return the inner object. + */ + UploadCertificateResponseInner innerModel(); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/User.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/User.java new file mode 100644 index 0000000000000..1630b85106288 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/User.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.databoxedge.fluent.models.UserInner; +import java.util.List; + +/** An immutable client-side representation of User. */ +public interface User { + /** + * 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 encryptedPassword property: The password details. + * + * @return the encryptedPassword value. + */ + AsymmetricEncryptedSecret encryptedPassword(); + + /** + * Gets the shareAccessRights property: List of shares that the user has rights on. This field should not be + * specified during user creation. + * + * @return the shareAccessRights value. + */ + List shareAccessRights(); + + /** + * Gets the userType property: Type of the user. + * + * @return the userType value. + */ + UserType userType(); + + /** + * Gets the inner com.azure.resourcemanager.databoxedge.fluent.models.UserInner object. + * + * @return the inner object. + */ + UserInner innerModel(); + + /** The entirety of the User definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithUserType, + DefinitionStages.WithCreate { + } + /** The User definition stages. */ + interface DefinitionStages { + /** The first stage of the User definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the User definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies deviceName, resourceGroupName. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @return the next definition stage. + */ + WithUserType withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName); + } + /** The stage of the User definition allowing to specify userType. */ + interface WithUserType { + /** + * Specifies the userType property: Type of the user.. + * + * @param userType Type of the user. + * @return the next definition stage. + */ + WithCreate withUserType(UserType userType); + } + /** + * The stage of the User 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.WithEncryptedPassword, DefinitionStages.WithShareAccessRights { + /** + * Executes the create request. + * + * @return the created resource. + */ + User create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + User create(Context context); + } + /** The stage of the User definition allowing to specify encryptedPassword. */ + interface WithEncryptedPassword { + /** + * Specifies the encryptedPassword property: The password details.. + * + * @param encryptedPassword The password details. + * @return the next definition stage. + */ + WithCreate withEncryptedPassword(AsymmetricEncryptedSecret encryptedPassword); + } + /** The stage of the User definition allowing to specify shareAccessRights. */ + interface WithShareAccessRights { + /** + * Specifies the shareAccessRights property: List of shares that the user has rights on. This field should + * not be specified during user creation.. + * + * @param shareAccessRights List of shares that the user has rights on. This field should not be specified + * during user creation. + * @return the next definition stage. + */ + WithCreate withShareAccessRights(List shareAccessRights); + } + } + /** + * Begins update for the User resource. + * + * @return the stage of resource update. + */ + User.Update update(); + + /** The template for User update. */ + interface Update + extends UpdateStages.WithEncryptedPassword, UpdateStages.WithShareAccessRights, UpdateStages.WithUserType { + /** + * Executes the update request. + * + * @return the updated resource. + */ + User apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + User apply(Context context); + } + /** The User update stages. */ + interface UpdateStages { + /** The stage of the User update allowing to specify encryptedPassword. */ + interface WithEncryptedPassword { + /** + * Specifies the encryptedPassword property: The password details.. + * + * @param encryptedPassword The password details. + * @return the next definition stage. + */ + Update withEncryptedPassword(AsymmetricEncryptedSecret encryptedPassword); + } + /** The stage of the User update allowing to specify shareAccessRights. */ + interface WithShareAccessRights { + /** + * Specifies the shareAccessRights property: List of shares that the user has rights on. This field should + * not be specified during user creation.. + * + * @param shareAccessRights List of shares that the user has rights on. This field should not be specified + * during user creation. + * @return the next definition stage. + */ + Update withShareAccessRights(List shareAccessRights); + } + /** The stage of the User update allowing to specify userType. */ + interface WithUserType { + /** + * Specifies the userType property: Type of the user.. + * + * @param userType Type of the user. + * @return the next definition stage. + */ + Update withUserType(UserType userType); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + User refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + User refresh(Context context); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UserAccessRight.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UserAccessRight.java new file mode 100644 index 0000000000000..c6c1af09d9438 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UserAccessRight.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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 mapping between a particular user and the access type on the SMB share. */ +@Fluent +public final class UserAccessRight { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserAccessRight.class); + + /* + * User ID (already existing in the device). + */ + @JsonProperty(value = "userId", required = true) + private String userId; + + /* + * Type of access to be allowed for the user. + */ + @JsonProperty(value = "accessType", required = true) + private ShareAccessType accessType; + + /** + * Get the userId property: User ID (already existing in the device). + * + * @return the userId value. + */ + public String userId() { + return this.userId; + } + + /** + * Set the userId property: User ID (already existing in the device). + * + * @param userId the userId value to set. + * @return the UserAccessRight object itself. + */ + public UserAccessRight withUserId(String userId) { + this.userId = userId; + return this; + } + + /** + * Get the accessType property: Type of access to be allowed for the user. + * + * @return the accessType value. + */ + public ShareAccessType accessType() { + return this.accessType; + } + + /** + * Set the accessType property: Type of access to be allowed for the user. + * + * @param accessType the accessType value to set. + * @return the UserAccessRight object itself. + */ + public UserAccessRight withAccessType(ShareAccessType accessType) { + this.accessType = accessType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property userId in model UserAccessRight")); + } + if (accessType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property accessType in model UserAccessRight")); + } + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UserList.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UserList.java new file mode 100644 index 0000000000000..39b933cc30758 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UserList.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.databoxedge.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databoxedge.fluent.models.UserInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of users. */ +@Immutable +public final class UserList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserList.class); + + /* + * The list of users. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of users. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to the next set 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/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UserType.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UserType.java new file mode 100644 index 0000000000000..181533d3bef82 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/UserType.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.databoxedge.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for UserType. */ +public final class UserType extends ExpandableStringEnum { + /** Static value Share for UserType. */ + public static final UserType SHARE = fromString("Share"); + + /** Static value LocalManagement for UserType. */ + public static final UserType LOCAL_MANAGEMENT = fromString("LocalManagement"); + + /** Static value ARM for UserType. */ + public static final UserType ARM = fromString("ARM"); + + /** + * Creates or finds a UserType from its string representation. + * + * @param name a name to look for. + * @return the corresponding UserType. + */ + @JsonCreator + public static UserType fromString(String name) { + return fromString(name, UserType.class); + } + + /** @return known UserType values. */ + public static Collection values() { + return values(UserType.class); + } +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Users.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Users.java new file mode 100644 index 0000000000000..cf8ed029cdf99 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/Users.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databoxedge.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 Users. */ +public interface Users { + /** + * Gets all the users registered on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the users registered on a Data Box Edge/Data Box Gateway device. + */ + PagedIterable listByDataBoxEdgeDevice(String deviceName, String resourceGroupName); + + /** + * Gets all the users registered on a Data Box Edge/Data Box Gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param filter Specify $filter='UserType eq <type>' to filter on user type property. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the users registered on a Data Box Edge/Data Box Gateway device. + */ + PagedIterable listByDataBoxEdgeDevice( + String deviceName, String resourceGroupName, String filter, Context context); + + /** + * Gets the properties of the specified user. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified user. + */ + User get(String deviceName, String name, String resourceGroupName); + + /** + * Gets the properties of the specified user. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified user. + */ + Response getWithResponse(String deviceName, String name, String resourceGroupName, Context context); + + /** + * Deletes the user on a databox edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String name, String resourceGroupName); + + /** + * Deletes the user on a databox edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deviceName, String name, String resourceGroupName, Context context); + + /** + * Gets the properties of the specified user. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified user. + */ + User getById(String id); + + /** + * Gets the properties of the specified user. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified user. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the user on a databox edge/gateway device. + * + * @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 user on a databox edge/gateway device. + * + * @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 User resource. + * + * @param name resource name. + * @return the first stage of the new User definition. + */ + User.DefinitionStages.Blank define(String name); +} diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/package-info.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/package-info.java new file mode 100644 index 0000000000000..49fd4cae7e80a --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for DataBoxEdgeManagementClient. null. */ +package com.azure.resourcemanager.databoxedge.models; diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/package-info.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/package-info.java new file mode 100644 index 0000000000000..5ef1d63170eeb --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for DataBoxEdgeManagementClient. null. */ +package com.azure.resourcemanager.databoxedge; diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/module-info.java b/sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/module-info.java new file mode 100644 index 0000000000000..09f3799a63709 --- /dev/null +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/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.databoxedge { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.databoxedge; + exports com.azure.resourcemanager.databoxedge.fluent; + exports com.azure.resourcemanager.databoxedge.fluent.models; + exports com.azure.resourcemanager.databoxedge.models; + + opens com.azure.resourcemanager.databoxedge.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.databoxedge.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/databoxedge/ci.yml b/sdk/databoxedge/ci.yml new file mode 100644 index 0000000000000..a4ce20b278737 --- /dev/null +++ b/sdk/databoxedge/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/databoxedge/ + +pr: + branches: + include: + - master + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/databoxedge/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: databoxedge + Artifacts: + - name: azure-resourcemanager-databoxedge + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerdataboxedge diff --git a/sdk/databoxedge/pom.xml b/sdk/databoxedge/pom.xml new file mode 100644 index 0000000000000..373139a3757f4 --- /dev/null +++ b/sdk/databoxedge/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-databoxedge-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-databoxedge + + + +