diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 7b1540684f26..73f8d6912c79 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -219,6 +219,7 @@ com.azure.resourcemanager:azure-resourcemanager-kubernetesconfiguration;1.0.0-be com.azure.resourcemanager:azure-resourcemanager-resourcegraph;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-changeanalysis;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-delegatednetwork;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-datamigration;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 5c5f884ed387..b47f0aa77334 100644 --- a/pom.xml +++ b/pom.xml @@ -667,6 +667,7 @@ sdk/cosmos sdk/costmanagement sdk/datadog + sdk/datamigration sdk/delegatednetwork sdk/deviceupdate sdk/digitaltwins diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/CHANGELOG.md b/sdk/datamigration/azure-resourcemanager-datamigration/CHANGELOG.md new file mode 100644 index 000000000000..92e582fca20e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-03-30) + +- Azure Resource Manager DataMigration client library for Java. This package contains Microsoft Azure SDK for DataMigration Management SDK. Data Migration Client. Package tag package-2018-07-15-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/README.md b/sdk/datamigration/azure-resourcemanager-datamigration/README.md new file mode 100644 index 000000000000..a5885cd82068 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/README.md @@ -0,0 +1,99 @@ +# Azure Resource Manager DataMigration client library for Java + +Azure Resource Manager DataMigration client library for Java. + +This package contains Microsoft Azure SDK for DataMigration Management SDK. Data Migration Client. Package tag package-2018-07-15-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-datamigration;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-datamigration + 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(); +DataMigrationManager manager = DataMigrationManager + .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/datamigration/azure-resourcemanager-datamigration/pom.xml b/sdk/datamigration/azure-resourcemanager-datamigration/pom.xml new file mode 100644 index 000000000000..4640cefbbf23 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/pom.xml @@ -0,0 +1,67 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-datamigration + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for DataMigration Management + This package contains Microsoft Azure SDK for DataMigration Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Data Migration Client. Package tag package-2018-07-15-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core + 1.14.1 + + + com.azure + azure-core-management + 1.2.0 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + + diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/DataMigrationManager.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/DataMigrationManager.java new file mode 100644 index 000000000000..8546ff12ec5e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/DataMigrationManager.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.datamigration; + +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.datamigration.fluent.DataMigrationManagementClient; +import com.azure.resourcemanager.datamigration.implementation.DataMigrationManagementClientBuilder; +import com.azure.resourcemanager.datamigration.implementation.FilesImpl; +import com.azure.resourcemanager.datamigration.implementation.OperationsImpl; +import com.azure.resourcemanager.datamigration.implementation.ProjectsImpl; +import com.azure.resourcemanager.datamigration.implementation.ResourceSkusImpl; +import com.azure.resourcemanager.datamigration.implementation.ServiceTasksImpl; +import com.azure.resourcemanager.datamigration.implementation.ServicesImpl; +import com.azure.resourcemanager.datamigration.implementation.TasksImpl; +import com.azure.resourcemanager.datamigration.implementation.UsagesImpl; +import com.azure.resourcemanager.datamigration.models.Files; +import com.azure.resourcemanager.datamigration.models.Operations; +import com.azure.resourcemanager.datamigration.models.Projects; +import com.azure.resourcemanager.datamigration.models.ResourceSkus; +import com.azure.resourcemanager.datamigration.models.ServiceTasks; +import com.azure.resourcemanager.datamigration.models.Services; +import com.azure.resourcemanager.datamigration.models.Tasks; +import com.azure.resourcemanager.datamigration.models.Usages; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to DataMigrationManager. Data Migration Client. */ +public final class DataMigrationManager { + private ResourceSkus resourceSkus; + + private Services services; + + private Tasks tasks; + + private ServiceTasks serviceTasks; + + private Projects projects; + + private Usages usages; + + private Operations operations; + + private Files files; + + private final DataMigrationManagementClient clientObject; + + private DataMigrationManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new DataMigrationManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of DataMigration service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the DataMigration service API instance. + */ + public static DataMigrationManager 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 DataMigrationManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new DataMigrationManager.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 DataMigration service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the DataMigration service API instance. + */ + public DataMigrationManager 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.datamigration") + .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 DataMigrationManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of ResourceSkus. */ + public ResourceSkus resourceSkus() { + if (this.resourceSkus == null) { + this.resourceSkus = new ResourceSkusImpl(clientObject.getResourceSkus(), this); + } + return resourceSkus; + } + + /** @return Resource collection API of Services. */ + public Services services() { + if (this.services == null) { + this.services = new ServicesImpl(clientObject.getServices(), this); + } + return services; + } + + /** @return Resource collection API of Tasks. */ + public Tasks tasks() { + if (this.tasks == null) { + this.tasks = new TasksImpl(clientObject.getTasks(), this); + } + return tasks; + } + + /** @return Resource collection API of ServiceTasks. */ + public ServiceTasks serviceTasks() { + if (this.serviceTasks == null) { + this.serviceTasks = new ServiceTasksImpl(clientObject.getServiceTasks(), this); + } + return serviceTasks; + } + + /** @return Resource collection API of Projects. */ + public Projects projects() { + if (this.projects == null) { + this.projects = new ProjectsImpl(clientObject.getProjects(), this); + } + return projects; + } + + /** @return Resource collection API of Usages. */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(clientObject.getUsages(), this); + } + return usages; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of Files. */ + public Files files() { + if (this.files == null) { + this.files = new FilesImpl(clientObject.getFiles(), this); + } + return files; + } + + /** + * @return Wrapped service client DataMigrationManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public DataMigrationManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DataMigrationManagementClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DataMigrationManagementClient.java new file mode 100644 index 000000000000..94fb3a37b8ea --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/DataMigrationManagementClient.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.datamigration.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for DataMigrationManagementClient class. */ +public interface DataMigrationManagementClient { + /** + * Gets Identifier of the subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the ResourceSkusClient object to access its operations. + * + * @return the ResourceSkusClient object. + */ + ResourceSkusClient getResourceSkus(); + + /** + * Gets the ServicesClient object to access its operations. + * + * @return the ServicesClient object. + */ + ServicesClient getServices(); + + /** + * Gets the TasksClient object to access its operations. + * + * @return the TasksClient object. + */ + TasksClient getTasks(); + + /** + * Gets the ServiceTasksClient object to access its operations. + * + * @return the ServiceTasksClient object. + */ + ServiceTasksClient getServiceTasks(); + + /** + * Gets the ProjectsClient object to access its operations. + * + * @return the ProjectsClient object. + */ + ProjectsClient getProjects(); + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + UsagesClient getUsages(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the FilesClient object to access its operations. + * + * @return the FilesClient object. + */ + FilesClient getFiles(); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/FilesClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/FilesClient.java new file mode 100644 index 000000000000..d278d4bcdba5 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/FilesClient.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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.datamigration.fluent.models.FileStorageInfoInner; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectFileInner; + +/** An instance of this class provides access to all the operations defined in FilesClient. */ +public interface FilesClient { + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String groupName, String serviceName, String projectName); + + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String groupName, String serviceName, String projectName, Context context); + + /** + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectFileInner get(String groupName, String serviceName, String projectName, String fileName); + + /** + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context); + + /** + * The PUT method creates a new file or updates an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectFileInner createOrUpdate( + String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters); + + /** + * The PUT method creates a new file or updates an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String groupName, + String serviceName, + String projectName, + String fileName, + ProjectFileInner parameters, + Context context); + + /** + * This method deletes a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String groupName, String serviceName, String projectName, String fileName); + + /** + * This method deletes a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context); + + /** + * This method updates an existing file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectFileInner update( + String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters); + + /** + * This method updates an existing file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String groupName, + String serviceName, + String projectName, + String fileName, + ProjectFileInner parameters, + Context context); + + /** + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileStorageInfoInner read(String groupName, String serviceName, String projectName, String fileName); + + /** + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response readWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context); + + /** + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileStorageInfoInner readWrite(String groupName, String serviceName, String projectName, String fileName); + + /** + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response readWriteWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/OperationsClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/OperationsClient.java new file mode 100644 index 000000000000..e1b3352421e9 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/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.datamigration.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.datamigration.fluent.models.ServiceOperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all available actions exposed by the Database Migration Service resource provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of action (operation) objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all available actions exposed by the Database Migration Service resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of action (operation) objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ProjectsClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ProjectsClient.java new file mode 100644 index 000000000000..270588b47331 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ProjectsClient.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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.datamigration.fluent.models.ProjectInner; + +/** An instance of this class provides access to all the operations defined in ProjectsClient. */ +public interface ProjectsClient { + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * projects owned by a service resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of project resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String groupName, String serviceName); + + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * projects owned by a service resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of project resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String groupName, String serviceName, Context context); + + /** + * The project resource is a nested resource representing a stored migration project. The PUT method creates a new + * project or updates an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param parameters Information about the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectInner createOrUpdate(String groupName, String serviceName, String projectName, ProjectInner parameters); + + /** + * The project resource is a nested resource representing a stored migration project. The PUT method creates a new + * project or updates an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param parameters Information about the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String groupName, String serviceName, String projectName, ProjectInner parameters, Context context); + + /** + * The project resource is a nested resource representing a stored migration project. The GET method retrieves + * information about a project. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectInner get(String groupName, String serviceName, String projectName); + + /** + * The project resource is a nested resource representing a stored migration project. The GET method retrieves + * information about a project. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String groupName, String serviceName, String projectName, Context context); + + /** + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a + * project. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 groupName, String serviceName, String projectName); + + /** + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a + * project. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String groupName, String serviceName, String projectName, Boolean deleteRunningTasks, Context context); + + /** + * The project resource is a nested resource representing a stored migration project. The PATCH method updates an + * existing project. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param parameters Information about the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectInner update(String groupName, String serviceName, String projectName, ProjectInner parameters); + + /** + * The project resource is a nested resource representing a stored migration project. The PATCH method updates an + * existing project. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param parameters Information about the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String groupName, String serviceName, String projectName, ProjectInner parameters, Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ResourceSkusClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ResourceSkusClient.java new file mode 100644 index 000000000000..9f3b034006b6 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ResourceSkusClient.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.datamigration.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.datamigration.fluent.models.ResourceSkuInner; + +/** An instance of this class provides access to all the operations defined in ResourceSkusClient. */ +public interface ResourceSkusClient { + /** + * The skus action returns the list of SKUs that DMS supports. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DMS List SKUs operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * The skus action returns the list of SKUs that DMS supports. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DMS List SKUs operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ServiceTasksClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ServiceTasksClient.java new file mode 100644 index 000000000000..1a7707fd2929 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ServiceTasksClient.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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.datamigration.fluent.models.ProjectTaskInner; + +/** An instance of this class provides access to all the operations defined in ServiceTasksClient. */ +public interface ServiceTasksClient { + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service level tasks owned by a service resource. Some tasks may have a status of Unknown, which + * indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String groupName, String serviceName); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service level tasks owned by a service resource. Some tasks may have a status of Unknown, which + * indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskType Filter tasks by task type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String groupName, String serviceName, String taskType, Context context); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PUT method creates a new service task or updates an existing one, although since service tasks have no mutable + * custom properties, there is little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectTaskInner createOrUpdate(String groupName, String serviceName, String taskName, ProjectTaskInner parameters); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PUT method creates a new service task or updates an existing one, although since service tasks have no mutable + * custom properties, there is little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters, Context context); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * GET method retrieves information about a service task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectTaskInner get(String groupName, String serviceName, String taskName); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * GET method retrieves information about a service task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param expand Expand the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String groupName, String serviceName, String taskName, String expand, Context context); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * DELETE method deletes a service task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 groupName, String serviceName, String taskName); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * DELETE method deletes a service task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String groupName, String serviceName, String taskName, Boolean deleteRunningTasks, Context context); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there + * is little reason to do so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectTaskInner update(String groupName, String serviceName, String taskName, ProjectTaskInner parameters); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there + * is little reason to do so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters, Context context); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This + * method cancels a service task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectTaskInner cancel(String groupName, String serviceName, String taskName); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This + * method cancels a service task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response cancelWithResponse( + String groupName, String serviceName, String taskName, Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ServicesClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ServicesClient.java new file mode 100644 index 000000000000..a9e15d273c59 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/ServicesClient.java @@ -0,0 +1,565 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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.datamigration.fluent.models.AvailableServiceSkuInner; +import com.azure.resourcemanager.datamigration.fluent.models.DataMigrationServiceInner; +import com.azure.resourcemanager.datamigration.fluent.models.DataMigrationServiceStatusResponseInner; +import com.azure.resourcemanager.datamigration.fluent.models.NameAvailabilityResponseInner; +import com.azure.resourcemanager.datamigration.models.NameAvailabilityRequest; + +/** An instance of this class provides access to all the operations defined in ServicesClient. */ +public interface ServicesClient { + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PUT method + * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. + * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, + * although other kinds may be added in the future. This method can change the kind, SKU, and network of the + * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations + * use the provisioningState property. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataMigrationServiceInner> beginCreateOrUpdate( + String groupName, String serviceName, DataMigrationServiceInner parameters); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PUT method + * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. + * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, + * although other kinds may be added in the future. This method can change the kind, SKU, and network of the + * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations + * use the provisioningState property. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataMigrationServiceInner> beginCreateOrUpdate( + String groupName, String serviceName, DataMigrationServiceInner parameters, Context context); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PUT method + * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. + * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, + * although other kinds may be added in the future. This method can change the kind, SKU, and network of the + * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations + * use the provisioningState property. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataMigrationServiceInner createOrUpdate( + String groupName, String serviceName, DataMigrationServiceInner parameters); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PUT method + * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. + * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, + * although other kinds may be added in the future. This method can change the kind, SKU, and network of the + * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations + * use the provisioningState property. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataMigrationServiceInner createOrUpdate( + String groupName, String serviceName, DataMigrationServiceInner parameters, Context context); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The GET method + * retrieves information about a service instance. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataMigrationServiceInner getByResourceGroup(String groupName, String serviceName); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The GET method + * retrieves information about a service instance. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String groupName, String serviceName, Context context); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method + * deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 groupName, String serviceName, Boolean deleteRunningTasks); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method + * deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 groupName, String serviceName, Boolean deleteRunningTasks, Context context); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method + * deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 groupName, String serviceName, Boolean deleteRunningTasks); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method + * deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String groupName, String serviceName); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method + * deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 groupName, String serviceName, Boolean deleteRunningTasks, Context context); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method + * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are + * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataMigrationServiceInner> beginUpdate( + String groupName, String serviceName, DataMigrationServiceInner parameters); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method + * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are + * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DataMigrationServiceInner> beginUpdate( + String groupName, String serviceName, DataMigrationServiceInner parameters, Context context); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method + * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are + * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataMigrationServiceInner update(String groupName, String serviceName, DataMigrationServiceInner parameters); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method + * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are + * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataMigrationServiceInner update( + String groupName, String serviceName, DataMigrationServiceInner parameters, Context context); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * performs a health check and returns the status of the service and virtual machine size. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service health status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataMigrationServiceStatusResponseInner checkStatus(String groupName, String serviceName); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * performs a health check and returns the status of the service and virtual machine size. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service health status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkStatusWithResponse( + String groupName, String serviceName, Context context); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStart(String groupName, String serviceName); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStart(String groupName, String serviceName, Context context); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String groupName, String serviceName); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String groupName, String serviceName, Context context); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action stops + * the service and the service cannot be used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStop(String groupName, String serviceName); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action stops + * the service and the service cannot be used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStop(String groupName, String serviceName, Context context); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action stops + * the service and the service cannot be used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String groupName, String serviceName); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action stops + * the service and the service cannot be used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String groupName, String serviceName, Context context); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The skus action + * returns the list of SKUs that a service resource can be updated to. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of available SKUs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSkus(String groupName, String serviceName); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The skus action + * returns the list of SKUs that a service resource can be updated to. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of available SKUs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSkus(String groupName, String serviceName, Context context); + + /** + * This method checks whether a proposed nested resource name is valid and available. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Requested name to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return indicates whether a proposed resource name is available. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NameAvailabilityResponseInner checkChildrenNameAvailability( + String groupName, String serviceName, NameAvailabilityRequest parameters); + + /** + * This method checks whether a proposed nested resource name is valid and available. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Requested name to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return indicates whether a proposed resource name is available. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkChildrenNameAvailabilityWithResponse( + String groupName, String serviceName, NameAvailabilityRequest parameters, Context context); + + /** + * The Services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service resources in a resource group. + * + * @param groupName Name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of service objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String groupName); + + /** + * The Services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service resources in a resource group. + * + * @param groupName Name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of service objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String groupName, Context context); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service resources 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 oData page of service objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of service objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * This method checks whether a proposed top-level resource name is valid and available. + * + * @param location The Azure region of the operation. + * @param parameters Requested name to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return indicates whether a proposed resource name is available. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NameAvailabilityResponseInner checkNameAvailability(String location, NameAvailabilityRequest parameters); + + /** + * This method checks whether a proposed top-level resource name is valid and available. + * + * @param location The Azure region of the operation. + * @param parameters Requested name to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return indicates whether a proposed resource name is available. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String location, NameAvailabilityRequest parameters, Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/TasksClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/TasksClient.java new file mode 100644 index 000000000000..3ca5c1e6e19f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/TasksClient.java @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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.datamigration.fluent.models.CommandPropertiesInner; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner; + +/** An instance of this class provides access to all the operations defined in TasksClient. */ +public interface TasksClient { + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates + * that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String groupName, String serviceName, String projectName); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates + * that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskType Filter tasks by task type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String groupName, String serviceName, String projectName, String taskType, Context context); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method + * creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is + * little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectTaskInner createOrUpdate( + String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method + * creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is + * little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String groupName, + String serviceName, + String projectName, + String taskName, + ProjectTaskInner parameters, + Context context); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method + * retrieves information about a task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectTaskInner get(String groupName, String serviceName, String projectName, String taskName); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method + * retrieves information about a task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param expand Expand the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String groupName, String serviceName, String projectName, String taskName, String expand, Context context); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE + * method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 groupName, String serviceName, String projectName, String taskName); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE + * method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String groupName, + String serviceName, + String projectName, + String taskName, + Boolean deleteRunningTasks, + Context context); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH + * method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do + * so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectTaskInner update( + String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH + * method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do + * so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String groupName, + String serviceName, + String projectName, + String taskName, + ProjectTaskInner parameters, + Context context); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * cancels a task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectTaskInner cancel(String groupName, String serviceName, String projectName, String taskName); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * cancels a task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response cancelWithResponse( + String groupName, String serviceName, String projectName, String taskName, Context context); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * executes a command on a running task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Command to execute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for all types of DMS command properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CommandPropertiesInner command( + String groupName, String serviceName, String projectName, String taskName, CommandPropertiesInner parameters); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * executes a command on a running task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Command to execute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for all types of DMS command properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response commandWithResponse( + String groupName, + String serviceName, + String projectName, + String taskName, + CommandPropertiesInner parameters, + Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/UsagesClient.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/UsagesClient.java new file mode 100644 index 000000000000..4e8adef0cd7e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/UsagesClient.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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.datamigration.fluent.models.QuotaInner; + +/** An instance of this class provides access to all the operations defined in UsagesClient. */ +public interface UsagesClient { + /** + * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * + * @param location The Azure region of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of quota objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * + * @param location The Azure region of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of quota objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/AvailableServiceSkuInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/AvailableServiceSkuInner.java new file mode 100644 index 000000000000..d7fcbe65654d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/AvailableServiceSkuInner.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.models.AvailableServiceSkuAutoGenerated; +import com.azure.resourcemanager.datamigration.models.AvailableServiceSkuCapacity; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the available service SKU. */ +@Fluent +public final class AvailableServiceSkuInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableServiceSkuInner.class); + + /* + * The resource type, including the provider namespace + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /* + * SKU name, tier, etc. + */ + @JsonProperty(value = "sku") + private AvailableServiceSkuAutoGenerated sku; + + /* + * A description of the scaling capacities of the SKU + */ + @JsonProperty(value = "capacity") + private AvailableServiceSkuCapacity capacity; + + /** + * Get the resourceType property: The resource type, including the provider namespace. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: The resource type, including the provider namespace. + * + * @param resourceType the resourceType value to set. + * @return the AvailableServiceSkuInner object itself. + */ + public AvailableServiceSkuInner withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the sku property: SKU name, tier, etc. + * + * @return the sku value. + */ + public AvailableServiceSkuAutoGenerated sku() { + return this.sku; + } + + /** + * Set the sku property: SKU name, tier, etc. + * + * @param sku the sku value to set. + * @return the AvailableServiceSkuInner object itself. + */ + public AvailableServiceSkuInner withSku(AvailableServiceSkuAutoGenerated sku) { + this.sku = sku; + return this; + } + + /** + * Get the capacity property: A description of the scaling capacities of the SKU. + * + * @return the capacity value. + */ + public AvailableServiceSkuCapacity capacity() { + return this.capacity; + } + + /** + * Set the capacity property: A description of the scaling capacities of the SKU. + * + * @param capacity the capacity value to set. + * @return the AvailableServiceSkuInner object itself. + */ + public AvailableServiceSkuInner withCapacity(AvailableServiceSkuCapacity capacity) { + this.capacity = capacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (capacity() != null) { + capacity().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/CommandPropertiesInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/CommandPropertiesInner.java new file mode 100644 index 000000000000..75d1f7e49b93 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/CommandPropertiesInner.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.models.CommandState; +import com.azure.resourcemanager.datamigration.models.MigrateMISyncCompleteCommandProperties; +import com.azure.resourcemanager.datamigration.models.MigrateSyncCompleteCommandProperties; +import com.azure.resourcemanager.datamigration.models.MongoDbCancelCommand; +import com.azure.resourcemanager.datamigration.models.MongoDbFinishCommand; +import com.azure.resourcemanager.datamigration.models.MongoDbRestartCommand; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * Base class for all types of DMS command properties. If command is not supported by current client, this object is + * returned. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "commandType", + defaultImpl = CommandPropertiesInner.class) +@JsonTypeName("CommandProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Migrate.Sync.Complete.Database", value = MigrateSyncCompleteCommandProperties.class), + @JsonSubTypes.Type( + name = "Migrate.SqlServer.AzureDbSqlMi.Complete", + value = MigrateMISyncCompleteCommandProperties.class), + @JsonSubTypes.Type(name = "cancel", value = MongoDbCancelCommand.class), + @JsonSubTypes.Type(name = "finish", value = MongoDbFinishCommand.class), + @JsonSubTypes.Type(name = "restart", value = MongoDbRestartCommand.class) +}) +@Immutable +public class CommandPropertiesInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CommandPropertiesInner.class); + + /* + * Array of errors. This is ignored if submitted. + */ + @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) + private List errors; + + /* + * The state of the command. This is ignored if submitted. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private CommandState state; + + /** + * Get the errors property: Array of errors. This is ignored if submitted. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Get the state property: The state of the command. This is ignored if submitted. + * + * @return the state value. + */ + public CommandState state() { + return this.state; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DataMigrationServiceInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DataMigrationServiceInner.java new file mode 100644 index 000000000000..b3d673d5ea32 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DataMigrationServiceInner.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.models.ServiceProvisioningState; +import com.azure.resourcemanager.datamigration.models.ServiceSku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** A Database Migration Service resource. */ +@JsonFlatten +@Fluent +public class DataMigrationServiceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataMigrationServiceInner.class); + + /* + * HTTP strong entity tag value. Ignored if submitted + */ + @JsonProperty(value = "etag") + private String etag; + + /* + * The resource kind. Only 'vm' (the default) is supported. + */ + @JsonProperty(value = "kind") + private String kind; + + /* + * Service SKU + */ + @JsonProperty(value = "sku") + private ServiceSku sku; + + /* + * The resource's provisioning state + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ServiceProvisioningState provisioningState; + + /* + * The public key of the service, used to encrypt secrets sent to the + * service + */ + @JsonProperty(value = "properties.publicKey") + private String publicKey; + + /* + * The ID of the Microsoft.Network/virtualNetworks/subnets resource to + * which the service should be joined + */ + @JsonProperty(value = "properties.virtualSubnetId") + private String virtualSubnetId; + + /* + * The ID of the Microsoft.Network/networkInterfaces resource which the + * service have + */ + @JsonProperty(value = "properties.virtualNicId") + private String virtualNicId; + + /** + * Get the etag property: HTTP strong entity tag value. Ignored if submitted. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: HTTP strong entity tag value. Ignored if submitted. + * + * @param etag the etag value to set. + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the kind property: The resource kind. Only 'vm' (the default) is supported. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind property: The resource kind. Only 'vm' (the default) is supported. + * + * @param kind the kind value to set. + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the sku property: Service SKU. + * + * @return the sku value. + */ + public ServiceSku sku() { + return this.sku; + } + + /** + * Set the sku property: Service SKU. + * + * @param sku the sku value to set. + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withSku(ServiceSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the provisioningState property: The resource's provisioning state. + * + * @return the provisioningState value. + */ + public ServiceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the publicKey property: The public key of the service, used to encrypt secrets sent to the service. + * + * @return the publicKey value. + */ + public String publicKey() { + return this.publicKey; + } + + /** + * Set the publicKey property: The public key of the service, used to encrypt secrets sent to the service. + * + * @param publicKey the publicKey value to set. + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withPublicKey(String publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + * Get the virtualSubnetId property: The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the + * service should be joined. + * + * @return the virtualSubnetId value. + */ + public String virtualSubnetId() { + return this.virtualSubnetId; + } + + /** + * Set the virtualSubnetId property: The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the + * service should be joined. + * + * @param virtualSubnetId the virtualSubnetId value to set. + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withVirtualSubnetId(String virtualSubnetId) { + this.virtualSubnetId = virtualSubnetId; + return this; + } + + /** + * Get the virtualNicId property: The ID of the Microsoft.Network/networkInterfaces resource which the service have. + * + * @return the virtualNicId value. + */ + public String virtualNicId() { + return this.virtualNicId; + } + + /** + * Set the virtualNicId property: The ID of the Microsoft.Network/networkInterfaces resource which the service have. + * + * @param virtualNicId the virtualNicId value to set. + * @return the DataMigrationServiceInner object itself. + */ + public DataMigrationServiceInner withVirtualNicId(String virtualNicId) { + this.virtualNicId = virtualNicId; + return this; + } + + /** {@inheritDoc} */ + @Override + public DataMigrationServiceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DataMigrationServiceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DataMigrationServiceStatusResponseInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DataMigrationServiceStatusResponseInner.java new file mode 100644 index 000000000000..b53702e4088b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/DataMigrationServiceStatusResponseInner.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Service health status. */ +@Fluent +public final class DataMigrationServiceStatusResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataMigrationServiceStatusResponseInner.class); + + /* + * The DMS instance agent version + */ + @JsonProperty(value = "agentVersion") + private String agentVersion; + + /* + * The machine-readable status, such as 'Initializing', 'Offline', + * 'Online', 'Deploying', 'Deleting', 'Stopped', 'Stopping', 'Starting', + * 'FailedToStart', 'FailedToStop' or 'Failed' + */ + @JsonProperty(value = "status") + private String status; + + /* + * The services virtual machine size, such as 'Standard_D2_v2' + */ + @JsonProperty(value = "vmSize") + private String vmSize; + + /* + * The list of supported task types + */ + @JsonProperty(value = "supportedTaskTypes") + private List supportedTaskTypes; + + /** + * Get the agentVersion property: The DMS instance agent version. + * + * @return the agentVersion value. + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Set the agentVersion property: The DMS instance agent version. + * + * @param agentVersion the agentVersion value to set. + * @return the DataMigrationServiceStatusResponseInner object itself. + */ + public DataMigrationServiceStatusResponseInner withAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * Get the status property: The machine-readable status, such as 'Initializing', 'Offline', 'Online', 'Deploying', + * 'Deleting', 'Stopped', 'Stopping', 'Starting', 'FailedToStart', 'FailedToStop' or 'Failed'. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: The machine-readable status, such as 'Initializing', 'Offline', 'Online', 'Deploying', + * 'Deleting', 'Stopped', 'Stopping', 'Starting', 'FailedToStart', 'FailedToStop' or 'Failed'. + * + * @param status the status value to set. + * @return the DataMigrationServiceStatusResponseInner object itself. + */ + public DataMigrationServiceStatusResponseInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the vmSize property: The services virtual machine size, such as 'Standard_D2_v2'. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: The services virtual machine size, such as 'Standard_D2_v2'. + * + * @param vmSize the vmSize value to set. + * @return the DataMigrationServiceStatusResponseInner object itself. + */ + public DataMigrationServiceStatusResponseInner withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the supportedTaskTypes property: The list of supported task types. + * + * @return the supportedTaskTypes value. + */ + public List supportedTaskTypes() { + return this.supportedTaskTypes; + } + + /** + * Set the supportedTaskTypes property: The list of supported task types. + * + * @param supportedTaskTypes the supportedTaskTypes value to set. + * @return the DataMigrationServiceStatusResponseInner object itself. + */ + public DataMigrationServiceStatusResponseInner withSupportedTaskTypes(List supportedTaskTypes) { + this.supportedTaskTypes = supportedTaskTypes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/FileStorageInfoInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/FileStorageInfoInner.java new file mode 100644 index 000000000000..7c253e6c0ad0 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/FileStorageInfoInner.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** File storage information. */ +@Fluent +public final class FileStorageInfoInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FileStorageInfoInner.class); + + /* + * A URI that can be used to access the file content. + */ + @JsonProperty(value = "uri") + private String uri; + + /* + * Dictionary of + */ + @JsonProperty(value = "headers") + private Map headers; + + /** + * Get the uri property: A URI that can be used to access the file content. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: A URI that can be used to access the file content. + * + * @param uri the uri value to set. + * @return the FileStorageInfoInner object itself. + */ + public FileStorageInfoInner withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the headers property: Dictionary of <string>. + * + * @return the headers value. + */ + public Map headers() { + return this.headers; + } + + /** + * Set the headers property: Dictionary of <string>. + * + * @param headers the headers value to set. + * @return the FileStorageInfoInner object itself. + */ + public FileStorageInfoInner withHeaders(Map headers) { + this.headers = headers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/NameAvailabilityResponseInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/NameAvailabilityResponseInner.java new file mode 100644 index 000000000000..360029265a87 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/NameAvailabilityResponseInner.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.models.NameCheckFailureReason; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Indicates whether a proposed resource name is available. */ +@Fluent +public final class NameAvailabilityResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NameAvailabilityResponseInner.class); + + /* + * If true, the name is valid and available. If false, 'reason' describes + * why not. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /* + * The reason why the name is not available, if nameAvailable is false + */ + @JsonProperty(value = "reason") + private NameCheckFailureReason reason; + + /* + * The localized reason why the name is not available, if nameAvailable is + * false + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the nameAvailable property: If true, the name is valid and available. If false, 'reason' describes why not. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the nameAvailable property: If true, the name is valid and available. If false, 'reason' describes why not. + * + * @param nameAvailable the nameAvailable value to set. + * @return the NameAvailabilityResponseInner object itself. + */ + public NameAvailabilityResponseInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the reason property: The reason why the name is not available, if nameAvailable is false. + * + * @return the reason value. + */ + public NameCheckFailureReason reason() { + return this.reason; + } + + /** + * Set the reason property: The reason why the name is not available, if nameAvailable is false. + * + * @param reason the reason value to set. + * @return the NameAvailabilityResponseInner object itself. + */ + public NameAvailabilityResponseInner withReason(NameCheckFailureReason reason) { + this.reason = reason; + return this; + } + + /** + * Get the message property: The localized reason why the name is not available, if nameAvailable is false. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The localized reason why the name is not available, if nameAvailable is false. + * + * @param message the message value to set. + * @return the NameAvailabilityResponseInner object itself. + */ + public NameAvailabilityResponseInner withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectFileInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectFileInner.java new file mode 100644 index 000000000000..817fe6ab2a1b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectFileInner.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.models.ProjectFileProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A file resource. */ +@Fluent +public final class ProjectFileInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProjectFileInner.class); + + /* + * HTTP strong entity tag value. This is ignored if submitted. + */ + @JsonProperty(value = "etag") + private String etag; + + /* + * Custom file properties + */ + @JsonProperty(value = "properties") + private ProjectFileProperties properties; + + /** + * Get the etag property: HTTP strong entity tag value. This is ignored if submitted. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: HTTP strong entity tag value. This is ignored if submitted. + * + * @param etag the etag value to set. + * @return the ProjectFileInner object itself. + */ + public ProjectFileInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the properties property: Custom file properties. + * + * @return the properties value. + */ + public ProjectFileProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Custom file properties. + * + * @param properties the properties value to set. + * @return the ProjectFileInner object itself. + */ + public ProjectFileInner withProperties(ProjectFileProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectInner.java new file mode 100644 index 000000000000..478836c6d79e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectInner.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.models.ConnectionInfo; +import com.azure.resourcemanager.datamigration.models.DatabaseInfo; +import com.azure.resourcemanager.datamigration.models.ProjectProvisioningState; +import com.azure.resourcemanager.datamigration.models.ProjectSourcePlatform; +import com.azure.resourcemanager.datamigration.models.ProjectTargetPlatform; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** A project resource. */ +@JsonFlatten +@Fluent +public class ProjectInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProjectInner.class); + + /* + * Source platform for the project + */ + @JsonProperty(value = "properties.sourcePlatform") + private ProjectSourcePlatform sourcePlatform; + + /* + * Target platform for the project + */ + @JsonProperty(value = "properties.targetPlatform") + private ProjectTargetPlatform targetPlatform; + + /* + * UTC Date and time when project was created + */ + @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationTime; + + /* + * Information for connecting to source + */ + @JsonProperty(value = "properties.sourceConnectionInfo") + private ConnectionInfo sourceConnectionInfo; + + /* + * Information for connecting to target + */ + @JsonProperty(value = "properties.targetConnectionInfo") + private ConnectionInfo targetConnectionInfo; + + /* + * List of DatabaseInfo + */ + @JsonProperty(value = "properties.databasesInfo") + private List databasesInfo; + + /* + * The project's provisioning state + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProjectProvisioningState provisioningState; + + /** + * Get the sourcePlatform property: Source platform for the project. + * + * @return the sourcePlatform value. + */ + public ProjectSourcePlatform sourcePlatform() { + return this.sourcePlatform; + } + + /** + * Set the sourcePlatform property: Source platform for the project. + * + * @param sourcePlatform the sourcePlatform value to set. + * @return the ProjectInner object itself. + */ + public ProjectInner withSourcePlatform(ProjectSourcePlatform sourcePlatform) { + this.sourcePlatform = sourcePlatform; + return this; + } + + /** + * Get the targetPlatform property: Target platform for the project. + * + * @return the targetPlatform value. + */ + public ProjectTargetPlatform targetPlatform() { + return this.targetPlatform; + } + + /** + * Set the targetPlatform property: Target platform for the project. + * + * @param targetPlatform the targetPlatform value to set. + * @return the ProjectInner object itself. + */ + public ProjectInner withTargetPlatform(ProjectTargetPlatform targetPlatform) { + this.targetPlatform = targetPlatform; + return this; + } + + /** + * Get the creationTime property: UTC Date and time when project was created. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Get the sourceConnectionInfo property: Information for connecting to source. + * + * @return the sourceConnectionInfo value. + */ + public ConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set the sourceConnectionInfo property: Information for connecting to source. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set. + * @return the ProjectInner object itself. + */ + public ProjectInner withSourceConnectionInfo(ConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get the targetConnectionInfo property: Information for connecting to target. + * + * @return the targetConnectionInfo value. + */ + public ConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set the targetConnectionInfo property: Information for connecting to target. + * + * @param targetConnectionInfo the targetConnectionInfo value to set. + * @return the ProjectInner object itself. + */ + public ProjectInner withTargetConnectionInfo(ConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Get the databasesInfo property: List of DatabaseInfo. + * + * @return the databasesInfo value. + */ + public List databasesInfo() { + return this.databasesInfo; + } + + /** + * Set the databasesInfo property: List of DatabaseInfo. + * + * @param databasesInfo the databasesInfo value to set. + * @return the ProjectInner object itself. + */ + public ProjectInner withDatabasesInfo(List databasesInfo) { + this.databasesInfo = databasesInfo; + return this; + } + + /** + * Get the provisioningState property: The project's provisioning state. + * + * @return the provisioningState value. + */ + public ProjectProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public ProjectInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ProjectInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceConnectionInfo() != null) { + sourceConnectionInfo().validate(); + } + if (targetConnectionInfo() != null) { + targetConnectionInfo().validate(); + } + if (databasesInfo() != null) { + databasesInfo().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectTaskInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectTaskInner.java new file mode 100644 index 000000000000..7e38d4be1d3d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectTaskInner.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.models.ProjectTaskProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A task resource. */ +@Fluent +public final class ProjectTaskInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProjectTaskInner.class); + + /* + * HTTP strong entity tag value. This is ignored if submitted. + */ + @JsonProperty(value = "etag") + private String etag; + + /* + * Custom task properties + */ + @JsonProperty(value = "properties") + private ProjectTaskProperties properties; + + /** + * Get the etag property: HTTP strong entity tag value. This is ignored if submitted. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: HTTP strong entity tag value. This is ignored if submitted. + * + * @param etag the etag value to set. + * @return the ProjectTaskInner object itself. + */ + public ProjectTaskInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the properties property: Custom task properties. + * + * @return the properties value. + */ + public ProjectTaskProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Custom task properties. + * + * @param properties the properties value to set. + * @return the ProjectTaskInner object itself. + */ + public ProjectTaskInner withProperties(ProjectTaskProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/QuotaInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/QuotaInner.java new file mode 100644 index 000000000000..d5e768228b11 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/QuotaInner.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.models.QuotaName; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a quota for or usage details about a resource. */ +@Fluent +public final class QuotaInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotaInner.class); + + /* + * The current value of the quota. If null or missing, the current value + * cannot be determined in the context of the request. + */ + @JsonProperty(value = "currentValue") + private Double currentValue; + + /* + * The resource ID of the quota object + */ + @JsonProperty(value = "id") + private String id; + + /* + * The maximum value of the quota. If null or missing, the quota has no + * maximum, in which case it merely tracks usage. + */ + @JsonProperty(value = "limit") + private Double limit; + + /* + * The name of the quota + */ + @JsonProperty(value = "name") + private QuotaName name; + + /* + * The unit for the quota, such as Count, Bytes, BytesPerSecond, etc. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * Get the currentValue property: The current value of the quota. If null or missing, the current value cannot be + * determined in the context of the request. + * + * @return the currentValue value. + */ + public Double currentValue() { + return this.currentValue; + } + + /** + * Set the currentValue property: The current value of the quota. If null or missing, the current value cannot be + * determined in the context of the request. + * + * @param currentValue the currentValue value to set. + * @return the QuotaInner object itself. + */ + public QuotaInner withCurrentValue(Double currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the id property: The resource ID of the quota object. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The resource ID of the quota object. + * + * @param id the id value to set. + * @return the QuotaInner object itself. + */ + public QuotaInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the limit property: The maximum value of the quota. If null or missing, the quota has no maximum, in which + * case it merely tracks usage. + * + * @return the limit value. + */ + public Double limit() { + return this.limit; + } + + /** + * Set the limit property: The maximum value of the quota. If null or missing, the quota has no maximum, in which + * case it merely tracks usage. + * + * @param limit the limit value to set. + * @return the QuotaInner object itself. + */ + public QuotaInner withLimit(Double limit) { + this.limit = limit; + return this; + } + + /** + * Get the name property: The name of the quota. + * + * @return the name value. + */ + public QuotaName name() { + return this.name; + } + + /** + * Set the name property: The name of the quota. + * + * @param name the name value to set. + * @return the QuotaInner object itself. + */ + public QuotaInner withName(QuotaName name) { + this.name = name; + return this; + } + + /** + * Get the unit property: The unit for the quota, such as Count, Bytes, BytesPerSecond, etc. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: The unit for the quota, such as Count, Bytes, BytesPerSecond, etc. + * + * @param unit the unit value to set. + * @return the QuotaInner object itself. + */ + public QuotaInner withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() != null) { + name().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ResourceSkuInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ResourceSkuInner.java new file mode 100644 index 000000000000..2fbc5472bd09 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ResourceSkuInner.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.models.ResourceSkuCapabilities; +import com.azure.resourcemanager.datamigration.models.ResourceSkuCapacity; +import com.azure.resourcemanager.datamigration.models.ResourceSkuCosts; +import com.azure.resourcemanager.datamigration.models.ResourceSkuRestrictions; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes an available DMS SKU. */ +@Immutable +public final class ResourceSkuInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuInner.class); + + /* + * The type of resource the SKU applies to. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /* + * The name of SKU. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Specifies the tier of DMS in a scale set. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private String tier; + + /* + * The Size of the SKU. + */ + @JsonProperty(value = "size", access = JsonProperty.Access.WRITE_ONLY) + private String size; + + /* + * The Family of this particular SKU. + */ + @JsonProperty(value = "family", access = JsonProperty.Access.WRITE_ONLY) + private String family; + + /* + * The Kind of resources that are supported in this SKU. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private String kind; + + /* + * Not used. + */ + @JsonProperty(value = "capacity", access = JsonProperty.Access.WRITE_ONLY) + private ResourceSkuCapacity capacity; + + /* + * The set of locations that the SKU is available. + */ + @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) + private List locations; + + /* + * The api versions that support this SKU. + */ + @JsonProperty(value = "apiVersions", access = JsonProperty.Access.WRITE_ONLY) + private List apiVersions; + + /* + * Metadata for retrieving price info. + */ + @JsonProperty(value = "costs", access = JsonProperty.Access.WRITE_ONLY) + private List costs; + + /* + * A name value pair to describe the capability. + */ + @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) + private List capabilities; + + /* + * The restrictions because of which SKU cannot be used. This is empty if + * there are no restrictions. + */ + @JsonProperty(value = "restrictions", access = JsonProperty.Access.WRITE_ONLY) + private List restrictions; + + /** + * Get the resourceType property: The type of resource the SKU applies to. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the name property: The name of SKU. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the tier property: Specifies the tier of DMS in a scale set. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Get the size property: The Size of the SKU. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Get the family property: The Family of this particular SKU. + * + * @return the family value. + */ + public String family() { + return this.family; + } + + /** + * Get the kind property: The Kind of resources that are supported in this SKU. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Get the capacity property: Not used. + * + * @return the capacity value. + */ + public ResourceSkuCapacity capacity() { + return this.capacity; + } + + /** + * Get the locations property: The set of locations that the SKU is available. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Get the apiVersions property: The api versions that support this SKU. + * + * @return the apiVersions value. + */ + public List apiVersions() { + return this.apiVersions; + } + + /** + * Get the costs property: Metadata for retrieving price info. + * + * @return the costs value. + */ + public List costs() { + return this.costs; + } + + /** + * Get the capabilities property: A name value pair to describe the capability. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Get the restrictions property: The restrictions because of which SKU cannot be used. This is empty if there are + * no restrictions. + * + * @return the restrictions value. + */ + public List restrictions() { + return this.restrictions; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capacity() != null) { + capacity().validate(); + } + if (costs() != null) { + costs().forEach(e -> e.validate()); + } + if (capabilities() != null) { + capabilities().forEach(e -> e.validate()); + } + if (restrictions() != null) { + restrictions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ServiceOperationInner.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ServiceOperationInner.java new file mode 100644 index 000000000000..0809e0e4d86f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ServiceOperationInner.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.models.ServiceOperationDisplay; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Description of an action supported by the Database Migration Service. */ +@Fluent +public final class ServiceOperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceOperationInner.class); + + /* + * The fully qualified action name, e.g. + * Microsoft.DataMigration/services/read + */ + @JsonProperty(value = "name") + private String name; + + /* + * Localized display text + */ + @JsonProperty(value = "display") + private ServiceOperationDisplay display; + + /** + * Get the name property: The fully qualified action name, e.g. Microsoft.DataMigration/services/read. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The fully qualified action name, e.g. Microsoft.DataMigration/services/read. + * + * @param name the name value to set. + * @return the ServiceOperationInner object itself. + */ + public ServiceOperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display property: Localized display text. + * + * @return the display value. + */ + public ServiceOperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Localized display text. + * + * @param display the display value to set. + * @return the ServiceOperationInner object itself. + */ + public ServiceOperationInner withDisplay(ServiceOperationDisplay display) { + this.display = display; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/package-info.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/package-info.java new file mode 100644 index 000000000000..b1cbb58aa811 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/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 DataMigrationManagementClient. Data Migration Client. */ +package com.azure.resourcemanager.datamigration.fluent.models; diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/package-info.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/package-info.java new file mode 100644 index 000000000000..1eb3aad57c85 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/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 DataMigrationManagementClient. Data Migration Client. */ +package com.azure.resourcemanager.datamigration.fluent; diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/AvailableServiceSkuImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/AvailableServiceSkuImpl.java new file mode 100644 index 000000000000..e9c35aa62436 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/AvailableServiceSkuImpl.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.datamigration.implementation; + +import com.azure.resourcemanager.datamigration.fluent.models.AvailableServiceSkuInner; +import com.azure.resourcemanager.datamigration.models.AvailableServiceSku; +import com.azure.resourcemanager.datamigration.models.AvailableServiceSkuAutoGenerated; +import com.azure.resourcemanager.datamigration.models.AvailableServiceSkuCapacity; + +public final class AvailableServiceSkuImpl implements AvailableServiceSku { + private AvailableServiceSkuInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + AvailableServiceSkuImpl( + AvailableServiceSkuInner innerObject, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public AvailableServiceSkuAutoGenerated sku() { + return this.innerModel().sku(); + } + + public AvailableServiceSkuCapacity capacity() { + return this.innerModel().capacity(); + } + + public AvailableServiceSkuInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/CommandPropertiesImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/CommandPropertiesImpl.java new file mode 100644 index 000000000000..5ae5c74ee66b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/CommandPropertiesImpl.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.datamigration.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import com.azure.resourcemanager.datamigration.models.CommandProperties; +import com.azure.resourcemanager.datamigration.models.CommandState; +import java.util.Collections; +import java.util.List; + +public final class CommandPropertiesImpl implements CommandProperties { + private CommandPropertiesInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + CommandPropertiesImpl( + CommandPropertiesInner innerObject, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List errors() { + List inner = this.innerModel().errors(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public CommandState state() { + return this.innerModel().state(); + } + + public CommandPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationManagementClientBuilder.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationManagementClientBuilder.java new file mode 100644 index 000000000000..d28dc06eb2a3 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationManagementClientBuilder.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.datamigration.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 DataMigrationManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {DataMigrationManagementClientImpl.class}) +public final class DataMigrationManagementClientBuilder { + /* + * Identifier of the subscription + */ + private String subscriptionId; + + /** + * Sets Identifier of the subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the DataMigrationManagementClientBuilder. + */ + public DataMigrationManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the DataMigrationManagementClientBuilder. + */ + public DataMigrationManagementClientBuilder 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 DataMigrationManagementClientBuilder. + */ + public DataMigrationManagementClientBuilder 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 DataMigrationManagementClientBuilder. + */ + public DataMigrationManagementClientBuilder 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 DataMigrationManagementClientBuilder. + */ + public DataMigrationManagementClientBuilder 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 DataMigrationManagementClientBuilder. + */ + public DataMigrationManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of DataMigrationManagementClientImpl with the provided parameters. + * + * @return an instance of DataMigrationManagementClientImpl. + */ + public DataMigrationManagementClientImpl 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(); + } + DataMigrationManagementClientImpl client = + new DataMigrationManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationManagementClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationManagementClientImpl.java new file mode 100644 index 000000000000..e803c79fbbd2 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationManagementClientImpl.java @@ -0,0 +1,391 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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.datamigration.fluent.DataMigrationManagementClient; +import com.azure.resourcemanager.datamigration.fluent.FilesClient; +import com.azure.resourcemanager.datamigration.fluent.OperationsClient; +import com.azure.resourcemanager.datamigration.fluent.ProjectsClient; +import com.azure.resourcemanager.datamigration.fluent.ResourceSkusClient; +import com.azure.resourcemanager.datamigration.fluent.ServiceTasksClient; +import com.azure.resourcemanager.datamigration.fluent.ServicesClient; +import com.azure.resourcemanager.datamigration.fluent.TasksClient; +import com.azure.resourcemanager.datamigration.fluent.UsagesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the DataMigrationManagementClientImpl type. */ +@ServiceClient(builder = DataMigrationManagementClientBuilder.class) +public final class DataMigrationManagementClientImpl implements DataMigrationManagementClient { + private final ClientLogger logger = new ClientLogger(DataMigrationManagementClientImpl.class); + + /** Identifier of the subscription. */ + private final String subscriptionId; + + /** + * Gets Identifier of the subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The ResourceSkusClient object to access its operations. */ + private final ResourceSkusClient resourceSkus; + + /** + * Gets the ResourceSkusClient object to access its operations. + * + * @return the ResourceSkusClient object. + */ + public ResourceSkusClient getResourceSkus() { + return this.resourceSkus; + } + + /** The ServicesClient object to access its operations. */ + private final ServicesClient services; + + /** + * Gets the ServicesClient object to access its operations. + * + * @return the ServicesClient object. + */ + public ServicesClient getServices() { + return this.services; + } + + /** The TasksClient object to access its operations. */ + private final TasksClient tasks; + + /** + * Gets the TasksClient object to access its operations. + * + * @return the TasksClient object. + */ + public TasksClient getTasks() { + return this.tasks; + } + + /** The ServiceTasksClient object to access its operations. */ + private final ServiceTasksClient serviceTasks; + + /** + * Gets the ServiceTasksClient object to access its operations. + * + * @return the ServiceTasksClient object. + */ + public ServiceTasksClient getServiceTasks() { + return this.serviceTasks; + } + + /** The ProjectsClient object to access its operations. */ + private final ProjectsClient projects; + + /** + * Gets the ProjectsClient object to access its operations. + * + * @return the ProjectsClient object. + */ + public ProjectsClient getProjects() { + return this.projects; + } + + /** The UsagesClient object to access its operations. */ + private final UsagesClient usages; + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + public UsagesClient getUsages() { + return this.usages; + } + + /** The 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 FilesClient object to access its operations. */ + private final FilesClient files; + + /** + * Gets the FilesClient object to access its operations. + * + * @return the FilesClient object. + */ + public FilesClient getFiles() { + return this.files; + } + + /** + * Initializes an instance of DataMigrationManagementClient 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 Identifier of the subscription. + * @param endpoint server parameter. + */ + DataMigrationManagementClientImpl( + 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 = "2018-07-15-preview"; + this.resourceSkus = new ResourceSkusClientImpl(this); + this.services = new ServicesClientImpl(this); + this.tasks = new TasksClientImpl(this); + this.serviceTasks = new ServiceTasksClientImpl(this); + this.projects = new ProjectsClientImpl(this); + this.usages = new UsagesClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.files = new FilesClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationServiceImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationServiceImpl.java new file mode 100644 index 000000000000..0b64fb8de8e4 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationServiceImpl.java @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.DataMigrationServiceInner; +import com.azure.resourcemanager.datamigration.models.DataMigrationService; +import com.azure.resourcemanager.datamigration.models.DataMigrationServiceStatusResponse; +import com.azure.resourcemanager.datamigration.models.NameAvailabilityRequest; +import com.azure.resourcemanager.datamigration.models.NameAvailabilityResponse; +import com.azure.resourcemanager.datamigration.models.ServiceProvisioningState; +import com.azure.resourcemanager.datamigration.models.ServiceSku; +import java.util.Collections; +import java.util.Map; + +public final class DataMigrationServiceImpl + implements DataMigrationService, DataMigrationService.Definition, DataMigrationService.Update { + private DataMigrationServiceInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager 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 String etag() { + return this.innerModel().etag(); + } + + public String kind() { + return this.innerModel().kind(); + } + + public ServiceSku sku() { + return this.innerModel().sku(); + } + + public ServiceProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String publicKey() { + return this.innerModel().publicKey(); + } + + public String virtualSubnetId() { + return this.innerModel().virtualSubnetId(); + } + + public String virtualNicId() { + return this.innerModel().virtualNicId(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public DataMigrationServiceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + private String groupName; + + private String serviceName; + + public DataMigrationServiceImpl withExistingResourceGroup(String groupName) { + this.groupName = groupName; + return this; + } + + public DataMigrationService create() { + this.innerObject = + serviceManager + .serviceClient() + .getServices() + .createOrUpdate(groupName, serviceName, this.innerModel(), Context.NONE); + return this; + } + + public DataMigrationService create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getServices() + .createOrUpdate(groupName, serviceName, this.innerModel(), context); + return this; + } + + DataMigrationServiceImpl(String name, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = new DataMigrationServiceInner(); + this.serviceManager = serviceManager; + this.serviceName = name; + } + + public DataMigrationServiceImpl update() { + return this; + } + + public DataMigrationService apply() { + this.innerObject = + serviceManager + .serviceClient() + .getServices() + .update(groupName, serviceName, this.innerModel(), Context.NONE); + return this; + } + + public DataMigrationService apply(Context context) { + this.innerObject = + serviceManager.serviceClient().getServices().update(groupName, serviceName, this.innerModel(), context); + return this; + } + + DataMigrationServiceImpl( + DataMigrationServiceInner innerObject, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.groupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "services"); + } + + public DataMigrationService refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getServices() + .getByResourceGroupWithResponse(groupName, serviceName, Context.NONE) + .getValue(); + return this; + } + + public DataMigrationService refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getServices() + .getByResourceGroupWithResponse(groupName, serviceName, context) + .getValue(); + return this; + } + + public DataMigrationServiceStatusResponse checkStatus() { + return serviceManager.services().checkStatus(groupName, serviceName); + } + + public Response checkStatusWithResponse(Context context) { + return serviceManager.services().checkStatusWithResponse(groupName, serviceName, context); + } + + public void start() { + serviceManager.services().start(groupName, serviceName); + } + + public void start(Context context) { + serviceManager.services().start(groupName, serviceName, context); + } + + public void stop() { + serviceManager.services().stop(groupName, serviceName); + } + + public void stop(Context context) { + serviceManager.services().stop(groupName, serviceName, context); + } + + public NameAvailabilityResponse checkChildrenNameAvailability(NameAvailabilityRequest parameters) { + return serviceManager.services().checkChildrenNameAvailability(groupName, serviceName, parameters); + } + + public Response checkChildrenNameAvailabilityWithResponse( + NameAvailabilityRequest parameters, Context context) { + return serviceManager + .services() + .checkChildrenNameAvailabilityWithResponse(groupName, serviceName, parameters, context); + } + + public DataMigrationServiceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public DataMigrationServiceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public DataMigrationServiceImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public DataMigrationServiceImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public DataMigrationServiceImpl withKind(String kind) { + this.innerModel().withKind(kind); + return this; + } + + public DataMigrationServiceImpl withSku(ServiceSku sku) { + this.innerModel().withSku(sku); + return this; + } + + public DataMigrationServiceImpl withPublicKey(String publicKey) { + this.innerModel().withPublicKey(publicKey); + return this; + } + + public DataMigrationServiceImpl withVirtualSubnetId(String virtualSubnetId) { + this.innerModel().withVirtualSubnetId(virtualSubnetId); + return this; + } + + public DataMigrationServiceImpl withVirtualNicId(String virtualNicId) { + this.innerModel().withVirtualNicId(virtualNicId); + return this; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationServiceStatusResponseImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationServiceStatusResponseImpl.java new file mode 100644 index 000000000000..b1bb0a6723cd --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/DataMigrationServiceStatusResponseImpl.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.datamigration.implementation; + +import com.azure.resourcemanager.datamigration.fluent.models.DataMigrationServiceStatusResponseInner; +import com.azure.resourcemanager.datamigration.models.DataMigrationServiceStatusResponse; +import java.util.Collections; +import java.util.List; + +public final class DataMigrationServiceStatusResponseImpl implements DataMigrationServiceStatusResponse { + private DataMigrationServiceStatusResponseInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + DataMigrationServiceStatusResponseImpl( + DataMigrationServiceStatusResponseInner innerObject, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String agentVersion() { + return this.innerModel().agentVersion(); + } + + public String status() { + return this.innerModel().status(); + } + + public String vmSize() { + return this.innerModel().vmSize(); + } + + public List supportedTaskTypes() { + List inner = this.innerModel().supportedTaskTypes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DataMigrationServiceStatusResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FileStorageInfoImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FileStorageInfoImpl.java new file mode 100644 index 000000000000..302fc643f24c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FileStorageInfoImpl.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.datamigration.implementation; + +import com.azure.resourcemanager.datamigration.fluent.models.FileStorageInfoInner; +import com.azure.resourcemanager.datamigration.models.FileStorageInfo; +import java.util.Collections; +import java.util.Map; + +public final class FileStorageInfoImpl implements FileStorageInfo { + private FileStorageInfoInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + FileStorageInfoImpl( + FileStorageInfoInner innerObject, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String uri() { + return this.innerModel().uri(); + } + + public Map headers() { + Map inner = this.innerModel().headers(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public FileStorageInfoInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FilesClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FilesClientImpl.java new file mode 100644 index 000000000000..777eeaf13cae --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FilesClientImpl.java @@ -0,0 +1,1562 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.FilesClient; +import com.azure.resourcemanager.datamigration.fluent.models.FileStorageInfoInner; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectFileInner; +import com.azure.resourcemanager.datamigration.models.FileList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in FilesClient. */ +public final class FilesClientImpl implements FilesClient { + private final ClientLogger logger = new ClientLogger(FilesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final FilesService service; + + /** The service client containing this operation class. */ + private final DataMigrationManagementClientImpl client; + + /** + * Initializes an instance of FilesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FilesClientImpl(DataMigrationManagementClientImpl client) { + this.service = RestProxy.create(FilesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataMigrationManagementClientFiles to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataMigrationManagem") + private interface FilesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects/{projectName}/files") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("projectName") String projectName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects/{projectName}/files/{fileName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("projectName") String projectName, + @PathParam("fileName") String fileName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects/{projectName}/files/{fileName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("projectName") String projectName, + @PathParam("fileName") String fileName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ProjectFileInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects/{projectName}/files/{fileName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("projectName") String projectName, + @PathParam("fileName") String fileName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects/{projectName}/files/{fileName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("projectName") String projectName, + @PathParam("fileName") String fileName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ProjectFileInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects/{projectName}/files/{fileName}/read") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> read( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("projectName") String projectName, + @PathParam("fileName") String fileName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects/{projectName}/files/{fileName}/readwrite") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> readWrite( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("projectName") String projectName, + @PathParam("fileName") String fileName, + @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); + } + + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String groupName, String serviceName, String projectName) { + 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String groupName, String serviceName, String projectName, 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName 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(), + groupName, + serviceName, + projectName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String groupName, String serviceName, String projectName) { + return new PagedFlux<>( + () -> listSinglePageAsync(groupName, serviceName, projectName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String groupName, String serviceName, String projectName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(groupName, serviceName, projectName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String groupName, String serviceName, String projectName) { + return new PagedIterable<>(listAsync(groupName, serviceName, projectName)); + } + + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String groupName, String serviceName, String projectName, Context context) { + return new PagedIterable<>(listAsync(groupName, serviceName, projectName, context)); + } + + /** + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String groupName, String serviceName, String projectName, String fileName) { + 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + fileName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String groupName, String serviceName, String projectName, String fileName, 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + fileName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String groupName, String serviceName, String projectName, String fileName) { + return getWithResponseAsync(groupName, serviceName, projectName, fileName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectFileInner get(String groupName, String serviceName, String projectName, String fileName) { + return getAsync(groupName, serviceName, projectName, fileName).block(); + } + + /** + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context) { + return getWithResponseAsync(groupName, serviceName, projectName, fileName, context).block(); + } + + /** + * The PUT method creates a new file or updates an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + fileName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The PUT method creates a new file or updates an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String groupName, + String serviceName, + String projectName, + String fileName, + ProjectFileInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + fileName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * The PUT method creates a new file or updates an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters) { + return createOrUpdateWithResponseAsync(groupName, serviceName, projectName, fileName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The PUT method creates a new file or updates an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectFileInner createOrUpdate( + String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters) { + return createOrUpdateAsync(groupName, serviceName, projectName, fileName, parameters).block(); + } + + /** + * The PUT method creates a new file or updates an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String groupName, + String serviceName, + String projectName, + String fileName, + ProjectFileInner parameters, + Context context) { + return createOrUpdateWithResponseAsync(groupName, serviceName, projectName, fileName, parameters, context) + .block(); + } + + /** + * This method deletes a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String groupName, String serviceName, String projectName, String fileName) { + 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + fileName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This method deletes a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String groupName, String serviceName, String projectName, String fileName, 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + fileName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * This method deletes a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String groupName, String serviceName, String projectName, String fileName) { + return deleteWithResponseAsync(groupName, serviceName, projectName, fileName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * This method deletes a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String groupName, String serviceName, String projectName, String fileName) { + deleteAsync(groupName, serviceName, projectName, fileName).block(); + } + + /** + * This method deletes a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context) { + return deleteWithResponseAsync(groupName, serviceName, projectName, fileName, context).block(); + } + + /** + * This method updates an existing file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + fileName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This method updates an existing file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String groupName, + String serviceName, + String projectName, + String fileName, + ProjectFileInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + fileName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * This method updates an existing file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters) { + return updateWithResponseAsync(groupName, serviceName, projectName, fileName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * This method updates an existing file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectFileInner update( + String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters) { + return updateAsync(groupName, serviceName, projectName, fileName, parameters).block(); + } + + /** + * This method updates an existing file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param parameters Information about the file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String groupName, + String serviceName, + String projectName, + String fileName, + ProjectFileInner parameters, + Context context) { + return updateWithResponseAsync(groupName, serviceName, projectName, fileName, parameters, context).block(); + } + + /** + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> readWithResponseAsync( + String groupName, String serviceName, String projectName, String fileName) { + 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .read( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + fileName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> readWithResponseAsync( + String groupName, String serviceName, String projectName, String fileName, 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .read( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + fileName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono readAsync( + String groupName, String serviceName, String projectName, String fileName) { + return readWithResponseAsync(groupName, serviceName, projectName, fileName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileStorageInfoInner read(String groupName, String serviceName, String projectName, String fileName) { + return readAsync(groupName, serviceName, projectName, fileName).block(); + } + + /** + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response readWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context) { + return readWithResponseAsync(groupName, serviceName, projectName, fileName, context).block(); + } + + /** + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> readWriteWithResponseAsync( + String groupName, String serviceName, String projectName, String fileName) { + 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .readWrite( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + fileName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> readWriteWithResponseAsync( + String groupName, String serviceName, String projectName, String fileName, 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (fileName == null) { + return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .readWrite( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + fileName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono readWriteAsync( + String groupName, String serviceName, String projectName, String fileName) { + return readWriteWithResponseAsync(groupName, serviceName, projectName, fileName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileStorageInfoInner readWrite(String groupName, String serviceName, String projectName, String fileName) { + return readWriteAsync(groupName, serviceName, projectName, fileName).block(); + } + + /** + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response readWriteWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context) { + return readWriteWithResponseAsync(groupName, serviceName, projectName, fileName, 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 oData page of files. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files. + */ + @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/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FilesImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FilesImpl.java new file mode 100644 index 000000000000..344eb69a649d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/FilesImpl.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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.datamigration.fluent.FilesClient; +import com.azure.resourcemanager.datamigration.fluent.models.FileStorageInfoInner; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectFileInner; +import com.azure.resourcemanager.datamigration.models.FileStorageInfo; +import com.azure.resourcemanager.datamigration.models.Files; +import com.azure.resourcemanager.datamigration.models.ProjectFile; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class FilesImpl implements Files { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FilesImpl.class); + + private final FilesClient innerClient; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public FilesImpl( + FilesClient innerClient, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String groupName, String serviceName, String projectName) { + PagedIterable inner = this.serviceClient().list(groupName, serviceName, projectName); + return Utils.mapPage(inner, inner1 -> new ProjectFileImpl(inner1, this.manager())); + } + + public PagedIterable list(String groupName, String serviceName, String projectName, Context context) { + PagedIterable inner = this.serviceClient().list(groupName, serviceName, projectName, context); + return Utils.mapPage(inner, inner1 -> new ProjectFileImpl(inner1, this.manager())); + } + + public ProjectFile get(String groupName, String serviceName, String projectName, String fileName) { + ProjectFileInner inner = this.serviceClient().get(groupName, serviceName, projectName, fileName); + if (inner != null) { + return new ProjectFileImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context) { + Response inner = + this.serviceClient().getWithResponse(groupName, serviceName, projectName, fileName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProjectFileImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String groupName, String serviceName, String projectName, String fileName) { + this.serviceClient().delete(groupName, serviceName, projectName, fileName); + } + + public Response deleteWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context) { + return this.serviceClient().deleteWithResponse(groupName, serviceName, projectName, fileName, context); + } + + public FileStorageInfo read(String groupName, String serviceName, String projectName, String fileName) { + FileStorageInfoInner inner = this.serviceClient().read(groupName, serviceName, projectName, fileName); + if (inner != null) { + return new FileStorageInfoImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response readWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context) { + Response inner = + this.serviceClient().readWithResponse(groupName, serviceName, projectName, fileName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FileStorageInfoImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FileStorageInfo readWrite(String groupName, String serviceName, String projectName, String fileName) { + FileStorageInfoInner inner = this.serviceClient().readWrite(groupName, serviceName, projectName, fileName); + if (inner != null) { + return new FileStorageInfoImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response readWriteWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context) { + Response inner = + this.serviceClient().readWriteWithResponse(groupName, serviceName, projectName, fileName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FileStorageInfoImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ProjectFile getById(String id) { + String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (groupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + String projectName = Utils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String fileName = Utils.getValueFromIdByName(id, "files"); + if (fileName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'files'.", id))); + } + return this.getWithResponse(groupName, serviceName, projectName, fileName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (groupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + String projectName = Utils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String fileName = Utils.getValueFromIdByName(id, "files"); + if (fileName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'files'.", id))); + } + return this.getWithResponse(groupName, serviceName, projectName, fileName, context); + } + + public void deleteById(String id) { + String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (groupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + String projectName = Utils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String fileName = Utils.getValueFromIdByName(id, "files"); + if (fileName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'files'.", id))); + } + this.deleteWithResponse(groupName, serviceName, projectName, fileName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (groupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + String projectName = Utils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String fileName = Utils.getValueFromIdByName(id, "files"); + if (fileName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'files'.", id))); + } + return this.deleteWithResponse(groupName, serviceName, projectName, fileName, context); + } + + private FilesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + public ProjectFileImpl define(String name) { + return new ProjectFileImpl(name, this.manager()); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/NameAvailabilityResponseImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/NameAvailabilityResponseImpl.java new file mode 100644 index 000000000000..910784f2d67d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/NameAvailabilityResponseImpl.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.resourcemanager.datamigration.fluent.models.NameAvailabilityResponseInner; +import com.azure.resourcemanager.datamigration.models.NameAvailabilityResponse; +import com.azure.resourcemanager.datamigration.models.NameCheckFailureReason; + +public final class NameAvailabilityResponseImpl implements NameAvailabilityResponse { + private NameAvailabilityResponseInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + NameAvailabilityResponseImpl( + NameAvailabilityResponseInner innerObject, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public NameCheckFailureReason reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public NameAvailabilityResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..f7e1baa7a325 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/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.datamigration.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.datamigration.fluent.OperationsClient; +import com.azure.resourcemanager.datamigration.fluent.models.ServiceOperationInner; +import com.azure.resourcemanager.datamigration.models.ServiceOperationList; +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 DataMigrationManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(DataMigrationManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataMigrationManagementClientOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataMigrationManagem") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.DataMigration/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); + } + + /** + * Lists all available actions exposed by the Database Migration Service resource provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of action (operation) objects. + */ + @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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all available actions exposed by the Database Migration Service resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of action (operation) objects. + */ + @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)); + } + + /** + * Lists all available actions exposed by the Database Migration Service resource provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of action (operation) objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all available actions exposed by the Database Migration Service resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of action (operation) objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all available actions exposed by the Database Migration Service resource provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of action (operation) objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all available actions exposed by the Database Migration Service resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of action (operation) objects. + */ + @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 oData page of action (operation) objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of action (operation) objects. + */ + @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/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/OperationsImpl.java new file mode 100644 index 000000000000..27e354b1cdd2 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/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.datamigration.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.datamigration.fluent.OperationsClient; +import com.azure.resourcemanager.datamigration.fluent.models.ServiceOperationInner; +import com.azure.resourcemanager.datamigration.models.Operations; +import com.azure.resourcemanager.datamigration.models.ServiceOperation; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ServiceOperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ServiceOperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectFileImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectFileImpl.java new file mode 100644 index 000000000000..58b6e4187c7a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectFileImpl.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.datamigration.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectFileInner; +import com.azure.resourcemanager.datamigration.models.FileStorageInfo; +import com.azure.resourcemanager.datamigration.models.ProjectFile; +import com.azure.resourcemanager.datamigration.models.ProjectFileProperties; + +public final class ProjectFileImpl implements ProjectFile, ProjectFile.Definition, ProjectFile.Update { + private ProjectFileInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public ProjectFileProperties properties() { + return this.innerModel().properties(); + } + + public ProjectFileInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + private String groupName; + + private String serviceName; + + private String projectName; + + private String fileName; + + public ProjectFileImpl withExistingProject(String groupName, String serviceName, String projectName) { + this.groupName = groupName; + this.serviceName = serviceName; + this.projectName = projectName; + return this; + } + + public ProjectFile create() { + this.innerObject = + serviceManager + .serviceClient() + .getFiles() + .createOrUpdateWithResponse( + groupName, serviceName, projectName, fileName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ProjectFile create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFiles() + .createOrUpdateWithResponse(groupName, serviceName, projectName, fileName, this.innerModel(), context) + .getValue(); + return this; + } + + ProjectFileImpl(String name, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = new ProjectFileInner(); + this.serviceManager = serviceManager; + this.fileName = name; + } + + public ProjectFileImpl update() { + return this; + } + + public ProjectFile apply() { + this.innerObject = + serviceManager + .serviceClient() + .getFiles() + .updateWithResponse(groupName, serviceName, projectName, fileName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ProjectFile apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFiles() + .updateWithResponse(groupName, serviceName, projectName, fileName, this.innerModel(), context) + .getValue(); + return this; + } + + ProjectFileImpl( + ProjectFileInner innerObject, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.groupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "services"); + this.projectName = Utils.getValueFromIdByName(innerObject.id(), "projects"); + this.fileName = Utils.getValueFromIdByName(innerObject.id(), "files"); + } + + public ProjectFile refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getFiles() + .getWithResponse(groupName, serviceName, projectName, fileName, Context.NONE) + .getValue(); + return this; + } + + public ProjectFile refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFiles() + .getWithResponse(groupName, serviceName, projectName, fileName, context) + .getValue(); + return this; + } + + public FileStorageInfo read() { + return serviceManager.files().read(groupName, serviceName, projectName, fileName); + } + + public Response readWithResponse(Context context) { + return serviceManager.files().readWithResponse(groupName, serviceName, projectName, fileName, context); + } + + public FileStorageInfo readWrite() { + return serviceManager.files().readWrite(groupName, serviceName, projectName, fileName); + } + + public Response readWriteWithResponse(Context context) { + return serviceManager.files().readWriteWithResponse(groupName, serviceName, projectName, fileName, context); + } + + public ProjectFileImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public ProjectFileImpl withProperties(ProjectFileProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectImpl.java new file mode 100644 index 000000000000..7d8fa863da3c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectImpl.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.datamigration.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectInner; +import com.azure.resourcemanager.datamigration.models.ConnectionInfo; +import com.azure.resourcemanager.datamigration.models.DatabaseInfo; +import com.azure.resourcemanager.datamigration.models.Project; +import com.azure.resourcemanager.datamigration.models.ProjectProvisioningState; +import com.azure.resourcemanager.datamigration.models.ProjectSourcePlatform; +import com.azure.resourcemanager.datamigration.models.ProjectTargetPlatform; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ProjectImpl implements Project, Project.Definition, Project.Update { + private ProjectInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager 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 ProjectSourcePlatform sourcePlatform() { + return this.innerModel().sourcePlatform(); + } + + public ProjectTargetPlatform targetPlatform() { + return this.innerModel().targetPlatform(); + } + + public OffsetDateTime creationTime() { + return this.innerModel().creationTime(); + } + + public ConnectionInfo sourceConnectionInfo() { + return this.innerModel().sourceConnectionInfo(); + } + + public ConnectionInfo targetConnectionInfo() { + return this.innerModel().targetConnectionInfo(); + } + + public List databasesInfo() { + List inner = this.innerModel().databasesInfo(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProjectProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ProjectInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + private String groupName; + + private String serviceName; + + private String projectName; + + public ProjectImpl withExistingService(String groupName, String serviceName) { + this.groupName = groupName; + this.serviceName = serviceName; + return this; + } + + public Project create() { + this.innerObject = + serviceManager + .serviceClient() + .getProjects() + .createOrUpdateWithResponse(groupName, serviceName, projectName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Project create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProjects() + .createOrUpdateWithResponse(groupName, serviceName, projectName, this.innerModel(), context) + .getValue(); + return this; + } + + ProjectImpl(String name, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = new ProjectInner(); + this.serviceManager = serviceManager; + this.projectName = name; + } + + public ProjectImpl update() { + return this; + } + + public Project apply() { + this.innerObject = + serviceManager + .serviceClient() + .getProjects() + .updateWithResponse(groupName, serviceName, projectName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Project apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProjects() + .updateWithResponse(groupName, serviceName, projectName, this.innerModel(), context) + .getValue(); + return this; + } + + ProjectImpl(ProjectInner innerObject, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.groupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "services"); + this.projectName = Utils.getValueFromIdByName(innerObject.id(), "projects"); + } + + public Project refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getProjects() + .getWithResponse(groupName, serviceName, projectName, Context.NONE) + .getValue(); + return this; + } + + public Project refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProjects() + .getWithResponse(groupName, serviceName, projectName, context) + .getValue(); + return this; + } + + public ProjectImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ProjectImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ProjectImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public ProjectImpl withSourcePlatform(ProjectSourcePlatform sourcePlatform) { + this.innerModel().withSourcePlatform(sourcePlatform); + return this; + } + + public ProjectImpl withTargetPlatform(ProjectTargetPlatform targetPlatform) { + this.innerModel().withTargetPlatform(targetPlatform); + return this; + } + + public ProjectImpl withSourceConnectionInfo(ConnectionInfo sourceConnectionInfo) { + this.innerModel().withSourceConnectionInfo(sourceConnectionInfo); + return this; + } + + public ProjectImpl withTargetConnectionInfo(ConnectionInfo targetConnectionInfo) { + this.innerModel().withTargetConnectionInfo(targetConnectionInfo); + return this; + } + + public ProjectImpl withDatabasesInfo(List databasesInfo) { + this.innerModel().withDatabasesInfo(databasesInfo); + return this; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectTaskImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectTaskImpl.java new file mode 100644 index 000000000000..824bf5d91c9e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectTaskImpl.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.datamigration.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner; +import com.azure.resourcemanager.datamigration.models.CommandProperties; +import com.azure.resourcemanager.datamigration.models.ProjectTask; +import com.azure.resourcemanager.datamigration.models.ProjectTaskProperties; + +public final class ProjectTaskImpl implements ProjectTask, ProjectTask.Definition, ProjectTask.Update { + private ProjectTaskInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public ProjectTaskProperties properties() { + return this.innerModel().properties(); + } + + public ProjectTaskInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + private String groupName; + + private String serviceName; + + private String projectName; + + private String taskName; + + public ProjectTaskImpl withExistingProject(String groupName, String serviceName, String projectName) { + this.groupName = groupName; + this.serviceName = serviceName; + this.projectName = projectName; + return this; + } + + public ProjectTask create() { + this.innerObject = + serviceManager + .serviceClient() + .getTasks() + .createOrUpdateWithResponse( + groupName, serviceName, projectName, taskName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ProjectTask create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTasks() + .createOrUpdateWithResponse(groupName, serviceName, projectName, taskName, this.innerModel(), context) + .getValue(); + return this; + } + + ProjectTaskImpl(String name, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = new ProjectTaskInner(); + this.serviceManager = serviceManager; + this.taskName = name; + } + + public ProjectTaskImpl update() { + return this; + } + + public ProjectTask apply() { + this.innerObject = + serviceManager + .serviceClient() + .getTasks() + .updateWithResponse(groupName, serviceName, projectName, taskName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ProjectTask apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTasks() + .updateWithResponse(groupName, serviceName, projectName, taskName, this.innerModel(), context) + .getValue(); + return this; + } + + ProjectTaskImpl( + ProjectTaskInner innerObject, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.groupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "services"); + this.projectName = Utils.getValueFromIdByName(innerObject.id(), "projects"); + this.taskName = Utils.getValueFromIdByName(innerObject.id(), "tasks"); + } + + public ProjectTask refresh() { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getTasks() + .getWithResponse(groupName, serviceName, projectName, taskName, localExpand, Context.NONE) + .getValue(); + return this; + } + + public ProjectTask refresh(Context context) { + String localExpand = null; + this.innerObject = + serviceManager + .serviceClient() + .getTasks() + .getWithResponse(groupName, serviceName, projectName, taskName, localExpand, context) + .getValue(); + return this; + } + + public ProjectTask cancel() { + return serviceManager.tasks().cancel(groupName, serviceName, projectName, taskName); + } + + public Response cancelWithResponse(Context context) { + return serviceManager.tasks().cancelWithResponse(groupName, serviceName, projectName, taskName, context); + } + + public CommandProperties command(CommandPropertiesInner parameters) { + return serviceManager.tasks().command(groupName, serviceName, projectName, taskName, parameters); + } + + public Response commandWithResponse(CommandPropertiesInner parameters, Context context) { + return serviceManager + .tasks() + .commandWithResponse(groupName, serviceName, projectName, taskName, parameters, context); + } + + public ProjectTaskImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public ProjectTaskImpl withProperties(ProjectTaskProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectsClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectsClientImpl.java new file mode 100644 index 000000000000..f00f023637a1 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectsClientImpl.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.datamigration.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.ProjectsClient; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectInner; +import com.azure.resourcemanager.datamigration.models.ProjectList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ProjectsClient. */ +public final class ProjectsClientImpl implements ProjectsClient { + private final ClientLogger logger = new ClientLogger(ProjectsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ProjectsService service; + + /** The service client containing this operation class. */ + private final DataMigrationManagementClientImpl client; + + /** + * Initializes an instance of ProjectsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProjectsClientImpl(DataMigrationManagementClientImpl client) { + this.service = RestProxy.create(ProjectsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataMigrationManagementClientProjects to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataMigrationManagem") + private interface ProjectsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects/{projectName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("projectName") String projectName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ProjectInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects/{projectName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("projectName") String projectName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects/{projectName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("projectName") String projectName, + @QueryParam("api-version") String apiVersion, + @QueryParam("deleteRunningTasks") Boolean deleteRunningTasks, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects/{projectName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("projectName") String projectName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ProjectInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * projects owned by a service resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of project resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String groupName, String serviceName) { + 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * projects owned by a service resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of project resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String groupName, String serviceName, 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName 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(), + groupName, + serviceName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * projects owned by a service resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of project resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String groupName, String serviceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(groupName, serviceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * projects owned by a service resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of project resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String groupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(groupName, serviceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * projects owned by a service resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of project resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String groupName, String serviceName) { + return new PagedIterable<>(listAsync(groupName, serviceName)); + } + + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * projects owned by a service resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of project resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String groupName, String serviceName, Context context) { + return new PagedIterable<>(listAsync(groupName, serviceName, context)); + } + + /** + * The project resource is a nested resource representing a stored migration project. The PUT method creates a new + * project or updates an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param parameters Information about the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String groupName, String serviceName, String projectName, ProjectInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The project resource is a nested resource representing a stored migration project. The PUT method creates a new + * project or updates an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param parameters Information about the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String groupName, String serviceName, String projectName, ProjectInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * The project resource is a nested resource representing a stored migration project. The PUT method creates a new + * project or updates an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param parameters Information about the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String groupName, String serviceName, String projectName, ProjectInner parameters) { + return createOrUpdateWithResponseAsync(groupName, serviceName, projectName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The project resource is a nested resource representing a stored migration project. The PUT method creates a new + * project or updates an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param parameters Information about the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectInner createOrUpdate( + String groupName, String serviceName, String projectName, ProjectInner parameters) { + return createOrUpdateAsync(groupName, serviceName, projectName, parameters).block(); + } + + /** + * The project resource is a nested resource representing a stored migration project. The PUT method creates a new + * project or updates an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param parameters Information about the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String groupName, String serviceName, String projectName, ProjectInner parameters, Context context) { + return createOrUpdateWithResponseAsync(groupName, serviceName, projectName, parameters, context).block(); + } + + /** + * The project resource is a nested resource representing a stored migration project. The GET method retrieves + * information about a project. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String groupName, String serviceName, String projectName) { + 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The project resource is a nested resource representing a stored migration project. The GET method retrieves + * information about a project. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String groupName, String serviceName, String projectName, 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * The project resource is a nested resource representing a stored migration project. The GET method retrieves + * information about a project. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String groupName, String serviceName, String projectName) { + return getWithResponseAsync(groupName, serviceName, projectName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The project resource is a nested resource representing a stored migration project. The GET method retrieves + * information about a project. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectInner get(String groupName, String serviceName, String projectName) { + return getAsync(groupName, serviceName, projectName).block(); + } + + /** + * The project resource is a nested resource representing a stored migration project. The GET method retrieves + * information about a project. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String groupName, String serviceName, String projectName, Context context) { + return getWithResponseAsync(groupName, serviceName, projectName, context).block(); + } + + /** + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a + * project. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 groupName, String serviceName, String projectName, Boolean deleteRunningTasks) { + 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + this.client.getApiVersion(), + deleteRunningTasks, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a + * project. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 groupName, String serviceName, String projectName, Boolean deleteRunningTasks, 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + this.client.getApiVersion(), + deleteRunningTasks, + accept, + context); + } + + /** + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a + * project. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 groupName, String serviceName, String projectName, Boolean deleteRunningTasks) { + return deleteWithResponseAsync(groupName, serviceName, projectName, deleteRunningTasks) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a + * project. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 groupName, String serviceName, String projectName) { + final Boolean deleteRunningTasks = null; + return deleteWithResponseAsync(groupName, serviceName, projectName, deleteRunningTasks) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a + * project. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 groupName, String serviceName, String projectName) { + final Boolean deleteRunningTasks = null; + deleteAsync(groupName, serviceName, projectName, deleteRunningTasks).block(); + } + + /** + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a + * project. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String groupName, String serviceName, String projectName, Boolean deleteRunningTasks, Context context) { + return deleteWithResponseAsync(groupName, serviceName, projectName, deleteRunningTasks, context).block(); + } + + /** + * The project resource is a nested resource representing a stored migration project. The PATCH method updates an + * existing project. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param parameters Information about the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String groupName, String serviceName, String projectName, ProjectInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The project resource is a nested resource representing a stored migration project. The PATCH method updates an + * existing project. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param parameters Information about the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String groupName, String serviceName, String projectName, ProjectInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * The project resource is a nested resource representing a stored migration project. The PATCH method updates an + * existing project. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param parameters Information about the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String groupName, String serviceName, String projectName, ProjectInner parameters) { + return updateWithResponseAsync(groupName, serviceName, projectName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The project resource is a nested resource representing a stored migration project. The PATCH method updates an + * existing project. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param parameters Information about the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectInner update(String groupName, String serviceName, String projectName, ProjectInner parameters) { + return updateAsync(groupName, serviceName, projectName, parameters).block(); + } + + /** + * The project resource is a nested resource representing a stored migration project. The PATCH method updates an + * existing project. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param parameters Information about the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String groupName, String serviceName, String projectName, ProjectInner parameters, Context context) { + return updateWithResponseAsync(groupName, serviceName, projectName, 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 oData page of project resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of project resources. + */ + @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/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectsImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectsImpl.java new file mode 100644 index 000000000000..3674cfb721bc --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ProjectsImpl.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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.datamigration.fluent.ProjectsClient; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectInner; +import com.azure.resourcemanager.datamigration.models.Project; +import com.azure.resourcemanager.datamigration.models.Projects; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ProjectsImpl implements Projects { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProjectsImpl.class); + + private final ProjectsClient innerClient; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public ProjectsImpl( + ProjectsClient innerClient, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String groupName, String serviceName) { + PagedIterable inner = this.serviceClient().list(groupName, serviceName); + return Utils.mapPage(inner, inner1 -> new ProjectImpl(inner1, this.manager())); + } + + public PagedIterable list(String groupName, String serviceName, Context context) { + PagedIterable inner = this.serviceClient().list(groupName, serviceName, context); + return Utils.mapPage(inner, inner1 -> new ProjectImpl(inner1, this.manager())); + } + + public Project get(String groupName, String serviceName, String projectName) { + ProjectInner inner = this.serviceClient().get(groupName, serviceName, projectName); + if (inner != null) { + return new ProjectImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String groupName, String serviceName, String projectName, Context context) { + Response inner = + this.serviceClient().getWithResponse(groupName, serviceName, projectName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProjectImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String groupName, String serviceName, String projectName) { + this.serviceClient().delete(groupName, serviceName, projectName); + } + + public Response deleteWithResponse( + String groupName, String serviceName, String projectName, Boolean deleteRunningTasks, Context context) { + return this + .serviceClient() + .deleteWithResponse(groupName, serviceName, projectName, deleteRunningTasks, context); + } + + public Project getById(String id) { + String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (groupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + String projectName = Utils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + return this.getWithResponse(groupName, serviceName, projectName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (groupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + String projectName = Utils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + return this.getWithResponse(groupName, serviceName, projectName, context); + } + + public void deleteById(String id) { + String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (groupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + String projectName = Utils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + Boolean localDeleteRunningTasks = null; + this.deleteWithResponse(groupName, serviceName, projectName, localDeleteRunningTasks, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Boolean deleteRunningTasks, Context context) { + String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (groupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + String projectName = Utils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + return this.deleteWithResponse(groupName, serviceName, projectName, deleteRunningTasks, context); + } + + private ProjectsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + public ProjectImpl define(String name) { + return new ProjectImpl(name, this.manager()); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/QuotaImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/QuotaImpl.java new file mode 100644 index 000000000000..5f904df3bedb --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/QuotaImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.resourcemanager.datamigration.fluent.models.QuotaInner; +import com.azure.resourcemanager.datamigration.models.Quota; +import com.azure.resourcemanager.datamigration.models.QuotaName; + +public final class QuotaImpl implements Quota { + private QuotaInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + QuotaImpl(QuotaInner innerObject, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Double currentValue() { + return this.innerModel().currentValue(); + } + + public String id() { + return this.innerModel().id(); + } + + public Double limit() { + return this.innerModel().limit(); + } + + public QuotaName name() { + return this.innerModel().name(); + } + + public String unit() { + return this.innerModel().unit(); + } + + public QuotaInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ResourceSkuImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ResourceSkuImpl.java new file mode 100644 index 000000000000..3865287ab763 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ResourceSkuImpl.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.resourcemanager.datamigration.fluent.models.ResourceSkuInner; +import com.azure.resourcemanager.datamigration.models.ResourceSku; +import com.azure.resourcemanager.datamigration.models.ResourceSkuCapabilities; +import com.azure.resourcemanager.datamigration.models.ResourceSkuCapacity; +import com.azure.resourcemanager.datamigration.models.ResourceSkuCosts; +import com.azure.resourcemanager.datamigration.models.ResourceSkuRestrictions; +import java.util.Collections; +import java.util.List; + +public final class ResourceSkuImpl implements ResourceSku { + private ResourceSkuInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + ResourceSkuImpl( + ResourceSkuInner innerObject, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public String name() { + return this.innerModel().name(); + } + + public String tier() { + return this.innerModel().tier(); + } + + public String size() { + return this.innerModel().size(); + } + + public String family() { + return this.innerModel().family(); + } + + public String kind() { + return this.innerModel().kind(); + } + + public ResourceSkuCapacity capacity() { + return this.innerModel().capacity(); + } + + 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 costs() { + List inner = this.innerModel().costs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List capabilities() { + List inner = this.innerModel().capabilities(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List restrictions() { + List inner = this.innerModel().restrictions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ResourceSkuInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ResourceSkusClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ResourceSkusClientImpl.java new file mode 100644 index 000000000000..013e663a1c2b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ResourceSkusClientImpl.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.datamigration.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.datamigration.fluent.ResourceSkusClient; +import com.azure.resourcemanager.datamigration.fluent.models.ResourceSkuInner; +import com.azure.resourcemanager.datamigration.models.ResourceSkusResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ResourceSkusClient. */ +public final class ResourceSkusClientImpl implements ResourceSkusClient { + private final ClientLogger logger = new ClientLogger(ResourceSkusClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ResourceSkusService service; + + /** The service client containing this operation class. */ + private final DataMigrationManagementClientImpl client; + + /** + * Initializes an instance of ResourceSkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceSkusClientImpl(DataMigrationManagementClientImpl client) { + this.service = + RestProxy.create(ResourceSkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataMigrationManagementClientResourceSkus to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataMigrationManagem") + private interface ResourceSkusService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSkusNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The skus action returns the list of SKUs that DMS supports. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DMS List SKUs operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The skus action returns the list of SKUs that DMS supports. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DMS List SKUs operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The skus action returns the list of SKUs that DMS supports. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DMS List SKUs operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listSkusNextSinglePageAsync(nextLink)); + } + + /** + * The skus action returns the list of SKUs that DMS supports. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DMS List SKUs operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listSkusNextSinglePageAsync(nextLink, context)); + } + + /** + * The skus action returns the list of SKUs that DMS supports. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DMS List SKUs operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * The skus action returns the list of SKUs that DMS supports. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DMS List SKUs operation response. + */ + @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 DMS List SKUs operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSkusNextSinglePageAsync(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.listSkusNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DMS List SKUs operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSkusNextSinglePageAsync(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 + .listSkusNext(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/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ResourceSkusImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ResourceSkusImpl.java new file mode 100644 index 000000000000..bb4457a04a33 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ResourceSkusImpl.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.datamigration.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.datamigration.fluent.ResourceSkusClient; +import com.azure.resourcemanager.datamigration.fluent.models.ResourceSkuInner; +import com.azure.resourcemanager.datamigration.models.ResourceSku; +import com.azure.resourcemanager.datamigration.models.ResourceSkus; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ResourceSkusImpl implements ResourceSkus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkusImpl.class); + + private final ResourceSkusClient innerClient; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public ResourceSkusImpl( + ResourceSkusClient innerClient, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ResourceSkuImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ResourceSkuImpl(inner1, this.manager())); + } + + private ResourceSkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceOperationImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceOperationImpl.java new file mode 100644 index 000000000000..67bb7306fa12 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceOperationImpl.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.datamigration.implementation; + +import com.azure.resourcemanager.datamigration.fluent.models.ServiceOperationInner; +import com.azure.resourcemanager.datamigration.models.ServiceOperation; +import com.azure.resourcemanager.datamigration.models.ServiceOperationDisplay; + +public final class ServiceOperationImpl implements ServiceOperation { + private ServiceOperationInner innerObject; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + ServiceOperationImpl( + ServiceOperationInner innerObject, + com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public ServiceOperationDisplay display() { + return this.innerModel().display(); + } + + public ServiceOperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceTasksClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceTasksClientImpl.java new file mode 100644 index 000000000000..8d72c52e4bd1 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceTasksClientImpl.java @@ -0,0 +1,1387 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.ServiceTasksClient; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner; +import com.azure.resourcemanager.datamigration.models.TaskList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ServiceTasksClient. */ +public final class ServiceTasksClientImpl implements ServiceTasksClient { + private final ClientLogger logger = new ClientLogger(ServiceTasksClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ServiceTasksService service; + + /** The service client containing this operation class. */ + private final DataMigrationManagementClientImpl client; + + /** + * Initializes an instance of ServiceTasksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServiceTasksClientImpl(DataMigrationManagementClientImpl client) { + this.service = + RestProxy.create(ServiceTasksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataMigrationManagementClientServiceTasks to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataMigrationManagem") + private interface ServiceTasksService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/serviceTasks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @QueryParam("taskType") String taskType, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/serviceTasks/{taskName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("taskName") String taskName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ProjectTaskInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/serviceTasks/{taskName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("taskName") String taskName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/serviceTasks/{taskName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("taskName") String taskName, + @QueryParam("api-version") String apiVersion, + @QueryParam("deleteRunningTasks") Boolean deleteRunningTasks, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/serviceTasks/{taskName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("taskName") String taskName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ProjectTaskInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/serviceTasks/{taskName}/cancel") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> cancel( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("taskName") String taskName, + @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); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service level tasks owned by a service resource. Some tasks may have a status of Unknown, which + * indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskType Filter tasks by task type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String groupName, String serviceName, String taskType) { + 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + this.client.getApiVersion(), + taskType, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service level tasks owned by a service resource. Some tasks may have a status of Unknown, which + * indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskType Filter tasks by task type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String groupName, String serviceName, String taskType, 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName 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(), + groupName, + serviceName, + this.client.getApiVersion(), + taskType, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service level tasks owned by a service resource. Some tasks may have a status of Unknown, which + * indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskType Filter tasks by task type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String groupName, String serviceName, String taskType) { + return new PagedFlux<>( + () -> listSinglePageAsync(groupName, serviceName, taskType), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service level tasks owned by a service resource. Some tasks may have a status of Unknown, which + * indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String groupName, String serviceName) { + final String taskType = null; + return new PagedFlux<>( + () -> listSinglePageAsync(groupName, serviceName, taskType), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service level tasks owned by a service resource. Some tasks may have a status of Unknown, which + * indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskType Filter tasks by task type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String groupName, String serviceName, String taskType, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(groupName, serviceName, taskType, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service level tasks owned by a service resource. Some tasks may have a status of Unknown, which + * indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String groupName, String serviceName) { + final String taskType = null; + return new PagedIterable<>(listAsync(groupName, serviceName, taskType)); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service level tasks owned by a service resource. Some tasks may have a status of Unknown, which + * indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskType Filter tasks by task type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String groupName, String serviceName, String taskType, Context context) { + return new PagedIterable<>(listAsync(groupName, serviceName, taskType, context)); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PUT method creates a new service task or updates an existing one, although since service tasks have no mutable + * custom properties, there is little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + taskName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PUT method creates a new service task or updates an existing one, although since service tasks have no mutable + * custom properties, there is little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + taskName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PUT method creates a new service task or updates an existing one, although since service tasks have no mutable + * custom properties, there is little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters) { + return createOrUpdateWithResponseAsync(groupName, serviceName, taskName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PUT method creates a new service task or updates an existing one, although since service tasks have no mutable + * custom properties, there is little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectTaskInner createOrUpdate( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters) { + return createOrUpdateAsync(groupName, serviceName, taskName, parameters).block(); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PUT method creates a new service task or updates an existing one, although since service tasks have no mutable + * custom properties, there is little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters, Context context) { + return createOrUpdateWithResponseAsync(groupName, serviceName, taskName, parameters, context).block(); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * GET method retrieves information about a service task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param expand Expand the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String groupName, String serviceName, String taskName, 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + taskName, + this.client.getApiVersion(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * GET method retrieves information about a service task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param expand Expand the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String groupName, String serviceName, String taskName, 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + taskName, + this.client.getApiVersion(), + expand, + accept, + context); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * GET method retrieves information about a service task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param expand Expand the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String groupName, String serviceName, String taskName, String expand) { + return getWithResponseAsync(groupName, serviceName, taskName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * GET method retrieves information about a service task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String groupName, String serviceName, String taskName) { + final String expand = null; + return getWithResponseAsync(groupName, serviceName, taskName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * GET method retrieves information about a service task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectTaskInner get(String groupName, String serviceName, String taskName) { + final String expand = null; + return getAsync(groupName, serviceName, taskName, expand).block(); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * GET method retrieves information about a service task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param expand Expand the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String groupName, String serviceName, String taskName, String expand, Context context) { + return getWithResponseAsync(groupName, serviceName, taskName, expand, context).block(); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * DELETE method deletes a service task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 groupName, String serviceName, String taskName, Boolean deleteRunningTasks) { + 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + taskName, + this.client.getApiVersion(), + deleteRunningTasks, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * DELETE method deletes a service task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 groupName, String serviceName, String taskName, Boolean deleteRunningTasks, 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + taskName, + this.client.getApiVersion(), + deleteRunningTasks, + accept, + context); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * DELETE method deletes a service task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 groupName, String serviceName, String taskName, Boolean deleteRunningTasks) { + return deleteWithResponseAsync(groupName, serviceName, taskName, deleteRunningTasks) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * DELETE method deletes a service task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 groupName, String serviceName, String taskName) { + final Boolean deleteRunningTasks = null; + return deleteWithResponseAsync(groupName, serviceName, taskName, deleteRunningTasks) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * DELETE method deletes a service task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 groupName, String serviceName, String taskName) { + final Boolean deleteRunningTasks = null; + deleteAsync(groupName, serviceName, taskName, deleteRunningTasks).block(); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * DELETE method deletes a service task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String groupName, String serviceName, String taskName, Boolean deleteRunningTasks, Context context) { + return deleteWithResponseAsync(groupName, serviceName, taskName, deleteRunningTasks, context).block(); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there + * is little reason to do so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + taskName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there + * is little reason to do so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + taskName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there + * is little reason to do so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters) { + return updateWithResponseAsync(groupName, serviceName, taskName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there + * is little reason to do so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectTaskInner update(String groupName, String serviceName, String taskName, ProjectTaskInner parameters) { + return updateAsync(groupName, serviceName, taskName, parameters).block(); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there + * is little reason to do so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters, Context context) { + return updateWithResponseAsync(groupName, serviceName, taskName, parameters, context).block(); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This + * method cancels a service task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> cancelWithResponseAsync( + String groupName, String serviceName, String taskName) { + 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .cancel( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + taskName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This + * method cancels a service task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> cancelWithResponseAsync( + String groupName, String serviceName, String taskName, 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .cancel( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + taskName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This + * method cancels a service task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync(String groupName, String serviceName, String taskName) { + return cancelWithResponseAsync(groupName, serviceName, taskName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This + * method cancels a service task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectTaskInner cancel(String groupName, String serviceName, String taskName) { + return cancelAsync(groupName, serviceName, taskName).block(); + } + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This + * method cancels a service task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response cancelWithResponse( + String groupName, String serviceName, String taskName, Context context) { + return cancelWithResponseAsync(groupName, serviceName, taskName, 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 oData page of tasks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks. + */ + @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/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceTasksImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceTasksImpl.java new file mode 100644 index 000000000000..3bb4d9b10bc3 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServiceTasksImpl.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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.datamigration.fluent.ServiceTasksClient; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner; +import com.azure.resourcemanager.datamigration.models.ProjectTask; +import com.azure.resourcemanager.datamigration.models.ServiceTasks; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ServiceTasksImpl implements ServiceTasks { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceTasksImpl.class); + + private final ServiceTasksClient innerClient; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public ServiceTasksImpl( + ServiceTasksClient innerClient, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String groupName, String serviceName) { + PagedIterable inner = this.serviceClient().list(groupName, serviceName); + return Utils.mapPage(inner, inner1 -> new ProjectTaskImpl(inner1, this.manager())); + } + + public PagedIterable list(String groupName, String serviceName, String taskType, Context context) { + PagedIterable inner = this.serviceClient().list(groupName, serviceName, taskType, context); + return Utils.mapPage(inner, inner1 -> new ProjectTaskImpl(inner1, this.manager())); + } + + public ProjectTask createOrUpdate( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters) { + ProjectTaskInner inner = this.serviceClient().createOrUpdate(groupName, serviceName, taskName, parameters); + if (inner != null) { + return new ProjectTaskImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters, Context context) { + Response inner = + this.serviceClient().createOrUpdateWithResponse(groupName, serviceName, taskName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProjectTaskImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ProjectTask get(String groupName, String serviceName, String taskName) { + ProjectTaskInner inner = this.serviceClient().get(groupName, serviceName, taskName); + if (inner != null) { + return new ProjectTaskImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String groupName, String serviceName, String taskName, String expand, Context context) { + Response inner = + this.serviceClient().getWithResponse(groupName, serviceName, taskName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProjectTaskImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String groupName, String serviceName, String taskName) { + this.serviceClient().delete(groupName, serviceName, taskName); + } + + public Response deleteWithResponse( + String groupName, String serviceName, String taskName, Boolean deleteRunningTasks, Context context) { + return this.serviceClient().deleteWithResponse(groupName, serviceName, taskName, deleteRunningTasks, context); + } + + public ProjectTask update(String groupName, String serviceName, String taskName, ProjectTaskInner parameters) { + ProjectTaskInner inner = this.serviceClient().update(groupName, serviceName, taskName, parameters); + if (inner != null) { + return new ProjectTaskImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateWithResponse( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters, Context context) { + Response inner = + this.serviceClient().updateWithResponse(groupName, serviceName, taskName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProjectTaskImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ProjectTask cancel(String groupName, String serviceName, String taskName) { + ProjectTaskInner inner = this.serviceClient().cancel(groupName, serviceName, taskName); + if (inner != null) { + return new ProjectTaskImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response cancelWithResponse( + String groupName, String serviceName, String taskName, Context context) { + Response inner = + this.serviceClient().cancelWithResponse(groupName, serviceName, taskName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProjectTaskImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ServiceTasksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServicesClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServicesClientImpl.java new file mode 100644 index 000000000000..c544f1b85154 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServicesClientImpl.java @@ -0,0 +1,2987 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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.datamigration.fluent.ServicesClient; +import com.azure.resourcemanager.datamigration.fluent.models.AvailableServiceSkuInner; +import com.azure.resourcemanager.datamigration.fluent.models.DataMigrationServiceInner; +import com.azure.resourcemanager.datamigration.fluent.models.DataMigrationServiceStatusResponseInner; +import com.azure.resourcemanager.datamigration.fluent.models.NameAvailabilityResponseInner; +import com.azure.resourcemanager.datamigration.models.DataMigrationServiceList; +import com.azure.resourcemanager.datamigration.models.NameAvailabilityRequest; +import com.azure.resourcemanager.datamigration.models.ServiceSkuList; +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 ServicesClient. */ +public final class ServicesClientImpl implements ServicesClient { + private final ClientLogger logger = new ClientLogger(ServicesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ServicesService service; + + /** The service client containing this operation class. */ + private final DataMigrationManagementClientImpl client; + + /** + * Initializes an instance of ServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServicesClientImpl(DataMigrationManagementClientImpl client) { + this.service = RestProxy.create(ServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataMigrationManagementClientServices to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataMigrationManagem") + private interface ServicesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DataMigrationServiceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @QueryParam("deleteRunningTasks") Boolean deleteRunningTasks, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DataMigrationServiceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/checkStatus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkStatus( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/stop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSkus( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkChildrenNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @QueryParam("api-version") String apiVersion, + @PathParam("serviceName") String serviceName, + @BodyParam("application/json") NameAvailabilityRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/services") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/locations/{location}" + + "/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NameAvailabilityRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSkusNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PUT method + * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. + * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, + * although other kinds may be added in the future. This method can change the kind, SKU, and network of the + * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations + * use the provisioningState property. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String groupName, String serviceName, DataMigrationServiceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PUT method + * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. + * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, + * although other kinds may be added in the future. This method can change the kind, SKU, and network of the + * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations + * use the provisioningState property. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String groupName, String serviceName, DataMigrationServiceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PUT method + * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. + * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, + * although other kinds may be added in the future. This method can change the kind, SKU, and network of the + * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations + * use the provisioningState property. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataMigrationServiceInner> beginCreateOrUpdateAsync( + String groupName, String serviceName, DataMigrationServiceInner parameters) { + Mono>> mono = createOrUpdateWithResponseAsync(groupName, serviceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DataMigrationServiceInner.class, + DataMigrationServiceInner.class, + Context.NONE); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PUT method + * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. + * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, + * although other kinds may be added in the future. This method can change the kind, SKU, and network of the + * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations + * use the provisioningState property. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataMigrationServiceInner> beginCreateOrUpdateAsync( + String groupName, String serviceName, DataMigrationServiceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(groupName, serviceName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DataMigrationServiceInner.class, + DataMigrationServiceInner.class, + context); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PUT method + * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. + * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, + * although other kinds may be added in the future. This method can change the kind, SKU, and network of the + * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations + * use the provisioningState property. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataMigrationServiceInner> beginCreateOrUpdate( + String groupName, String serviceName, DataMigrationServiceInner parameters) { + return beginCreateOrUpdateAsync(groupName, serviceName, parameters).getSyncPoller(); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PUT method + * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. + * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, + * although other kinds may be added in the future. This method can change the kind, SKU, and network of the + * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations + * use the provisioningState property. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataMigrationServiceInner> beginCreateOrUpdate( + String groupName, String serviceName, DataMigrationServiceInner parameters, Context context) { + return beginCreateOrUpdateAsync(groupName, serviceName, parameters, context).getSyncPoller(); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PUT method + * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. + * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, + * although other kinds may be added in the future. This method can change the kind, SKU, and network of the + * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations + * use the provisioningState property. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String groupName, String serviceName, DataMigrationServiceInner parameters) { + return beginCreateOrUpdateAsync(groupName, serviceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PUT method + * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. + * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, + * although other kinds may be added in the future. This method can change the kind, SKU, and network of the + * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations + * use the provisioningState property. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String groupName, String serviceName, DataMigrationServiceInner parameters, Context context) { + return beginCreateOrUpdateAsync(groupName, serviceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PUT method + * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. + * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, + * although other kinds may be added in the future. This method can change the kind, SKU, and network of the + * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations + * use the provisioningState property. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataMigrationServiceInner createOrUpdate( + String groupName, String serviceName, DataMigrationServiceInner parameters) { + return createOrUpdateAsync(groupName, serviceName, parameters).block(); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PUT method + * creates a new service or updates an existing one. When a service is updated, existing child resources (i.e. + * tasks) are unaffected. Services currently support a single kind, "vm", which refers to a VM-based service, + * although other kinds may be added in the future. This method can change the kind, SKU, and network of the + * service, but if tasks are currently running (i.e. the service is busy), this will fail with 400 Bad Request + * ("ServiceIsBusy"). The provider will reply when successful with 200 OK or 201 Created. Long-running operations + * use the provisioningState property. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataMigrationServiceInner createOrUpdate( + String groupName, String serviceName, DataMigrationServiceInner parameters, Context context) { + return createOrUpdateAsync(groupName, serviceName, parameters, context).block(); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The GET method + * retrieves information about a service instance. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String groupName, String serviceName) { + 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The GET method + * retrieves information about a service instance. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String groupName, String serviceName, 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The GET method + * retrieves information about a service instance. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String groupName, String serviceName) { + return getByResourceGroupWithResponseAsync(groupName, serviceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The GET method + * retrieves information about a service instance. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataMigrationServiceInner getByResourceGroup(String groupName, String serviceName) { + return getByResourceGroupAsync(groupName, serviceName).block(); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The GET method + * retrieves information about a service instance. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String groupName, String serviceName, Context context) { + return getByResourceGroupWithResponseAsync(groupName, serviceName, context).block(); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method + * deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 groupName, String serviceName, Boolean deleteRunningTasks) { + 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + this.client.getApiVersion(), + deleteRunningTasks, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method + * deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 groupName, String serviceName, Boolean deleteRunningTasks, 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + this.client.getApiVersion(), + deleteRunningTasks, + accept, + context); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method + * deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 groupName, String serviceName, Boolean deleteRunningTasks) { + Mono>> mono = deleteWithResponseAsync(groupName, serviceName, deleteRunningTasks); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method + * deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 groupName, String serviceName, Boolean deleteRunningTasks, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(groupName, serviceName, deleteRunningTasks, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method + * deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 groupName, String serviceName, Boolean deleteRunningTasks) { + return beginDeleteAsync(groupName, serviceName, deleteRunningTasks).getSyncPoller(); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method + * deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 groupName, String serviceName, Boolean deleteRunningTasks, Context context) { + return beginDeleteAsync(groupName, serviceName, deleteRunningTasks, context).getSyncPoller(); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method + * deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 groupName, String serviceName, Boolean deleteRunningTasks) { + return beginDeleteAsync(groupName, serviceName, deleteRunningTasks) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method + * deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String groupName, String serviceName) { + final Boolean deleteRunningTasks = null; + return beginDeleteAsync(groupName, serviceName, deleteRunningTasks) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method + * deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 groupName, String serviceName, Boolean deleteRunningTasks, Context context) { + return beginDeleteAsync(groupName, serviceName, deleteRunningTasks, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method + * deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 groupName, String serviceName, Boolean deleteRunningTasks) { + deleteAsync(groupName, serviceName, deleteRunningTasks).block(); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method + * deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String groupName, String serviceName) { + final Boolean deleteRunningTasks = null; + deleteAsync(groupName, serviceName, deleteRunningTasks).block(); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method + * deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 groupName, String serviceName, Boolean deleteRunningTasks, Context context) { + deleteAsync(groupName, serviceName, deleteRunningTasks, context).block(); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method + * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are + * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String groupName, String serviceName, DataMigrationServiceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method + * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are + * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String groupName, String serviceName, DataMigrationServiceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method + * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are + * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataMigrationServiceInner> beginUpdateAsync( + String groupName, String serviceName, DataMigrationServiceInner parameters) { + Mono>> mono = updateWithResponseAsync(groupName, serviceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DataMigrationServiceInner.class, + DataMigrationServiceInner.class, + Context.NONE); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method + * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are + * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DataMigrationServiceInner> beginUpdateAsync( + String groupName, String serviceName, DataMigrationServiceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(groupName, serviceName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DataMigrationServiceInner.class, + DataMigrationServiceInner.class, + context); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method + * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are + * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataMigrationServiceInner> beginUpdate( + String groupName, String serviceName, DataMigrationServiceInner parameters) { + return beginUpdateAsync(groupName, serviceName, parameters).getSyncPoller(); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method + * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are + * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DataMigrationServiceInner> beginUpdate( + String groupName, String serviceName, DataMigrationServiceInner parameters, Context context) { + return beginUpdateAsync(groupName, serviceName, parameters, context).getSyncPoller(); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method + * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are + * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String groupName, String serviceName, DataMigrationServiceInner parameters) { + return beginUpdateAsync(groupName, serviceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method + * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are + * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String groupName, String serviceName, DataMigrationServiceInner parameters, Context context) { + return beginUpdateAsync(groupName, serviceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method + * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are + * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataMigrationServiceInner update( + String groupName, String serviceName, DataMigrationServiceInner parameters) { + return updateAsync(groupName, serviceName, parameters).block(); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The PATCH method + * updates an existing service. This method can change the kind, SKU, and network of the service, but if tasks are + * currently running (i.e. the service is busy), this will fail with 400 Bad Request ("ServiceIsBusy"). + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Information about the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataMigrationServiceInner update( + String groupName, String serviceName, DataMigrationServiceInner parameters, Context context) { + return updateAsync(groupName, serviceName, parameters, context).block(); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * performs a health check and returns the status of the service and virtual machine size. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service health status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkStatusWithResponseAsync( + String groupName, String serviceName) { + 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkStatus( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * performs a health check and returns the status of the service and virtual machine size. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service health status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkStatusWithResponseAsync( + String groupName, String serviceName, 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkStatus( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * performs a health check and returns the status of the service and virtual machine size. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service health status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkStatusAsync(String groupName, String serviceName) { + return checkStatusWithResponseAsync(groupName, serviceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * performs a health check and returns the status of the service and virtual machine size. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service health status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataMigrationServiceStatusResponseInner checkStatus(String groupName, String serviceName) { + return checkStatusAsync(groupName, serviceName).block(); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * performs a health check and returns the status of the service and virtual machine size. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service health status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkStatusWithResponse( + String groupName, String serviceName, Context context) { + return checkStatusWithResponseAsync(groupName, serviceName, context).block(); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync(String groupName, String serviceName) { + 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String groupName, String serviceName, 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStartAsync(String groupName, String serviceName) { + Mono>> mono = startWithResponseAsync(groupName, serviceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStartAsync(String groupName, String serviceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = startWithResponseAsync(groupName, serviceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStart(String groupName, String serviceName) { + return beginStartAsync(groupName, serviceName).getSyncPoller(); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStart(String groupName, String serviceName, Context context) { + return beginStartAsync(groupName, serviceName, context).getSyncPoller(); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String groupName, String serviceName) { + return beginStartAsync(groupName, serviceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String groupName, String serviceName, Context context) { + return beginStartAsync(groupName, serviceName, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String groupName, String serviceName) { + startAsync(groupName, serviceName).block(); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String groupName, String serviceName, Context context) { + startAsync(groupName, serviceName, context).block(); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action stops + * the service and the service cannot be used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync(String groupName, String serviceName) { + 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action stops + * the service and the service cannot be used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync( + String groupName, String serviceName, 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stop( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action stops + * the service and the service cannot be used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStopAsync(String groupName, String serviceName) { + Mono>> mono = stopWithResponseAsync(groupName, serviceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action stops + * the service and the service cannot be used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStopAsync(String groupName, String serviceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = stopWithResponseAsync(groupName, serviceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action stops + * the service and the service cannot be used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStop(String groupName, String serviceName) { + return beginStopAsync(groupName, serviceName).getSyncPoller(); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action stops + * the service and the service cannot be used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStop(String groupName, String serviceName, Context context) { + return beginStopAsync(groupName, serviceName, context).getSyncPoller(); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action stops + * the service and the service cannot be used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String groupName, String serviceName) { + return beginStopAsync(groupName, serviceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action stops + * the service and the service cannot be used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String groupName, String serviceName, Context context) { + return beginStopAsync(groupName, serviceName, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action stops + * the service and the service cannot be used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String groupName, String serviceName) { + stopAsync(groupName, serviceName).block(); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action stops + * the service and the service cannot be used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String groupName, String serviceName, Context context) { + stopAsync(groupName, serviceName, context).block(); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The skus action + * returns the list of SKUs that a service resource can be updated to. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of available SKUs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSkusSinglePageAsync( + String groupName, String serviceName) { + 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSkus( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The skus action + * returns the list of SKUs that a service resource can be updated to. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of available SKUs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSkusSinglePageAsync( + String groupName, String serviceName, 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listSkus( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The skus action + * returns the list of SKUs that a service resource can be updated to. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of available SKUs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listSkusAsync(String groupName, String serviceName) { + return new PagedFlux<>( + () -> listSkusSinglePageAsync(groupName, serviceName), nextLink -> listSkusNextSinglePageAsync(nextLink)); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The skus action + * returns the list of SKUs that a service resource can be updated to. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of available SKUs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listSkusAsync(String groupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listSkusSinglePageAsync(groupName, serviceName, context), + nextLink -> listSkusNextSinglePageAsync(nextLink, context)); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The skus action + * returns the list of SKUs that a service resource can be updated to. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of available SKUs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSkus(String groupName, String serviceName) { + return new PagedIterable<>(listSkusAsync(groupName, serviceName)); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The skus action + * returns the list of SKUs that a service resource can be updated to. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of available SKUs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSkus(String groupName, String serviceName, Context context) { + return new PagedIterable<>(listSkusAsync(groupName, serviceName, context)); + } + + /** + * This method checks whether a proposed nested resource name is valid and available. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Requested name to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return indicates whether a proposed resource name is available. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkChildrenNameAvailabilityWithResponseAsync( + String groupName, String serviceName, NameAvailabilityRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName 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 + .checkChildrenNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + this.client.getApiVersion(), + serviceName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This method checks whether a proposed nested resource name is valid and available. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Requested name to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return indicates whether a proposed resource name is available. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkChildrenNameAvailabilityWithResponseAsync( + String groupName, String serviceName, NameAvailabilityRequest parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName 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 + .checkChildrenNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + this.client.getApiVersion(), + serviceName, + parameters, + accept, + context); + } + + /** + * This method checks whether a proposed nested resource name is valid and available. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Requested name to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return indicates whether a proposed resource name is available. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkChildrenNameAvailabilityAsync( + String groupName, String serviceName, NameAvailabilityRequest parameters) { + return checkChildrenNameAvailabilityWithResponseAsync(groupName, serviceName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * This method checks whether a proposed nested resource name is valid and available. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Requested name to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return indicates whether a proposed resource name is available. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NameAvailabilityResponseInner checkChildrenNameAvailability( + String groupName, String serviceName, NameAvailabilityRequest parameters) { + return checkChildrenNameAvailabilityAsync(groupName, serviceName, parameters).block(); + } + + /** + * This method checks whether a proposed nested resource name is valid and available. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Requested name to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return indicates whether a proposed resource name is available. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkChildrenNameAvailabilityWithResponse( + String groupName, String serviceName, NameAvailabilityRequest parameters, Context context) { + return checkChildrenNameAvailabilityWithResponseAsync(groupName, serviceName, parameters, context).block(); + } + + /** + * The Services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service resources in a resource group. + * + * @param groupName Name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of service objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String groupName) { + 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The Services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service resources in a resource group. + * + * @param groupName Name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of service objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String groupName, 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName 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(), + groupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The Services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service resources in a resource group. + * + * @param groupName Name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of service objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String groupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(groupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * The Services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service resources in a resource group. + * + * @param groupName Name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of service objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String groupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(groupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * The Services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service resources in a resource group. + * + * @param groupName Name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of service objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String groupName) { + return new PagedIterable<>(listByResourceGroupAsync(groupName)); + } + + /** + * The Services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service resources in a resource group. + * + * @param groupName Name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of service objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String groupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(groupName, context)); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service resources 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 oData page of service objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of service objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service resources 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 oData page of service objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of service objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service resources 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 oData page of service objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of service objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * This method checks whether a proposed top-level resource name is valid and available. + * + * @param location The Azure region of the operation. + * @param parameters Requested name to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return indicates whether a proposed resource name is available. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String location, NameAvailabilityRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This method checks whether a proposed top-level resource name is valid and available. + * + * @param location The Azure region of the operation. + * @param parameters Requested name to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return indicates whether a proposed resource name is available. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String location, NameAvailabilityRequest parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * This method checks whether a proposed top-level resource name is valid and available. + * + * @param location The Azure region of the operation. + * @param parameters Requested name to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return indicates whether a proposed resource name is available. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String location, NameAvailabilityRequest parameters) { + return checkNameAvailabilityWithResponseAsync(location, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * This method checks whether a proposed top-level resource name is valid and available. + * + * @param location The Azure region of the operation. + * @param parameters Requested name to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return indicates whether a proposed resource name is available. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NameAvailabilityResponseInner checkNameAvailability(String location, NameAvailabilityRequest parameters) { + return checkNameAvailabilityAsync(location, parameters).block(); + } + + /** + * This method checks whether a proposed top-level resource name is valid and available. + * + * @param location The Azure region of the operation. + * @param parameters Requested name to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return indicates whether a proposed resource name is available. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String location, NameAvailabilityRequest parameters, Context context) { + return checkNameAvailabilityWithResponseAsync(location, parameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of available SKUs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSkusNextSinglePageAsync(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.listSkusNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of available SKUs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSkusNextSinglePageAsync( + 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 + .listSkusNext(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 oData page of service objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of service objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of service objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of service objects. + */ + @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/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServicesImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServicesImpl.java new file mode 100644 index 000000000000..796e42cd7b30 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/ServicesImpl.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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.datamigration.fluent.ServicesClient; +import com.azure.resourcemanager.datamigration.fluent.models.AvailableServiceSkuInner; +import com.azure.resourcemanager.datamigration.fluent.models.DataMigrationServiceInner; +import com.azure.resourcemanager.datamigration.fluent.models.DataMigrationServiceStatusResponseInner; +import com.azure.resourcemanager.datamigration.fluent.models.NameAvailabilityResponseInner; +import com.azure.resourcemanager.datamigration.models.AvailableServiceSku; +import com.azure.resourcemanager.datamigration.models.DataMigrationService; +import com.azure.resourcemanager.datamigration.models.DataMigrationServiceStatusResponse; +import com.azure.resourcemanager.datamigration.models.NameAvailabilityRequest; +import com.azure.resourcemanager.datamigration.models.NameAvailabilityResponse; +import com.azure.resourcemanager.datamigration.models.Services; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ServicesImpl implements Services { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServicesImpl.class); + + private final ServicesClient innerClient; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public ServicesImpl( + ServicesClient innerClient, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public DataMigrationService getByResourceGroup(String groupName, String serviceName) { + DataMigrationServiceInner inner = this.serviceClient().getByResourceGroup(groupName, serviceName); + if (inner != null) { + return new DataMigrationServiceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String groupName, String serviceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(groupName, serviceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DataMigrationServiceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String groupName, String serviceName, Boolean deleteRunningTasks) { + this.serviceClient().delete(groupName, serviceName, deleteRunningTasks); + } + + public void delete(String groupName, String serviceName) { + this.serviceClient().delete(groupName, serviceName); + } + + public void delete(String groupName, String serviceName, Boolean deleteRunningTasks, Context context) { + this.serviceClient().delete(groupName, serviceName, deleteRunningTasks, context); + } + + public DataMigrationServiceStatusResponse checkStatus(String groupName, String serviceName) { + DataMigrationServiceStatusResponseInner inner = this.serviceClient().checkStatus(groupName, serviceName); + if (inner != null) { + return new DataMigrationServiceStatusResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkStatusWithResponse( + String groupName, String serviceName, Context context) { + Response inner = + this.serviceClient().checkStatusWithResponse(groupName, serviceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DataMigrationServiceStatusResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void start(String groupName, String serviceName) { + this.serviceClient().start(groupName, serviceName); + } + + public void start(String groupName, String serviceName, Context context) { + this.serviceClient().start(groupName, serviceName, context); + } + + public void stop(String groupName, String serviceName) { + this.serviceClient().stop(groupName, serviceName); + } + + public void stop(String groupName, String serviceName, Context context) { + this.serviceClient().stop(groupName, serviceName, context); + } + + public PagedIterable listSkus(String groupName, String serviceName) { + PagedIterable inner = this.serviceClient().listSkus(groupName, serviceName); + return Utils.mapPage(inner, inner1 -> new AvailableServiceSkuImpl(inner1, this.manager())); + } + + public PagedIterable listSkus(String groupName, String serviceName, Context context) { + PagedIterable inner = this.serviceClient().listSkus(groupName, serviceName, context); + return Utils.mapPage(inner, inner1 -> new AvailableServiceSkuImpl(inner1, this.manager())); + } + + public NameAvailabilityResponse checkChildrenNameAvailability( + String groupName, String serviceName, NameAvailabilityRequest parameters) { + NameAvailabilityResponseInner inner = + this.serviceClient().checkChildrenNameAvailability(groupName, serviceName, parameters); + if (inner != null) { + return new NameAvailabilityResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkChildrenNameAvailabilityWithResponse( + String groupName, String serviceName, NameAvailabilityRequest parameters, Context context) { + Response inner = + this.serviceClient().checkChildrenNameAvailabilityWithResponse(groupName, serviceName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NameAvailabilityResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String groupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(groupName); + return Utils.mapPage(inner, inner1 -> new DataMigrationServiceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String groupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(groupName, context); + return Utils.mapPage(inner, inner1 -> new DataMigrationServiceImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new DataMigrationServiceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new DataMigrationServiceImpl(inner1, this.manager())); + } + + public NameAvailabilityResponse checkNameAvailability(String location, NameAvailabilityRequest parameters) { + NameAvailabilityResponseInner inner = this.serviceClient().checkNameAvailability(location, parameters); + if (inner != null) { + return new NameAvailabilityResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + String location, NameAvailabilityRequest parameters, Context context) { + Response inner = + this.serviceClient().checkNameAvailabilityWithResponse(location, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NameAvailabilityResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DataMigrationService getById(String id) { + String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (groupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + return this.getByResourceGroupWithResponse(groupName, serviceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (groupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + return this.getByResourceGroupWithResponse(groupName, serviceName, context); + } + + public void deleteById(String id) { + String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (groupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + Boolean localDeleteRunningTasks = null; + this.delete(groupName, serviceName, localDeleteRunningTasks, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Boolean deleteRunningTasks, Context context) { + String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (groupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + this.delete(groupName, serviceName, deleteRunningTasks, context); + } + + private ServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + public DataMigrationServiceImpl define(String name) { + return new DataMigrationServiceImpl(name, this.manager()); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/TasksClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/TasksClientImpl.java new file mode 100644 index 000000000000..9c9bf90ad7ea --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/TasksClientImpl.java @@ -0,0 +1,1739 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.TasksClient; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner; +import com.azure.resourcemanager.datamigration.models.TaskList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in TasksClient. */ +public final class TasksClientImpl implements TasksClient { + private final ClientLogger logger = new ClientLogger(TasksClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final TasksService service; + + /** The service client containing this operation class. */ + private final DataMigrationManagementClientImpl client; + + /** + * Initializes an instance of TasksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TasksClientImpl(DataMigrationManagementClientImpl client) { + this.service = RestProxy.create(TasksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataMigrationManagementClientTasks to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataMigrationManagem") + private interface TasksService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects/{projectName}/tasks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("projectName") String projectName, + @QueryParam("api-version") String apiVersion, + @QueryParam("taskType") String taskType, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects/{projectName}/tasks/{taskName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("projectName") String projectName, + @PathParam("taskName") String taskName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ProjectTaskInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects/{projectName}/tasks/{taskName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("projectName") String projectName, + @PathParam("taskName") String taskName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects/{projectName}/tasks/{taskName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("projectName") String projectName, + @PathParam("taskName") String taskName, + @QueryParam("api-version") String apiVersion, + @QueryParam("deleteRunningTasks") Boolean deleteRunningTasks, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects/{projectName}/tasks/{taskName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("projectName") String projectName, + @PathParam("taskName") String taskName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ProjectTaskInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects/{projectName}/tasks/{taskName}/cancel") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> cancel( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("projectName") String projectName, + @PathParam("taskName") String taskName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services" + + "/{serviceName}/projects/{projectName}/tasks/{taskName}/command") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> command( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupName") String groupName, + @PathParam("serviceName") String serviceName, + @PathParam("projectName") String projectName, + @PathParam("taskName") String taskName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CommandPropertiesInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates + * that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskType Filter tasks by task type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String groupName, String serviceName, String projectName, String taskType) { + 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + this.client.getApiVersion(), + taskType, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates + * that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskType Filter tasks by task type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String groupName, String serviceName, String projectName, String taskType, 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName 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(), + groupName, + serviceName, + projectName, + this.client.getApiVersion(), + taskType, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates + * that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskType Filter tasks by task type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String groupName, String serviceName, String projectName, String taskType) { + return new PagedFlux<>( + () -> listSinglePageAsync(groupName, serviceName, projectName, taskType), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates + * that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String groupName, String serviceName, String projectName) { + final String taskType = null; + return new PagedFlux<>( + () -> listSinglePageAsync(groupName, serviceName, projectName, taskType), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates + * that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskType Filter tasks by task type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String groupName, String serviceName, String projectName, String taskType, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(groupName, serviceName, projectName, taskType, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates + * that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String groupName, String serviceName, String projectName) { + final String taskType = null; + return new PagedIterable<>(listAsync(groupName, serviceName, projectName, taskType)); + } + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates + * that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskType Filter tasks by task type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String groupName, String serviceName, String projectName, String taskType, Context context) { + return new PagedIterable<>(listAsync(groupName, serviceName, projectName, taskType, context)); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method + * creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is + * little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + taskName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method + * creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is + * little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String groupName, + String serviceName, + String projectName, + String taskName, + ProjectTaskInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + taskName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method + * creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is + * little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters) { + return createOrUpdateWithResponseAsync(groupName, serviceName, projectName, taskName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method + * creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is + * little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectTaskInner createOrUpdate( + String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters) { + return createOrUpdateAsync(groupName, serviceName, projectName, taskName, parameters).block(); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT method + * creates a new task or updates an existing one, although since tasks have no mutable custom properties, there is + * little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String groupName, + String serviceName, + String projectName, + String taskName, + ProjectTaskInner parameters, + Context context) { + return createOrUpdateWithResponseAsync(groupName, serviceName, projectName, taskName, parameters, context) + .block(); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method + * retrieves information about a task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param expand Expand the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String groupName, String serviceName, String projectName, String taskName, 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + taskName, + this.client.getApiVersion(), + expand, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method + * retrieves information about a task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param expand Expand the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String groupName, String serviceName, String projectName, String taskName, 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + taskName, + this.client.getApiVersion(), + expand, + accept, + context); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method + * retrieves information about a task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param expand Expand the response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String groupName, String serviceName, String projectName, String taskName, String expand) { + return getWithResponseAsync(groupName, serviceName, projectName, taskName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method + * retrieves information about a task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String groupName, String serviceName, String projectName, String taskName) { + final String expand = null; + return getWithResponseAsync(groupName, serviceName, projectName, taskName, expand) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method + * retrieves information about a task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectTaskInner get(String groupName, String serviceName, String projectName, String taskName) { + final String expand = null; + return getAsync(groupName, serviceName, projectName, taskName, expand).block(); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method + * retrieves information about a task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param expand Expand the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String groupName, String serviceName, String projectName, String taskName, String expand, Context context) { + return getWithResponseAsync(groupName, serviceName, projectName, taskName, expand, context).block(); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE + * method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 groupName, String serviceName, String projectName, String taskName, Boolean deleteRunningTasks) { + 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + taskName, + this.client.getApiVersion(), + deleteRunningTasks, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE + * method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 groupName, + String serviceName, + String projectName, + String taskName, + Boolean deleteRunningTasks, + 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + taskName, + this.client.getApiVersion(), + deleteRunningTasks, + accept, + context); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE + * method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 groupName, String serviceName, String projectName, String taskName, Boolean deleteRunningTasks) { + return deleteWithResponseAsync(groupName, serviceName, projectName, taskName, deleteRunningTasks) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE + * method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 groupName, String serviceName, String projectName, String taskName) { + final Boolean deleteRunningTasks = null; + return deleteWithResponseAsync(groupName, serviceName, projectName, taskName, deleteRunningTasks) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE + * method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 groupName, String serviceName, String projectName, String taskName) { + final Boolean deleteRunningTasks = null; + deleteAsync(groupName, serviceName, projectName, taskName, deleteRunningTasks).block(); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE + * method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String groupName, + String serviceName, + String projectName, + String taskName, + Boolean deleteRunningTasks, + Context context) { + return deleteWithResponseAsync(groupName, serviceName, projectName, taskName, deleteRunningTasks, context) + .block(); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH + * method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do + * so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + taskName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH + * method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do + * so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String groupName, + String serviceName, + String projectName, + String taskName, + ProjectTaskInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + taskName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH + * method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do + * so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters) { + return updateWithResponseAsync(groupName, serviceName, projectName, taskName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH + * method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do + * so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectTaskInner update( + String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters) { + return updateAsync(groupName, serviceName, projectName, taskName, parameters).block(); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH + * method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do + * so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String groupName, + String serviceName, + String projectName, + String taskName, + ProjectTaskInner parameters, + Context context) { + return updateWithResponseAsync(groupName, serviceName, projectName, taskName, parameters, context).block(); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * cancels a task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> cancelWithResponseAsync( + String groupName, String serviceName, String projectName, String taskName) { + 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .cancel( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + taskName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * cancels a task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> cancelWithResponseAsync( + String groupName, String serviceName, String projectName, String taskName, 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 (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .cancel( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + taskName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * cancels a task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync( + String groupName, String serviceName, String projectName, String taskName) { + return cancelWithResponseAsync(groupName, serviceName, projectName, taskName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * cancels a task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectTaskInner cancel(String groupName, String serviceName, String projectName, String taskName) { + return cancelAsync(groupName, serviceName, projectName, taskName).block(); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * cancels a task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 task resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response cancelWithResponse( + String groupName, String serviceName, String projectName, String taskName, Context context) { + return cancelWithResponseAsync(groupName, serviceName, projectName, taskName, context).block(); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * executes a command on a running task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Command to execute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for all types of DMS command properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> commandWithResponseAsync( + String groupName, String serviceName, String projectName, String taskName, CommandPropertiesInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName 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 + .command( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + taskName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * executes a command on a running task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Command to execute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for all types of DMS command properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> commandWithResponseAsync( + String groupName, + String serviceName, + String projectName, + String taskName, + CommandPropertiesInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (projectName == null) { + return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); + } + if (taskName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskName 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 + .command( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + groupName, + serviceName, + projectName, + taskName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * executes a command on a running task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Command to execute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for all types of DMS command properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono commandAsync( + String groupName, String serviceName, String projectName, String taskName, CommandPropertiesInner parameters) { + return commandWithResponseAsync(groupName, serviceName, projectName, taskName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * executes a command on a running task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Command to execute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for all types of DMS command properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CommandPropertiesInner command( + String groupName, String serviceName, String projectName, String taskName, CommandPropertiesInner parameters) { + return commandAsync(groupName, serviceName, projectName, taskName, parameters).block(); + } + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * executes a command on a running task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Command to execute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for all types of DMS command properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response commandWithResponse( + String groupName, + String serviceName, + String projectName, + String taskName, + CommandPropertiesInner parameters, + Context context) { + return commandWithResponseAsync(groupName, serviceName, projectName, taskName, 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 oData page of tasks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks. + */ + @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/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/TasksImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/TasksImpl.java new file mode 100644 index 000000000000..37dfad4176b9 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/TasksImpl.java @@ -0,0 +1,291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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.datamigration.fluent.TasksClient; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner; +import com.azure.resourcemanager.datamigration.models.CommandProperties; +import com.azure.resourcemanager.datamigration.models.ProjectTask; +import com.azure.resourcemanager.datamigration.models.Tasks; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class TasksImpl implements Tasks { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TasksImpl.class); + + private final TasksClient innerClient; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public TasksImpl( + TasksClient innerClient, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String groupName, String serviceName, String projectName) { + PagedIterable inner = this.serviceClient().list(groupName, serviceName, projectName); + return Utils.mapPage(inner, inner1 -> new ProjectTaskImpl(inner1, this.manager())); + } + + public PagedIterable list( + String groupName, String serviceName, String projectName, String taskType, Context context) { + PagedIterable inner = + this.serviceClient().list(groupName, serviceName, projectName, taskType, context); + return Utils.mapPage(inner, inner1 -> new ProjectTaskImpl(inner1, this.manager())); + } + + public ProjectTask get(String groupName, String serviceName, String projectName, String taskName) { + ProjectTaskInner inner = this.serviceClient().get(groupName, serviceName, projectName, taskName); + if (inner != null) { + return new ProjectTaskImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String groupName, String serviceName, String projectName, String taskName, String expand, Context context) { + Response inner = + this.serviceClient().getWithResponse(groupName, serviceName, projectName, taskName, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProjectTaskImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String groupName, String serviceName, String projectName, String taskName) { + this.serviceClient().delete(groupName, serviceName, projectName, taskName); + } + + public Response deleteWithResponse( + String groupName, + String serviceName, + String projectName, + String taskName, + Boolean deleteRunningTasks, + Context context) { + return this + .serviceClient() + .deleteWithResponse(groupName, serviceName, projectName, taskName, deleteRunningTasks, context); + } + + public ProjectTask cancel(String groupName, String serviceName, String projectName, String taskName) { + ProjectTaskInner inner = this.serviceClient().cancel(groupName, serviceName, projectName, taskName); + if (inner != null) { + return new ProjectTaskImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response cancelWithResponse( + String groupName, String serviceName, String projectName, String taskName, Context context) { + Response inner = + this.serviceClient().cancelWithResponse(groupName, serviceName, projectName, taskName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProjectTaskImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CommandProperties command( + String groupName, String serviceName, String projectName, String taskName, CommandPropertiesInner parameters) { + CommandPropertiesInner inner = + this.serviceClient().command(groupName, serviceName, projectName, taskName, parameters); + if (inner != null) { + return new CommandPropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response commandWithResponse( + String groupName, + String serviceName, + String projectName, + String taskName, + CommandPropertiesInner parameters, + Context context) { + Response inner = + this + .serviceClient() + .commandWithResponse(groupName, serviceName, projectName, taskName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CommandPropertiesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ProjectTask getById(String id) { + String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (groupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + String projectName = Utils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String taskName = Utils.getValueFromIdByName(id, "tasks"); + if (taskName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tasks'.", id))); + } + String localExpand = null; + return this + .getWithResponse(groupName, serviceName, projectName, taskName, localExpand, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String expand, Context context) { + String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (groupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + String projectName = Utils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String taskName = Utils.getValueFromIdByName(id, "tasks"); + if (taskName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tasks'.", id))); + } + return this.getWithResponse(groupName, serviceName, projectName, taskName, expand, context); + } + + public void deleteById(String id) { + String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (groupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + String projectName = Utils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String taskName = Utils.getValueFromIdByName(id, "tasks"); + if (taskName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tasks'.", id))); + } + Boolean localDeleteRunningTasks = null; + this + .deleteWithResponse(groupName, serviceName, projectName, taskName, localDeleteRunningTasks, Context.NONE) + .getValue(); + } + + public Response deleteByIdWithResponse(String id, Boolean deleteRunningTasks, Context context) { + String groupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (groupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "services"); + if (serviceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'services'.", id))); + } + String projectName = Utils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String taskName = Utils.getValueFromIdByName(id, "tasks"); + if (taskName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tasks'.", id))); + } + return this.deleteWithResponse(groupName, serviceName, projectName, taskName, deleteRunningTasks, context); + } + + private TasksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } + + public ProjectTaskImpl define(String name) { + return new ProjectTaskImpl(name, this.manager()); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/UsagesClientImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/UsagesClientImpl.java new file mode 100644 index 000000000000..241d2b74ea5d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/UsagesClientImpl.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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.datamigration.fluent.UsagesClient; +import com.azure.resourcemanager.datamigration.fluent.models.QuotaInner; +import com.azure.resourcemanager.datamigration.models.QuotaList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in UsagesClient. */ +public final class UsagesClientImpl implements UsagesClient { + private final ClientLogger logger = new ClientLogger(UsagesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final UsagesService service; + + /** The service client containing this operation class. */ + private final DataMigrationManagementClientImpl client; + + /** + * Initializes an instance of UsagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UsagesClientImpl(DataMigrationManagementClientImpl client) { + this.service = RestProxy.create(UsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DataMigrationManagementClientUsages to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DataMigrationManagem") + private interface UsagesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DataMigration/locations/{location}/usages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @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); + } + + /** + * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * + * @param location The Azure region of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of quota objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * + * @param location The Azure region of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of quota objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * + * @param location The Azure region of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of quota objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * + * @param location The Azure region of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of quota objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * + * @param location The Azure region of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of quota objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(listAsync(location)); + } + + /** + * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * + * @param location The Azure region of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of quota objects. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(listAsync(location, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of quota objects. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of quota objects. + */ + @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/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/UsagesImpl.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/UsagesImpl.java new file mode 100644 index 000000000000..e81cd59996cb --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/UsagesImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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.datamigration.fluent.UsagesClient; +import com.azure.resourcemanager.datamigration.fluent.models.QuotaInner; +import com.azure.resourcemanager.datamigration.models.Quota; +import com.azure.resourcemanager.datamigration.models.Usages; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class UsagesImpl implements Usages { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsagesImpl.class); + + private final UsagesClient innerClient; + + private final com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager; + + public UsagesImpl( + UsagesClient innerClient, com.azure.resourcemanager.datamigration.DataMigrationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return Utils.mapPage(inner, inner1 -> new QuotaImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return Utils.mapPage(inner, inner1 -> new QuotaImpl(inner1, this.manager())); + } + + private UsagesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.datamigration.DataMigrationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/Utils.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/Utils.java new file mode 100644 index 000000000000..1d736a275d21 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/package-info.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/implementation/package-info.java new file mode 100644 index 000000000000..e070291ec48e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/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 DataMigrationManagementClient. Data Migration Client. */ +package com.azure.resourcemanager.datamigration.implementation; diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AuthenticationType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AuthenticationType.java new file mode 100644 index 000000000000..c1adc8f42273 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AuthenticationType.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.datamigration.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 None for AuthenticationType. */ + public static final AuthenticationType NONE = fromString("None"); + + /** Static value WindowsAuthentication for AuthenticationType. */ + public static final AuthenticationType WINDOWS_AUTHENTICATION = fromString("WindowsAuthentication"); + + /** Static value SqlAuthentication for AuthenticationType. */ + public static final AuthenticationType SQL_AUTHENTICATION = fromString("SqlAuthentication"); + + /** Static value ActiveDirectoryIntegrated for AuthenticationType. */ + public static final AuthenticationType ACTIVE_DIRECTORY_INTEGRATED = fromString("ActiveDirectoryIntegrated"); + + /** Static value ActiveDirectoryPassword for AuthenticationType. */ + public static final AuthenticationType ACTIVE_DIRECTORY_PASSWORD = fromString("ActiveDirectoryPassword"); + + /** + * 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/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSku.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSku.java new file mode 100644 index 000000000000..ee7fa4c38bcb --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSku.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.datamigration.models; + +import com.azure.resourcemanager.datamigration.fluent.models.AvailableServiceSkuInner; + +/** An immutable client-side representation of AvailableServiceSku. */ +public interface AvailableServiceSku { + /** + * Gets the resourceType property: The resource type, including the provider namespace. + * + * @return the resourceType value. + */ + String resourceType(); + + /** + * Gets the sku property: SKU name, tier, etc. + * + * @return the sku value. + */ + AvailableServiceSkuAutoGenerated sku(); + + /** + * Gets the capacity property: A description of the scaling capacities of the SKU. + * + * @return the capacity value. + */ + AvailableServiceSkuCapacity capacity(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.AvailableServiceSkuInner object. + * + * @return the inner object. + */ + AvailableServiceSkuInner innerModel(); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSkuAutoGenerated.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSkuAutoGenerated.java new file mode 100644 index 000000000000..2928a8e81ad3 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSkuAutoGenerated.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SKU name, tier, etc. */ +@Fluent +public final class AvailableServiceSkuAutoGenerated { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableServiceSkuAutoGenerated.class); + + /* + * The name of the SKU + */ + @JsonProperty(value = "name") + private String name; + + /* + * SKU family + */ + @JsonProperty(value = "family") + private String family; + + /* + * SKU size + */ + @JsonProperty(value = "size") + private String size; + + /* + * The tier of the SKU, such as "Basic", "General Purpose", or "Business + * Critical" + */ + @JsonProperty(value = "tier") + private String tier; + + /** + * Get the name property: The name of the SKU. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the SKU. + * + * @param name the name value to set. + * @return the AvailableServiceSkuAutoGenerated object itself. + */ + public AvailableServiceSkuAutoGenerated withName(String name) { + this.name = name; + return this; + } + + /** + * Get the family property: SKU family. + * + * @return the family value. + */ + public String family() { + return this.family; + } + + /** + * Set the family property: SKU family. + * + * @param family the family value to set. + * @return the AvailableServiceSkuAutoGenerated object itself. + */ + public AvailableServiceSkuAutoGenerated withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get the size property: SKU size. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Set the size property: SKU size. + * + * @param size the size value to set. + * @return the AvailableServiceSkuAutoGenerated object itself. + */ + public AvailableServiceSkuAutoGenerated withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the tier property: The tier of the SKU, such as "Basic", "General Purpose", or "Business Critical". + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: The tier of the SKU, such as "Basic", "General Purpose", or "Business Critical". + * + * @param tier the tier value to set. + * @return the AvailableServiceSkuAutoGenerated object itself. + */ + public AvailableServiceSkuAutoGenerated withTier(String 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/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSkuCapacity.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSkuCapacity.java new file mode 100644 index 000000000000..01a8804f52aa --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AvailableServiceSkuCapacity.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.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A description of the scaling capacities of the SKU. */ +@Fluent +public final class AvailableServiceSkuCapacity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableServiceSkuCapacity.class); + + /* + * The minimum capacity, usually 0 or 1. + */ + @JsonProperty(value = "minimum") + private Integer minimum; + + /* + * The maximum capacity + */ + @JsonProperty(value = "maximum") + private Integer maximum; + + /* + * The default capacity + */ + @JsonProperty(value = "default") + private Integer defaultProperty; + + /* + * The scalability approach + */ + @JsonProperty(value = "scaleType") + private ServiceScalability scaleType; + + /** + * Get the minimum property: The minimum capacity, usually 0 or 1. + * + * @return the minimum value. + */ + public Integer minimum() { + return this.minimum; + } + + /** + * Set the minimum property: The minimum capacity, usually 0 or 1. + * + * @param minimum the minimum value to set. + * @return the AvailableServiceSkuCapacity object itself. + */ + public AvailableServiceSkuCapacity withMinimum(Integer minimum) { + this.minimum = minimum; + return this; + } + + /** + * Get the maximum property: The maximum capacity. + * + * @return the maximum value. + */ + public Integer maximum() { + return this.maximum; + } + + /** + * Set the maximum property: The maximum capacity. + * + * @param maximum the maximum value to set. + * @return the AvailableServiceSkuCapacity object itself. + */ + public AvailableServiceSkuCapacity withMaximum(Integer maximum) { + this.maximum = maximum; + return this; + } + + /** + * Get the defaultProperty property: The default capacity. + * + * @return the defaultProperty value. + */ + public Integer defaultProperty() { + return this.defaultProperty; + } + + /** + * Set the defaultProperty property: The default capacity. + * + * @param defaultProperty the defaultProperty value to set. + * @return the AvailableServiceSkuCapacity object itself. + */ + public AvailableServiceSkuCapacity withDefaultProperty(Integer defaultProperty) { + this.defaultProperty = defaultProperty; + return this; + } + + /** + * Get the scaleType property: The scalability approach. + * + * @return the scaleType value. + */ + public ServiceScalability scaleType() { + return this.scaleType; + } + + /** + * Set the scaleType property: The scalability approach. + * + * @param scaleType the scaleType value to set. + * @return the AvailableServiceSkuCapacity object itself. + */ + public AvailableServiceSkuCapacity withScaleType(ServiceScalability scaleType) { + this.scaleType = scaleType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AzureActiveDirectoryApp.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AzureActiveDirectoryApp.java new file mode 100644 index 000000000000..970016812bc6 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/AzureActiveDirectoryApp.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.datamigration.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 Active Directory Application. */ +@Fluent +public final class AzureActiveDirectoryApp { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureActiveDirectoryApp.class); + + /* + * Application ID of the Azure Active Directory Application + */ + @JsonProperty(value = "applicationId", required = true) + private String applicationId; + + /* + * Key used to authenticate to the Azure Active Directory Application + */ + @JsonProperty(value = "appKey", required = true) + private String appKey; + + /* + * Tenant id of the customer + */ + @JsonProperty(value = "tenantId", required = true) + private String tenantId; + + /** + * Get the applicationId property: Application ID of the Azure Active Directory Application. + * + * @return the applicationId value. + */ + public String applicationId() { + return this.applicationId; + } + + /** + * Set the applicationId property: Application ID of the Azure Active Directory Application. + * + * @param applicationId the applicationId value to set. + * @return the AzureActiveDirectoryApp object itself. + */ + public AzureActiveDirectoryApp withApplicationId(String applicationId) { + this.applicationId = applicationId; + return this; + } + + /** + * Get the appKey property: Key used to authenticate to the Azure Active Directory Application. + * + * @return the appKey value. + */ + public String appKey() { + return this.appKey; + } + + /** + * Set the appKey property: Key used to authenticate to the Azure Active Directory Application. + * + * @param appKey the appKey value to set. + * @return the AzureActiveDirectoryApp object itself. + */ + public AzureActiveDirectoryApp withAppKey(String appKey) { + this.appKey = appKey; + return this; + } + + /** + * Get the tenantId property: Tenant id of the customer. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: Tenant id of the customer. + * + * @param tenantId the tenantId value to set. + * @return the AzureActiveDirectoryApp object itself. + */ + public AzureActiveDirectoryApp withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (applicationId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property applicationId in model AzureActiveDirectoryApp")); + } + if (appKey() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property appKey in model AzureActiveDirectoryApp")); + } + if (tenantId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property tenantId in model AzureActiveDirectoryApp")); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupFileInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupFileInfo.java new file mode 100644 index 000000000000..5b2de5f3054f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupFileInfo.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.datamigration.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; + +/** Information of the backup file. */ +@Fluent +public final class BackupFileInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupFileInfo.class); + + /* + * Location of the backup file in shared folder + */ + @JsonProperty(value = "fileLocation") + private String fileLocation; + + /* + * Sequence number of the backup file in the backup set + */ + @JsonProperty(value = "familySequenceNumber") + private Integer familySequenceNumber; + + /* + * Status of the backup file during migration + */ + @JsonProperty(value = "status") + private BackupFileStatus status; + + /** + * Get the fileLocation property: Location of the backup file in shared folder. + * + * @return the fileLocation value. + */ + public String fileLocation() { + return this.fileLocation; + } + + /** + * Set the fileLocation property: Location of the backup file in shared folder. + * + * @param fileLocation the fileLocation value to set. + * @return the BackupFileInfo object itself. + */ + public BackupFileInfo withFileLocation(String fileLocation) { + this.fileLocation = fileLocation; + return this; + } + + /** + * Get the familySequenceNumber property: Sequence number of the backup file in the backup set. + * + * @return the familySequenceNumber value. + */ + public Integer familySequenceNumber() { + return this.familySequenceNumber; + } + + /** + * Set the familySequenceNumber property: Sequence number of the backup file in the backup set. + * + * @param familySequenceNumber the familySequenceNumber value to set. + * @return the BackupFileInfo object itself. + */ + public BackupFileInfo withFamilySequenceNumber(Integer familySequenceNumber) { + this.familySequenceNumber = familySequenceNumber; + return this; + } + + /** + * Get the status property: Status of the backup file during migration. + * + * @return the status value. + */ + public BackupFileStatus status() { + return this.status; + } + + /** + * Set the status property: Status of the backup file during migration. + * + * @param status the status value to set. + * @return the BackupFileInfo object itself. + */ + public BackupFileInfo withStatus(BackupFileStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupFileStatus.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupFileStatus.java new file mode 100644 index 000000000000..0c7657a13a96 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupFileStatus.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BackupFileStatus. */ +public final class BackupFileStatus extends ExpandableStringEnum { + /** Static value Arrived for BackupFileStatus. */ + public static final BackupFileStatus ARRIVED = fromString("Arrived"); + + /** Static value Queued for BackupFileStatus. */ + public static final BackupFileStatus QUEUED = fromString("Queued"); + + /** Static value Uploading for BackupFileStatus. */ + public static final BackupFileStatus UPLOADING = fromString("Uploading"); + + /** Static value Uploaded for BackupFileStatus. */ + public static final BackupFileStatus UPLOADED = fromString("Uploaded"); + + /** Static value Restoring for BackupFileStatus. */ + public static final BackupFileStatus RESTORING = fromString("Restoring"); + + /** Static value Restored for BackupFileStatus. */ + public static final BackupFileStatus RESTORED = fromString("Restored"); + + /** Static value Cancelled for BackupFileStatus. */ + public static final BackupFileStatus CANCELLED = fromString("Cancelled"); + + /** + * Creates or finds a BackupFileStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding BackupFileStatus. + */ + @JsonCreator + public static BackupFileStatus fromString(String name) { + return fromString(name, BackupFileStatus.class); + } + + /** @return known BackupFileStatus values. */ + public static Collection values() { + return values(BackupFileStatus.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupMode.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupMode.java new file mode 100644 index 000000000000..d5238c7db355 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupMode.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BackupMode. */ +public final class BackupMode extends ExpandableStringEnum { + /** Static value CreateBackup for BackupMode. */ + public static final BackupMode CREATE_BACKUP = fromString("CreateBackup"); + + /** Static value ExistingBackup for BackupMode. */ + public static final BackupMode EXISTING_BACKUP = fromString("ExistingBackup"); + + /** + * Creates or finds a BackupMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding BackupMode. + */ + @JsonCreator + public static BackupMode fromString(String name) { + return fromString(name, BackupMode.class); + } + + /** @return known BackupMode values. */ + public static Collection values() { + return values(BackupMode.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupSetInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupSetInfo.java new file mode 100644 index 000000000000..3d9528611ff5 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupSetInfo.java @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Information of backup set. */ +@Fluent +public final class BackupSetInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupSetInfo.class); + + /* + * Id for the set of backup files + */ + @JsonProperty(value = "backupSetId") + private String backupSetId; + + /* + * First log sequence number of the backup file + */ + @JsonProperty(value = "firstLsn") + private String firstLsn; + + /* + * Last log sequence number of the backup file + */ + @JsonProperty(value = "lastLsn") + private String lastLsn; + + /* + * Last modified time of the backup file in share location + */ + @JsonProperty(value = "lastModifiedTime") + private OffsetDateTime lastModifiedTime; + + /* + * Enum of the different backup types + */ + @JsonProperty(value = "backupType") + private BackupType backupType; + + /* + * List of files in the backup set + */ + @JsonProperty(value = "listOfBackupFiles") + private List listOfBackupFiles; + + /* + * Name of the database to which the backup set belongs + */ + @JsonProperty(value = "databaseName") + private String databaseName; + + /* + * Date and time that the backup operation began + */ + @JsonProperty(value = "backupStartDate") + private OffsetDateTime backupStartDate; + + /* + * Date and time that the backup operation finished + */ + @JsonProperty(value = "backupFinishedDate") + private OffsetDateTime backupFinishedDate; + + /* + * Whether the backup set is restored or not + */ + @JsonProperty(value = "isBackupRestored") + private Boolean isBackupRestored; + + /** + * Get the backupSetId property: Id for the set of backup files. + * + * @return the backupSetId value. + */ + public String backupSetId() { + return this.backupSetId; + } + + /** + * Set the backupSetId property: Id for the set of backup files. + * + * @param backupSetId the backupSetId value to set. + * @return the BackupSetInfo object itself. + */ + public BackupSetInfo withBackupSetId(String backupSetId) { + this.backupSetId = backupSetId; + return this; + } + + /** + * Get the firstLsn property: First log sequence number of the backup file. + * + * @return the firstLsn value. + */ + public String firstLsn() { + return this.firstLsn; + } + + /** + * Set the firstLsn property: First log sequence number of the backup file. + * + * @param firstLsn the firstLsn value to set. + * @return the BackupSetInfo object itself. + */ + public BackupSetInfo withFirstLsn(String firstLsn) { + this.firstLsn = firstLsn; + return this; + } + + /** + * Get the lastLsn property: Last log sequence number of the backup file. + * + * @return the lastLsn value. + */ + public String lastLsn() { + return this.lastLsn; + } + + /** + * Set the lastLsn property: Last log sequence number of the backup file. + * + * @param lastLsn the lastLsn value to set. + * @return the BackupSetInfo object itself. + */ + public BackupSetInfo withLastLsn(String lastLsn) { + this.lastLsn = lastLsn; + return this; + } + + /** + * Get the lastModifiedTime property: Last modified time of the backup file in share location. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Set the lastModifiedTime property: Last modified time of the backup file in share location. + * + * @param lastModifiedTime the lastModifiedTime value to set. + * @return the BackupSetInfo object itself. + */ + public BackupSetInfo withLastModifiedTime(OffsetDateTime lastModifiedTime) { + this.lastModifiedTime = lastModifiedTime; + return this; + } + + /** + * Get the backupType property: Enum of the different backup types. + * + * @return the backupType value. + */ + public BackupType backupType() { + return this.backupType; + } + + /** + * Set the backupType property: Enum of the different backup types. + * + * @param backupType the backupType value to set. + * @return the BackupSetInfo object itself. + */ + public BackupSetInfo withBackupType(BackupType backupType) { + this.backupType = backupType; + return this; + } + + /** + * Get the listOfBackupFiles property: List of files in the backup set. + * + * @return the listOfBackupFiles value. + */ + public List listOfBackupFiles() { + return this.listOfBackupFiles; + } + + /** + * Set the listOfBackupFiles property: List of files in the backup set. + * + * @param listOfBackupFiles the listOfBackupFiles value to set. + * @return the BackupSetInfo object itself. + */ + public BackupSetInfo withListOfBackupFiles(List listOfBackupFiles) { + this.listOfBackupFiles = listOfBackupFiles; + return this; + } + + /** + * Get the databaseName property: Name of the database to which the backup set belongs. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: Name of the database to which the backup set belongs. + * + * @param databaseName the databaseName value to set. + * @return the BackupSetInfo object itself. + */ + public BackupSetInfo withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the backupStartDate property: Date and time that the backup operation began. + * + * @return the backupStartDate value. + */ + public OffsetDateTime backupStartDate() { + return this.backupStartDate; + } + + /** + * Set the backupStartDate property: Date and time that the backup operation began. + * + * @param backupStartDate the backupStartDate value to set. + * @return the BackupSetInfo object itself. + */ + public BackupSetInfo withBackupStartDate(OffsetDateTime backupStartDate) { + this.backupStartDate = backupStartDate; + return this; + } + + /** + * Get the backupFinishedDate property: Date and time that the backup operation finished. + * + * @return the backupFinishedDate value. + */ + public OffsetDateTime backupFinishedDate() { + return this.backupFinishedDate; + } + + /** + * Set the backupFinishedDate property: Date and time that the backup operation finished. + * + * @param backupFinishedDate the backupFinishedDate value to set. + * @return the BackupSetInfo object itself. + */ + public BackupSetInfo withBackupFinishedDate(OffsetDateTime backupFinishedDate) { + this.backupFinishedDate = backupFinishedDate; + return this; + } + + /** + * Get the isBackupRestored property: Whether the backup set is restored or not. + * + * @return the isBackupRestored value. + */ + public Boolean isBackupRestored() { + return this.isBackupRestored; + } + + /** + * Set the isBackupRestored property: Whether the backup set is restored or not. + * + * @param isBackupRestored the isBackupRestored value to set. + * @return the BackupSetInfo object itself. + */ + public BackupSetInfo withIsBackupRestored(Boolean isBackupRestored) { + this.isBackupRestored = isBackupRestored; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (listOfBackupFiles() != null) { + listOfBackupFiles().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupType.java new file mode 100644 index 000000000000..bd09bd026e86 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BackupType.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BackupType. */ +public final class BackupType extends ExpandableStringEnum { + /** Static value Database for BackupType. */ + public static final BackupType DATABASE = fromString("Database"); + + /** Static value TransactionLog for BackupType. */ + public static final BackupType TRANSACTION_LOG = fromString("TransactionLog"); + + /** Static value File for BackupType. */ + public static final BackupType FILE = fromString("File"); + + /** Static value DifferentialDatabase for BackupType. */ + public static final BackupType DIFFERENTIAL_DATABASE = fromString("DifferentialDatabase"); + + /** Static value DifferentialFile for BackupType. */ + public static final BackupType DIFFERENTIAL_FILE = fromString("DifferentialFile"); + + /** Static value Partial for BackupType. */ + public static final BackupType PARTIAL = fromString("Partial"); + + /** Static value DifferentialPartial for BackupType. */ + public static final BackupType DIFFERENTIAL_PARTIAL = fromString("DifferentialPartial"); + + /** + * Creates or finds a BackupType from its string representation. + * + * @param name a name to look for. + * @return the corresponding BackupType. + */ + @JsonCreator + public static BackupType fromString(String name) { + return fromString(name, BackupType.class); + } + + /** @return known BackupType values. */ + public static Collection values() { + return values(BackupType.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BlobShare.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BlobShare.java new file mode 100644 index 000000000000..27bdabe45418 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/BlobShare.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.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Blob container storage information. */ +@Fluent +public final class BlobShare { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BlobShare.class); + + /* + * SAS URI of Azure Storage Account Container. + */ + @JsonProperty(value = "sasUri", required = true) + private String sasUri; + + /** + * Get the sasUri property: SAS URI of Azure Storage Account Container. + * + * @return the sasUri value. + */ + public String sasUri() { + return this.sasUri; + } + + /** + * Set the sasUri property: SAS URI of Azure Storage Account Container. + * + * @param sasUri the sasUri value to set. + * @return the BlobShare object itself. + */ + public BlobShare withSasUri(String sasUri) { + this.sasUri = sasUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sasUri() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property sasUri in model BlobShare")); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskInput.java new file mode 100644 index 000000000000..3ff3bd1c7d79 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskInput.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Input for the service task to check for OCI drivers. */ +@Fluent +public final class CheckOciDriverTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckOciDriverTaskInput.class); + + /* + * Version of the source server to check against. Optional. + */ + @JsonProperty(value = "serverVersion") + private String serverVersion; + + /** + * Get the serverVersion property: Version of the source server to check against. Optional. + * + * @return the serverVersion value. + */ + public String serverVersion() { + return this.serverVersion; + } + + /** + * Set the serverVersion property: Version of the source server to check against. Optional. + * + * @param serverVersion the serverVersion value to set. + * @return the CheckOciDriverTaskInput object itself. + */ + public CheckOciDriverTaskInput withServerVersion(String serverVersion) { + this.serverVersion = serverVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskOutput.java new file mode 100644 index 000000000000..f289959b0fe0 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskOutput.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Output for the service task to check for OCI drivers. */ +@Fluent +public final class CheckOciDriverTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckOciDriverTaskOutput.class); + + /* + * Information about the installed driver if found and valid. + */ + @JsonProperty(value = "installedDriver") + private OracleOciDriverInfo installedDriver; + + /* + * Validation errors + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the installedDriver property: Information about the installed driver if found and valid. + * + * @return the installedDriver value. + */ + public OracleOciDriverInfo installedDriver() { + return this.installedDriver; + } + + /** + * Set the installedDriver property: Information about the installed driver if found and valid. + * + * @param installedDriver the installedDriver value to set. + * @return the CheckOciDriverTaskOutput object itself. + */ + public CheckOciDriverTaskOutput withInstalledDriver(OracleOciDriverInfo installedDriver) { + this.installedDriver = installedDriver; + return this; + } + + /** + * Get the validationErrors property: Validation errors. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (installedDriver() != null) { + installedDriver().validate(); + } + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskProperties.java new file mode 100644 index 000000000000..5ca9e7c2b5cd --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CheckOciDriverTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that checks for OCI drivers. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Service.Check.OCI") +@Fluent +public final class CheckOciDriverTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckOciDriverTaskProperties.class); + + /* + * Input for the service task to check for OCI drivers. + */ + @JsonProperty(value = "input") + private CheckOciDriverTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Input for the service task to check for OCI drivers. + * + * @return the input value. + */ + public CheckOciDriverTaskInput input() { + return this.input; + } + + /** + * Set the input property: Input for the service task to check for OCI drivers. + * + * @param input the input value to set. + * @return the CheckOciDriverTaskProperties object itself. + */ + public CheckOciDriverTaskProperties withInput(CheckOciDriverTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public CheckOciDriverTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CommandProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CommandProperties.java new file mode 100644 index 000000000000..8912a2125c40 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CommandProperties.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import java.util.List; + +/** An immutable client-side representation of CommandProperties. */ +public interface CommandProperties { + /** + * Gets the errors property: Array of errors. This is ignored if submitted. + * + * @return the errors value. + */ + List errors(); + + /** + * Gets the state property: The state of the command. This is ignored if submitted. + * + * @return the state value. + */ + CommandState state(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner object. + * + * @return the inner object. + */ + CommandPropertiesInner innerModel(); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CommandState.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CommandState.java new file mode 100644 index 000000000000..e79ff8492d1f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/CommandState.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CommandState. */ +public final class CommandState extends ExpandableStringEnum { + /** Static value Unknown for CommandState. */ + public static final CommandState UNKNOWN = fromString("Unknown"); + + /** Static value Accepted for CommandState. */ + public static final CommandState ACCEPTED = fromString("Accepted"); + + /** Static value Running for CommandState. */ + public static final CommandState RUNNING = fromString("Running"); + + /** Static value Succeeded for CommandState. */ + public static final CommandState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for CommandState. */ + public static final CommandState FAILED = fromString("Failed"); + + /** + * Creates or finds a CommandState from its string representation. + * + * @param name a name to look for. + * @return the corresponding CommandState. + */ + @JsonCreator + public static CommandState fromString(String name) { + return fromString(name, CommandState.class); + } + + /** @return known CommandState values. */ + public static Collection values() { + return values(CommandState.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToMongoDbTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToMongoDbTaskProperties.java new file mode 100644 index 000000000000..242645f47604 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToMongoDbTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that validates the connection to and provides information about a MongoDB server. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Connect.MongoDb") +@Fluent +public final class ConnectToMongoDbTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToMongoDbTaskProperties.class); + + /* + * Describes a connection to a MongoDB data source + */ + @JsonProperty(value = "input") + private MongoDbConnectionInfo input; + + /* + * An array containing a single MongoDbClusterInfo object + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Describes a connection to a MongoDB data source. + * + * @return the input value. + */ + public MongoDbConnectionInfo input() { + return this.input; + } + + /** + * Set the input property: Describes a connection to a MongoDB data source. + * + * @param input the input value to set. + * @return the ConnectToMongoDbTaskProperties object itself. + */ + public ConnectToMongoDbTaskProperties withInput(MongoDbConnectionInfo input) { + this.input = input; + return this; + } + + /** + * Get the output property: An array containing a single MongoDbClusterInfo object. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public ConnectToMongoDbTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceMySqlTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceMySqlTaskInput.java new file mode 100644 index 000000000000..9d009553ce8c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceMySqlTaskInput.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Input for the task that validates MySQL database connection. */ +@Fluent +public final class ConnectToSourceMySqlTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourceMySqlTaskInput.class); + + /* + * Information for connecting to MySQL source + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private MySqlConnectionInfo sourceConnectionInfo; + + /* + * Target Platform for the migration + */ + @JsonProperty(value = "targetPlatform") + private MySqlTargetPlatformType targetPlatform; + + /* + * Permission group for validations + */ + @JsonProperty(value = "checkPermissionsGroup") + private ServerLevelPermissionsGroup checkPermissionsGroup; + + /** + * Get the sourceConnectionInfo property: Information for connecting to MySQL source. + * + * @return the sourceConnectionInfo value. + */ + public MySqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set the sourceConnectionInfo property: Information for connecting to MySQL source. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set. + * @return the ConnectToSourceMySqlTaskInput object itself. + */ + public ConnectToSourceMySqlTaskInput withSourceConnectionInfo(MySqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get the targetPlatform property: Target Platform for the migration. + * + * @return the targetPlatform value. + */ + public MySqlTargetPlatformType targetPlatform() { + return this.targetPlatform; + } + + /** + * Set the targetPlatform property: Target Platform for the migration. + * + * @param targetPlatform the targetPlatform value to set. + * @return the ConnectToSourceMySqlTaskInput object itself. + */ + public ConnectToSourceMySqlTaskInput withTargetPlatform(MySqlTargetPlatformType targetPlatform) { + this.targetPlatform = targetPlatform; + return this; + } + + /** + * Get the checkPermissionsGroup property: Permission group for validations. + * + * @return the checkPermissionsGroup value. + */ + public ServerLevelPermissionsGroup checkPermissionsGroup() { + return this.checkPermissionsGroup; + } + + /** + * Set the checkPermissionsGroup property: Permission group for validations. + * + * @param checkPermissionsGroup the checkPermissionsGroup value to set. + * @return the ConnectToSourceMySqlTaskInput object itself. + */ + public ConnectToSourceMySqlTaskInput withCheckPermissionsGroup(ServerLevelPermissionsGroup checkPermissionsGroup) { + this.checkPermissionsGroup = checkPermissionsGroup; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceConnectionInfo in model ConnectToSourceMySqlTaskInput")); + } else { + sourceConnectionInfo().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceMySqlTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceMySqlTaskProperties.java new file mode 100644 index 000000000000..be33fc5a37c1 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceMySqlTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that validates MySQL database connection. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ConnectToSource.MySql") +@Fluent +public final class ConnectToSourceMySqlTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourceMySqlTaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private ConnectToSourceMySqlTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public ConnectToSourceMySqlTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the ConnectToSourceMySqlTaskProperties object itself. + */ + public ConnectToSourceMySqlTaskProperties withInput(ConnectToSourceMySqlTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public ConnectToSourceMySqlTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceNonSqlTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceNonSqlTaskOutput.java new file mode 100644 index 000000000000..8c4a84119dcb --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceNonSqlTaskOutput.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Output for connect to MySQL type source. */ +@Immutable +public final class ConnectToSourceNonSqlTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourceNonSqlTaskOutput.class); + + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Server brand version + */ + @JsonProperty(value = "sourceServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerBrandVersion; + + /* + * Server properties + */ + @JsonProperty(value = "serverProperties", access = JsonProperty.Access.WRITE_ONLY) + private ServerProperties serverProperties; + + /* + * List of databases on the server + */ + @JsonProperty(value = "databases", access = JsonProperty.Access.WRITE_ONLY) + private List databases; + + /* + * Validation errors associated with the task + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the sourceServerBrandVersion property: Server brand version. + * + * @return the sourceServerBrandVersion value. + */ + public String sourceServerBrandVersion() { + return this.sourceServerBrandVersion; + } + + /** + * Get the serverProperties property: Server properties. + * + * @return the serverProperties value. + */ + public ServerProperties serverProperties() { + return this.serverProperties; + } + + /** + * Get the databases property: List of databases on the server. + * + * @return the databases value. + */ + public List databases() { + return this.databases; + } + + /** + * Get the validationErrors property: Validation errors associated with the task. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serverProperties() != null) { + serverProperties().validate(); + } + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskInput.java new file mode 100644 index 000000000000..0e4fa1823e0b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskInput.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Input for the task that validates Oracle database connection. */ +@Fluent +public final class ConnectToSourceOracleSyncTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourceOracleSyncTaskInput.class); + + /* + * Information for connecting to Oracle source + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private OracleConnectionInfo sourceConnectionInfo; + + /** + * Get the sourceConnectionInfo property: Information for connecting to Oracle source. + * + * @return the sourceConnectionInfo value. + */ + public OracleConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set the sourceConnectionInfo property: Information for connecting to Oracle source. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set. + * @return the ConnectToSourceOracleSyncTaskInput object itself. + */ + public ConnectToSourceOracleSyncTaskInput withSourceConnectionInfo(OracleConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceConnectionInfo in model ConnectToSourceOracleSyncTaskInput")); + } else { + sourceConnectionInfo().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskOutput.java new file mode 100644 index 000000000000..ba3302265c59 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskOutput.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.datamigration.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; + +/** Output for the task that validates Oracle database connection. */ +@Immutable +public final class ConnectToSourceOracleSyncTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourceOracleSyncTaskOutput.class); + + /* + * Version of the source server + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /* + * List of schemas on source server + */ + @JsonProperty(value = "databases", access = JsonProperty.Access.WRITE_ONLY) + private List databases; + + /* + * Source server brand version + */ + @JsonProperty(value = "sourceServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerBrandVersion; + + /* + * Validation errors associated with the task + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the sourceServerVersion property: Version of the source server. + * + * @return the sourceServerVersion value. + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get the databases property: List of schemas on source server. + * + * @return the databases value. + */ + public List databases() { + return this.databases; + } + + /** + * Get the sourceServerBrandVersion property: Source server brand version. + * + * @return the sourceServerBrandVersion value. + */ + public String sourceServerBrandVersion() { + return this.sourceServerBrandVersion; + } + + /** + * Get the validationErrors property: Validation errors associated with the task. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskProperties.java new file mode 100644 index 000000000000..88784159187b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceOracleSyncTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that validates Oracle database connection. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ConnectToSource.Oracle.Sync") +@Fluent +public final class ConnectToSourceOracleSyncTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourceOracleSyncTaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private ConnectToSourceOracleSyncTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public ConnectToSourceOracleSyncTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the ConnectToSourceOracleSyncTaskProperties object itself. + */ + public ConnectToSourceOracleSyncTaskProperties withInput(ConnectToSourceOracleSyncTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public ConnectToSourceOracleSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourcePostgreSqlSyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourcePostgreSqlSyncTaskInput.java new file mode 100644 index 000000000000..befd7224866c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourcePostgreSqlSyncTaskInput.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.datamigration.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; + +/** Input for the task that validates connection to PostgreSQL and source server requirements. */ +@Fluent +public final class ConnectToSourcePostgreSqlSyncTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourcePostgreSqlSyncTaskInput.class); + + /* + * Connection information for source PostgreSQL server + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private PostgreSqlConnectionInfo sourceConnectionInfo; + + /** + * Get the sourceConnectionInfo property: Connection information for source PostgreSQL server. + * + * @return the sourceConnectionInfo value. + */ + public PostgreSqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set the sourceConnectionInfo property: Connection information for source PostgreSQL server. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set. + * @return the ConnectToSourcePostgreSqlSyncTaskInput object itself. + */ + public ConnectToSourcePostgreSqlSyncTaskInput withSourceConnectionInfo( + PostgreSqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceConnectionInfo in model" + + " ConnectToSourcePostgreSqlSyncTaskInput")); + } else { + sourceConnectionInfo().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourcePostgreSqlSyncTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourcePostgreSqlSyncTaskOutput.java new file mode 100644 index 000000000000..75563d8e5ee8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourcePostgreSqlSyncTaskOutput.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Output for the task that validates connection to PostgreSQL and source server requirements. */ +@Immutable +public final class ConnectToSourcePostgreSqlSyncTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourcePostgreSqlSyncTaskOutput.class); + + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Version of the source server + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /* + * List of databases on source server + */ + @JsonProperty(value = "databases", access = JsonProperty.Access.WRITE_ONLY) + private List databases; + + /* + * Source server brand version + */ + @JsonProperty(value = "sourceServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerBrandVersion; + + /* + * Validation errors associated with the task + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the sourceServerVersion property: Version of the source server. + * + * @return the sourceServerVersion value. + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get the databases property: List of databases on source server. + * + * @return the databases value. + */ + public List databases() { + return this.databases; + } + + /** + * Get the sourceServerBrandVersion property: Source server brand version. + * + * @return the sourceServerBrandVersion value. + */ + public String sourceServerBrandVersion() { + return this.sourceServerBrandVersion; + } + + /** + * Get the validationErrors property: Validation errors associated with the task. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourcePostgreSqlSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourcePostgreSqlSyncTaskProperties.java new file mode 100644 index 000000000000..6430c1f19c3d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourcePostgreSqlSyncTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** + * Properties for the task that validates connection to PostgreSQL server and source server requirements for online + * migration. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ConnectToSource.PostgreSql.Sync") +@Fluent +public final class ConnectToSourcePostgreSqlSyncTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourcePostgreSqlSyncTaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private ConnectToSourcePostgreSqlSyncTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public ConnectToSourcePostgreSqlSyncTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the ConnectToSourcePostgreSqlSyncTaskProperties object itself. + */ + public ConnectToSourcePostgreSqlSyncTaskProperties withInput(ConnectToSourcePostgreSqlSyncTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public ConnectToSourcePostgreSqlSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerSyncTaskProperties.java new file mode 100644 index 000000000000..29aa2649ab4f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerSyncTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** + * Properties for the task that validates connection to SQL Server and source server requirements for online migration. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ConnectToSource.SqlServer.Sync") +@Fluent +public final class ConnectToSourceSqlServerSyncTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourceSqlServerSyncTaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private ConnectToSourceSqlServerTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public ConnectToSourceSqlServerTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the ConnectToSourceSqlServerSyncTaskProperties object itself. + */ + public ConnectToSourceSqlServerSyncTaskProperties withInput(ConnectToSourceSqlServerTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public ConnectToSourceSqlServerSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskInput.java new file mode 100644 index 000000000000..637b7d721569 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskInput.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Input for the task that validates connection to SQL Server and also validates source server requirements. */ +@Fluent +public final class ConnectToSourceSqlServerTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourceSqlServerTaskInput.class); + + /* + * Connection information for Source SQL Server + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private SqlConnectionInfo sourceConnectionInfo; + + /* + * Permission group for validations + */ + @JsonProperty(value = "checkPermissionsGroup") + private ServerLevelPermissionsGroup checkPermissionsGroup; + + /* + * Flag for whether to collect databases from source server. + */ + @JsonProperty(value = "collectDatabases") + private Boolean collectDatabases; + + /* + * Flag for whether to collect logins from source server. + */ + @JsonProperty(value = "collectLogins") + private Boolean collectLogins; + + /* + * Flag for whether to collect agent jobs from source server. + */ + @JsonProperty(value = "collectAgentJobs") + private Boolean collectAgentJobs; + + /* + * Flag for whether to collect TDE Certificate names from source server. + */ + @JsonProperty(value = "collectTdeCertificateInfo") + private Boolean collectTdeCertificateInfo; + + /* + * Flag for whether to validate SSIS catalog is reachable on the source + * server. + */ + @JsonProperty(value = "validateSsisCatalogOnly") + private Boolean validateSsisCatalogOnly; + + /** + * Get the sourceConnectionInfo property: Connection information for Source SQL Server. + * + * @return the sourceConnectionInfo value. + */ + public SqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set the sourceConnectionInfo property: Connection information for Source SQL Server. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set. + * @return the ConnectToSourceSqlServerTaskInput object itself. + */ + public ConnectToSourceSqlServerTaskInput withSourceConnectionInfo(SqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get the checkPermissionsGroup property: Permission group for validations. + * + * @return the checkPermissionsGroup value. + */ + public ServerLevelPermissionsGroup checkPermissionsGroup() { + return this.checkPermissionsGroup; + } + + /** + * Set the checkPermissionsGroup property: Permission group for validations. + * + * @param checkPermissionsGroup the checkPermissionsGroup value to set. + * @return the ConnectToSourceSqlServerTaskInput object itself. + */ + public ConnectToSourceSqlServerTaskInput withCheckPermissionsGroup( + ServerLevelPermissionsGroup checkPermissionsGroup) { + this.checkPermissionsGroup = checkPermissionsGroup; + return this; + } + + /** + * Get the collectDatabases property: Flag for whether to collect databases from source server. + * + * @return the collectDatabases value. + */ + public Boolean collectDatabases() { + return this.collectDatabases; + } + + /** + * Set the collectDatabases property: Flag for whether to collect databases from source server. + * + * @param collectDatabases the collectDatabases value to set. + * @return the ConnectToSourceSqlServerTaskInput object itself. + */ + public ConnectToSourceSqlServerTaskInput withCollectDatabases(Boolean collectDatabases) { + this.collectDatabases = collectDatabases; + return this; + } + + /** + * Get the collectLogins property: Flag for whether to collect logins from source server. + * + * @return the collectLogins value. + */ + public Boolean collectLogins() { + return this.collectLogins; + } + + /** + * Set the collectLogins property: Flag for whether to collect logins from source server. + * + * @param collectLogins the collectLogins value to set. + * @return the ConnectToSourceSqlServerTaskInput object itself. + */ + public ConnectToSourceSqlServerTaskInput withCollectLogins(Boolean collectLogins) { + this.collectLogins = collectLogins; + return this; + } + + /** + * Get the collectAgentJobs property: Flag for whether to collect agent jobs from source server. + * + * @return the collectAgentJobs value. + */ + public Boolean collectAgentJobs() { + return this.collectAgentJobs; + } + + /** + * Set the collectAgentJobs property: Flag for whether to collect agent jobs from source server. + * + * @param collectAgentJobs the collectAgentJobs value to set. + * @return the ConnectToSourceSqlServerTaskInput object itself. + */ + public ConnectToSourceSqlServerTaskInput withCollectAgentJobs(Boolean collectAgentJobs) { + this.collectAgentJobs = collectAgentJobs; + return this; + } + + /** + * Get the collectTdeCertificateInfo property: Flag for whether to collect TDE Certificate names from source server. + * + * @return the collectTdeCertificateInfo value. + */ + public Boolean collectTdeCertificateInfo() { + return this.collectTdeCertificateInfo; + } + + /** + * Set the collectTdeCertificateInfo property: Flag for whether to collect TDE Certificate names from source server. + * + * @param collectTdeCertificateInfo the collectTdeCertificateInfo value to set. + * @return the ConnectToSourceSqlServerTaskInput object itself. + */ + public ConnectToSourceSqlServerTaskInput withCollectTdeCertificateInfo(Boolean collectTdeCertificateInfo) { + this.collectTdeCertificateInfo = collectTdeCertificateInfo; + return this; + } + + /** + * Get the validateSsisCatalogOnly property: Flag for whether to validate SSIS catalog is reachable on the source + * server. + * + * @return the validateSsisCatalogOnly value. + */ + public Boolean validateSsisCatalogOnly() { + return this.validateSsisCatalogOnly; + } + + /** + * Set the validateSsisCatalogOnly property: Flag for whether to validate SSIS catalog is reachable on the source + * server. + * + * @param validateSsisCatalogOnly the validateSsisCatalogOnly value to set. + * @return the ConnectToSourceSqlServerTaskInput object itself. + */ + public ConnectToSourceSqlServerTaskInput withValidateSsisCatalogOnly(Boolean validateSsisCatalogOnly) { + this.validateSsisCatalogOnly = validateSsisCatalogOnly; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceConnectionInfo in model ConnectToSourceSqlServerTaskInput")); + } else { + sourceConnectionInfo().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutput.java new file mode 100644 index 000000000000..466f14ce46e7 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutput.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.datamigration.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 com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Output for the task that validates connection to SQL Server and also validates source server requirements. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "resultType", + defaultImpl = ConnectToSourceSqlServerTaskOutput.class) +@JsonTypeName("ConnectToSourceSqlServerTaskOutput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "TaskLevelOutput", value = ConnectToSourceSqlServerTaskOutputTaskLevel.class), + @JsonSubTypes.Type(name = "DatabaseLevelOutput", value = ConnectToSourceSqlServerTaskOutputDatabaseLevel.class), + @JsonSubTypes.Type(name = "LoginLevelOutput", value = ConnectToSourceSqlServerTaskOutputLoginLevel.class), + @JsonSubTypes.Type(name = "AgentJobLevelOutput", value = ConnectToSourceSqlServerTaskOutputAgentJobLevel.class) +}) +@Immutable +public class ConnectToSourceSqlServerTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourceSqlServerTaskOutput.class); + + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputAgentJobLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputAgentJobLevel.java new file mode 100644 index 000000000000..dbd27115100f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputAgentJobLevel.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Agent Job level output for the task that validates connection to SQL Server and also validates source server + * requirements. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("AgentJobLevelOutput") +@Immutable +public final class ConnectToSourceSqlServerTaskOutputAgentJobLevel extends ConnectToSourceSqlServerTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ConnectToSourceSqlServerTaskOutputAgentJobLevel.class); + + /* + * Agent Job name + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The type of Agent Job. + */ + @JsonProperty(value = "jobCategory", access = JsonProperty.Access.WRITE_ONLY) + private String jobCategory; + + /* + * The state of the original Agent Job. + */ + @JsonProperty(value = "isEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isEnabled; + + /* + * The owner of the Agent Job + */ + @JsonProperty(value = "jobOwner", access = JsonProperty.Access.WRITE_ONLY) + private String jobOwner; + + /* + * UTC Date and time when the Agent Job was last executed. + */ + @JsonProperty(value = "lastExecutedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastExecutedOn; + + /* + * Validation errors + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /* + * Information about eligibility of agent job for migration. + */ + @JsonProperty(value = "migrationEligibility", access = JsonProperty.Access.WRITE_ONLY) + private MigrationEligibilityInfo migrationEligibility; + + /** + * Get the name property: Agent Job name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the jobCategory property: The type of Agent Job. + * + * @return the jobCategory value. + */ + public String jobCategory() { + return this.jobCategory; + } + + /** + * Get the isEnabled property: The state of the original Agent Job. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Get the jobOwner property: The owner of the Agent Job. + * + * @return the jobOwner value. + */ + public String jobOwner() { + return this.jobOwner; + } + + /** + * Get the lastExecutedOn property: UTC Date and time when the Agent Job was last executed. + * + * @return the lastExecutedOn value. + */ + public OffsetDateTime lastExecutedOn() { + return this.lastExecutedOn; + } + + /** + * Get the validationErrors property: Validation errors. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Get the migrationEligibility property: Information about eligibility of agent job for migration. + * + * @return the migrationEligibility value. + */ + public MigrationEligibilityInfo migrationEligibility() { + return this.migrationEligibility; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + if (migrationEligibility() != null) { + migrationEligibility().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputDatabaseLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputDatabaseLevel.java new file mode 100644 index 000000000000..34d9ef83e763 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputDatabaseLevel.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * Database level output for the task that validates connection to SQL Server and also validates source server + * requirements. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelOutput") +@Immutable +public final class ConnectToSourceSqlServerTaskOutputDatabaseLevel extends ConnectToSourceSqlServerTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ConnectToSourceSqlServerTaskOutputDatabaseLevel.class); + + /* + * Database name + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Size of the file in megabytes + */ + @JsonProperty(value = "sizeMB", access = JsonProperty.Access.WRITE_ONLY) + private Double sizeMB; + + /* + * The list of database files + */ + @JsonProperty(value = "databaseFiles", access = JsonProperty.Access.WRITE_ONLY) + private List databaseFiles; + + /* + * SQL Server compatibility level of database + */ + @JsonProperty(value = "compatibilityLevel", access = JsonProperty.Access.WRITE_ONLY) + private DatabaseCompatLevel compatibilityLevel; + + /* + * State of the database + */ + @JsonProperty(value = "databaseState", access = JsonProperty.Access.WRITE_ONLY) + private DatabaseState databaseState; + + /** + * Get the name property: Database name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the sizeMB property: Size of the file in megabytes. + * + * @return the sizeMB value. + */ + public Double sizeMB() { + return this.sizeMB; + } + + /** + * Get the databaseFiles property: The list of database files. + * + * @return the databaseFiles value. + */ + public List databaseFiles() { + return this.databaseFiles; + } + + /** + * Get the compatibilityLevel property: SQL Server compatibility level of database. + * + * @return the compatibilityLevel value. + */ + public DatabaseCompatLevel compatibilityLevel() { + return this.compatibilityLevel; + } + + /** + * Get the databaseState property: State of the database. + * + * @return the databaseState value. + */ + public DatabaseState databaseState() { + return this.databaseState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (databaseFiles() != null) { + databaseFiles().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputLoginLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputLoginLevel.java new file mode 100644 index 000000000000..cad556c42c9e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputLoginLevel.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Login level output for the task that validates connection to SQL Server and also validates source server + * requirements. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("LoginLevelOutput") +@Immutable +public final class ConnectToSourceSqlServerTaskOutputLoginLevel extends ConnectToSourceSqlServerTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ConnectToSourceSqlServerTaskOutputLoginLevel.class); + + /* + * Login name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The type of login. + */ + @JsonProperty(value = "loginType", access = JsonProperty.Access.WRITE_ONLY) + private LoginType loginType; + + /* + * The default database for the login. + */ + @JsonProperty(value = "defaultDatabase", access = JsonProperty.Access.WRITE_ONLY) + private String defaultDatabase; + + /* + * The state of the login. + */ + @JsonProperty(value = "isEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isEnabled; + + /* + * Information about eligibility of login for migration. + */ + @JsonProperty(value = "migrationEligibility", access = JsonProperty.Access.WRITE_ONLY) + private MigrationEligibilityInfo migrationEligibility; + + /** + * Get the name property: Login name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the loginType property: The type of login. + * + * @return the loginType value. + */ + public LoginType loginType() { + return this.loginType; + } + + /** + * Get the defaultDatabase property: The default database for the login. + * + * @return the defaultDatabase value. + */ + public String defaultDatabase() { + return this.defaultDatabase; + } + + /** + * Get the isEnabled property: The state of the login. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Get the migrationEligibility property: Information about eligibility of login for migration. + * + * @return the migrationEligibility value. + */ + public MigrationEligibilityInfo migrationEligibility() { + return this.migrationEligibility; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (migrationEligibility() != null) { + migrationEligibility().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputTaskLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputTaskLevel.java new file mode 100644 index 000000000000..35afbe6992a5 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskOutputTaskLevel.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** + * Task level output for the task that validates connection to SQL Server and also validates source server requirements. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("TaskLevelOutput") +@Immutable +public final class ConnectToSourceSqlServerTaskOutputTaskLevel extends ConnectToSourceSqlServerTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourceSqlServerTaskOutputTaskLevel.class); + + /* + * Source databases as a map from database name to database id + */ + @JsonProperty(value = "databases", access = JsonProperty.Access.WRITE_ONLY) + private String databases; + + /* + * Source logins as a map from login name to login id. + */ + @JsonProperty(value = "logins", access = JsonProperty.Access.WRITE_ONLY) + private String logins; + + /* + * Source agent jobs as a map from agent job name to id. + */ + @JsonProperty(value = "agentJobs", access = JsonProperty.Access.WRITE_ONLY) + private String agentJobs; + + /* + * Mapping from database name to TDE certificate name, if applicable + */ + @JsonProperty(value = "databaseTdeCertificateMapping", access = JsonProperty.Access.WRITE_ONLY) + private String databaseTdeCertificateMapping; + + /* + * Source server version + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /* + * Source server brand version + */ + @JsonProperty(value = "sourceServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerBrandVersion; + + /* + * Validation errors + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the databases property: Source databases as a map from database name to database id. + * + * @return the databases value. + */ + public String databases() { + return this.databases; + } + + /** + * Get the logins property: Source logins as a map from login name to login id. + * + * @return the logins value. + */ + public String logins() { + return this.logins; + } + + /** + * Get the agentJobs property: Source agent jobs as a map from agent job name to id. + * + * @return the agentJobs value. + */ + public String agentJobs() { + return this.agentJobs; + } + + /** + * Get the databaseTdeCertificateMapping property: Mapping from database name to TDE certificate name, if + * applicable. + * + * @return the databaseTdeCertificateMapping value. + */ + public String databaseTdeCertificateMapping() { + return this.databaseTdeCertificateMapping; + } + + /** + * Get the sourceServerVersion property: Source server version. + * + * @return the sourceServerVersion value. + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get the sourceServerBrandVersion property: Source server brand version. + * + * @return the sourceServerBrandVersion value. + */ + public String sourceServerBrandVersion() { + return this.sourceServerBrandVersion; + } + + /** + * Get the validationErrors property: Validation errors. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskProperties.java new file mode 100644 index 000000000000..d50cec565980 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToSourceSqlServerTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that validates connection to SQL Server and also validates source server requirements. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ConnectToSource.SqlServer") +@Fluent +public final class ConnectToSourceSqlServerTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToSourceSqlServerTaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private ConnectToSourceSqlServerTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public ConnectToSourceSqlServerTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the ConnectToSourceSqlServerTaskProperties object itself. + */ + public ConnectToSourceSqlServerTaskProperties withInput(ConnectToSourceSqlServerTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public ConnectToSourceSqlServerTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForMySqlTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForMySqlTaskInput.java new file mode 100644 index 000000000000..2ce171f1e2ca --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForMySqlTaskInput.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Input for the task that validates connection to Azure Database for MySQL and target server requirements. */ +@Fluent +public final class ConnectToTargetAzureDbForMySqlTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToTargetAzureDbForMySqlTaskInput.class); + + /* + * Connection information for source MySQL server + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private MySqlConnectionInfo sourceConnectionInfo; + + /* + * Connection information for target Azure Database for MySQL server + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private MySqlConnectionInfo targetConnectionInfo; + + /** + * Get the sourceConnectionInfo property: Connection information for source MySQL server. + * + * @return the sourceConnectionInfo value. + */ + public MySqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set the sourceConnectionInfo property: Connection information for source MySQL server. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set. + * @return the ConnectToTargetAzureDbForMySqlTaskInput object itself. + */ + public ConnectToTargetAzureDbForMySqlTaskInput withSourceConnectionInfo(MySqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get the targetConnectionInfo property: Connection information for target Azure Database for MySQL server. + * + * @return the targetConnectionInfo value. + */ + public MySqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set the targetConnectionInfo property: Connection information for target Azure Database for MySQL server. + * + * @param targetConnectionInfo the targetConnectionInfo value to set. + * @return the ConnectToTargetAzureDbForMySqlTaskInput object itself. + */ + public ConnectToTargetAzureDbForMySqlTaskInput withTargetConnectionInfo(MySqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceConnectionInfo in model" + + " ConnectToTargetAzureDbForMySqlTaskInput")); + } else { + sourceConnectionInfo().validate(); + } + if (targetConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetConnectionInfo in model" + + " ConnectToTargetAzureDbForMySqlTaskInput")); + } else { + targetConnectionInfo().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForMySqlTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForMySqlTaskOutput.java new file mode 100644 index 000000000000..07ddbedeeafa --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForMySqlTaskOutput.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Output for the task that validates connection to Azure Database for MySQL and target server requirements. */ +@Immutable +public final class ConnectToTargetAzureDbForMySqlTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToTargetAzureDbForMySqlTaskOutput.class); + + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Version of the target server + */ + @JsonProperty(value = "serverVersion", access = JsonProperty.Access.WRITE_ONLY) + private String serverVersion; + + /* + * List of databases on target server + */ + @JsonProperty(value = "databases", access = JsonProperty.Access.WRITE_ONLY) + private List databases; + + /* + * Target server brand version + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /* + * Validation errors associated with the task + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the serverVersion property: Version of the target server. + * + * @return the serverVersion value. + */ + public String serverVersion() { + return this.serverVersion; + } + + /** + * Get the databases property: List of databases on target server. + * + * @return the databases value. + */ + public List databases() { + return this.databases; + } + + /** + * Get the targetServerBrandVersion property: Target server brand version. + * + * @return the targetServerBrandVersion value. + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + + /** + * Get the validationErrors property: Validation errors associated with the task. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForMySqlTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForMySqlTaskProperties.java new file mode 100644 index 000000000000..317173226a86 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForMySqlTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that validates connection to Azure Database for MySQL and target server requirements. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ConnectToTarget.AzureDbForMySql") +@Fluent +public final class ConnectToTargetAzureDbForMySqlTaskProperties extends ProjectTaskProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ConnectToTargetAzureDbForMySqlTaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private ConnectToTargetAzureDbForMySqlTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public ConnectToTargetAzureDbForMySqlTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the ConnectToTargetAzureDbForMySqlTaskProperties object itself. + */ + public ConnectToTargetAzureDbForMySqlTaskProperties withInput(ConnectToTargetAzureDbForMySqlTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public ConnectToTargetAzureDbForMySqlTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.java new file mode 100644 index 000000000000..9cf8c3daf4a7 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.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.datamigration.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; + +/** Input for the task that validates connection to Azure Database for PostgreSQL and target server requirements. */ +@Fluent +public final class ConnectToTargetAzureDbForPostgreSqlSyncTaskInput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ConnectToTargetAzureDbForPostgreSqlSyncTaskInput.class); + + /* + * Connection information for source PostgreSQL server + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private PostgreSqlConnectionInfo sourceConnectionInfo; + + /* + * Connection information for target Azure Database for PostgreSQL server + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private PostgreSqlConnectionInfo targetConnectionInfo; + + /** + * Get the sourceConnectionInfo property: Connection information for source PostgreSQL server. + * + * @return the sourceConnectionInfo value. + */ + public PostgreSqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set the sourceConnectionInfo property: Connection information for source PostgreSQL server. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set. + * @return the ConnectToTargetAzureDbForPostgreSqlSyncTaskInput object itself. + */ + public ConnectToTargetAzureDbForPostgreSqlSyncTaskInput withSourceConnectionInfo( + PostgreSqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get the targetConnectionInfo property: Connection information for target Azure Database for PostgreSQL server. + * + * @return the targetConnectionInfo value. + */ + public PostgreSqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set the targetConnectionInfo property: Connection information for target Azure Database for PostgreSQL server. + * + * @param targetConnectionInfo the targetConnectionInfo value to set. + * @return the ConnectToTargetAzureDbForPostgreSqlSyncTaskInput object itself. + */ + public ConnectToTargetAzureDbForPostgreSqlSyncTaskInput withTargetConnectionInfo( + PostgreSqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceConnectionInfo in model" + + " ConnectToTargetAzureDbForPostgreSqlSyncTaskInput")); + } else { + sourceConnectionInfo().validate(); + } + if (targetConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetConnectionInfo in model" + + " ConnectToTargetAzureDbForPostgreSqlSyncTaskInput")); + } else { + targetConnectionInfo().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.java new file mode 100644 index 000000000000..86cd66fb3e94 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Output for the task that validates connection to Azure Database for PostgreSQL and target server requirements. */ +@Immutable +public final class ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput.class); + + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Version of the target server + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /* + * List of databases on target server + */ + @JsonProperty(value = "databases", access = JsonProperty.Access.WRITE_ONLY) + private List databases; + + /* + * Target server brand version + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /* + * Validation errors associated with the task + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the targetServerVersion property: Version of the target server. + * + * @return the targetServerVersion value. + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get the databases property: List of databases on target server. + * + * @return the databases value. + */ + public List databases() { + return this.databases; + } + + /** + * Get the targetServerBrandVersion property: Target server brand version. + * + * @return the targetServerBrandVersion value. + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + + /** + * Get the validationErrors property: Validation errors associated with the task. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.java new file mode 100644 index 000000000000..6a328efd119e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** + * Properties for the task that validates connection to Azure Database For PostgreSQL server and target server + * requirements for online migration. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ConnectToTarget.AzureDbForPostgreSql.Sync") +@Fluent +public final class ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties extends ProjectTaskProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private ConnectToTargetAzureDbForPostgreSqlSyncTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public ConnectToTargetAzureDbForPostgreSqlSyncTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties object itself. + */ + public ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties withInput( + ConnectToTargetAzureDbForPostgreSqlSyncTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.java new file mode 100644 index 000000000000..a639064f2f80 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.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.datamigration.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; + +/** + * Input for the task that validates connection to Azure Database for PostgreSQL and target server requirements for + * Oracle source. + */ +@Fluent +public final class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.class); + + /* + * Connection information for target Azure Database for PostgreSQL server + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private PostgreSqlConnectionInfo targetConnectionInfo; + + /** + * Get the targetConnectionInfo property: Connection information for target Azure Database for PostgreSQL server. + * + * @return the targetConnectionInfo value. + */ + public PostgreSqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set the targetConnectionInfo property: Connection information for target Azure Database for PostgreSQL server. + * + * @param targetConnectionInfo the targetConnectionInfo value to set. + * @return the ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput object itself. + */ + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput withTargetConnectionInfo( + PostgreSqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetConnectionInfo in model" + + " ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput")); + } else { + targetConnectionInfo().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.java new file mode 100644 index 000000000000..21f68c2f4e84 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.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.datamigration.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; + +/** + * Output for the task that validates connection to Azure Database for PostgreSQL and target server requirements for + * Oracle source. + */ +@Fluent +public final class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.class); + + /* + * Version of the target server + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /* + * List of databases on target server + */ + @JsonProperty(value = "databases", access = JsonProperty.Access.WRITE_ONLY) + private List databases; + + /* + * Target server brand version + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /* + * Validation errors associated with the task + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /* + * Mapping of schemas per database + */ + @JsonProperty(value = "databaseSchemaMap") + private List databaseSchemaMap; + + /** + * Get the targetServerVersion property: Version of the target server. + * + * @return the targetServerVersion value. + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get the databases property: List of databases on target server. + * + * @return the databases value. + */ + public List databases() { + return this.databases; + } + + /** + * Get the targetServerBrandVersion property: Target server brand version. + * + * @return the targetServerBrandVersion value. + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + + /** + * Get the validationErrors property: Validation errors associated with the task. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Get the databaseSchemaMap property: Mapping of schemas per database. + * + * @return the databaseSchemaMap value. + */ + public List databaseSchemaMap() { + return this.databaseSchemaMap; + } + + /** + * Set the databaseSchemaMap property: Mapping of schemas per database. + * + * @param databaseSchemaMap the databaseSchemaMap value to set. + * @return the ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput object itself. + */ + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput withDatabaseSchemaMap( + List databaseSchemaMap) { + this.databaseSchemaMap = databaseSchemaMap; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + if (databaseSchemaMap() != null) { + databaseSchemaMap().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.java new file mode 100644 index 000000000000..7429133c934d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem model. */ +@Fluent +public final class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem.class); + + /* + * The database property. + */ + @JsonProperty(value = "database") + private String database; + + /* + * The schemas property. + */ + @JsonProperty(value = "schemas") + private List schemas; + + /** + * Get the database property: The database property. + * + * @return the database value. + */ + public String database() { + return this.database; + } + + /** + * Set the database property: The database property. + * + * @param database the database value to set. + * @return the ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem object itself. + */ + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem withDatabase(String database) { + this.database = database; + return this; + } + + /** + * Get the schemas property: The schemas property. + * + * @return the schemas value. + */ + public List schemas() { + return this.schemas; + } + + /** + * Set the schemas property: The schemas property. + * + * @param schemas the schemas value to set. + * @return the ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem object itself. + */ + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem withSchemas( + List schemas) { + this.schemas = schemas; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.java new file mode 100644 index 000000000000..82496a862ac2 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** + * Properties for the task that validates connection to Azure Database For PostgreSQL server and target server + * requirements for online migration for Oracle source. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync") +@Fluent +public final class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties extends ProjectTaskProperties { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties object itself. + */ + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties withInput( + ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbSyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbSyncTaskInput.java new file mode 100644 index 000000000000..ccab5bb5c749 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbSyncTaskInput.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Input for the task that validates connection to Azure SQL DB and target server requirements. */ +@Fluent +public final class ConnectToTargetSqlDbSyncTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToTargetSqlDbSyncTaskInput.class); + + /* + * Connection information for source SQL Server + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private SqlConnectionInfo sourceConnectionInfo; + + /* + * Connection information for target SQL DB + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private SqlConnectionInfo targetConnectionInfo; + + /** + * Get the sourceConnectionInfo property: Connection information for source SQL Server. + * + * @return the sourceConnectionInfo value. + */ + public SqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set the sourceConnectionInfo property: Connection information for source SQL Server. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set. + * @return the ConnectToTargetSqlDbSyncTaskInput object itself. + */ + public ConnectToTargetSqlDbSyncTaskInput withSourceConnectionInfo(SqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get the targetConnectionInfo property: Connection information for target SQL DB. + * + * @return the targetConnectionInfo value. + */ + public SqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set the targetConnectionInfo property: Connection information for target SQL DB. + * + * @param targetConnectionInfo the targetConnectionInfo value to set. + * @return the ConnectToTargetSqlDbSyncTaskInput object itself. + */ + public ConnectToTargetSqlDbSyncTaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceConnectionInfo in model ConnectToTargetSqlDbSyncTaskInput")); + } else { + sourceConnectionInfo().validate(); + } + if (targetConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetConnectionInfo in model ConnectToTargetSqlDbSyncTaskInput")); + } else { + targetConnectionInfo().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbSyncTaskProperties.java new file mode 100644 index 000000000000..489fcdbaec66 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbSyncTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that validates connection to SQL DB and target server requirements for online migration. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ConnectToTarget.SqlDb.Sync") +@Fluent +public final class ConnectToTargetSqlDbSyncTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToTargetSqlDbSyncTaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private ConnectToTargetSqlDbSyncTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public ConnectToTargetSqlDbSyncTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the ConnectToTargetSqlDbSyncTaskProperties object itself. + */ + public ConnectToTargetSqlDbSyncTaskProperties withInput(ConnectToTargetSqlDbSyncTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public ConnectToTargetSqlDbSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbTaskInput.java new file mode 100644 index 000000000000..2a542e7b57e7 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbTaskInput.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Input for the task that validates connection to SQL DB and target server requirements. */ +@Fluent +public final class ConnectToTargetSqlDbTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToTargetSqlDbTaskInput.class); + + /* + * Connection information for target SQL DB + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private SqlConnectionInfo targetConnectionInfo; + + /** + * Get the targetConnectionInfo property: Connection information for target SQL DB. + * + * @return the targetConnectionInfo value. + */ + public SqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set the targetConnectionInfo property: Connection information for target SQL DB. + * + * @param targetConnectionInfo the targetConnectionInfo value to set. + * @return the ConnectToTargetSqlDbTaskInput object itself. + */ + public ConnectToTargetSqlDbTaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetConnectionInfo in model ConnectToTargetSqlDbTaskInput")); + } else { + targetConnectionInfo().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbTaskOutput.java new file mode 100644 index 000000000000..d9dabc75a9d4 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbTaskOutput.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.datamigration.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; + +/** Output for the task that validates connection to SQL DB and target server requirements. */ +@Immutable +public final class ConnectToTargetSqlDbTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToTargetSqlDbTaskOutput.class); + + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Source databases as a map from database name to database id + */ + @JsonProperty(value = "databases", access = JsonProperty.Access.WRITE_ONLY) + private String databases; + + /* + * Version of the target server + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /* + * Target server brand version + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the databases property: Source databases as a map from database name to database id. + * + * @return the databases value. + */ + public String databases() { + return this.databases; + } + + /** + * Get the targetServerVersion property: Version of the target server. + * + * @return the targetServerVersion value. + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get the targetServerBrandVersion property: Target server brand version. + * + * @return the targetServerBrandVersion value. + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbTaskProperties.java new file mode 100644 index 000000000000..b4dcd8d269f0 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlDbTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that validates connection to SQL DB and target server requirements. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ConnectToTarget.SqlDb") +@Fluent +public final class ConnectToTargetSqlDbTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToTargetSqlDbTaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private ConnectToTargetSqlDbTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public ConnectToTargetSqlDbTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the ConnectToTargetSqlDbTaskProperties object itself. + */ + public ConnectToTargetSqlDbTaskProperties withInput(ConnectToTargetSqlDbTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public ConnectToTargetSqlDbTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMISyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMISyncTaskInput.java new file mode 100644 index 000000000000..0628a4cc1ce5 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMISyncTaskInput.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Input for the task that validates connection to Azure SQL Database Managed Instance online scenario. */ +@Fluent +public final class ConnectToTargetSqlMISyncTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToTargetSqlMISyncTaskInput.class); + + /* + * Connection information for Azure SQL Database Managed Instance + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private MiSqlConnectionInfo targetConnectionInfo; + + /* + * Azure Active Directory Application the DMS instance will use to connect + * to the target instance of Azure SQL Database Managed Instance and the + * Azure Storage Account + */ + @JsonProperty(value = "azureApp", required = true) + private AzureActiveDirectoryApp azureApp; + + /** + * Get the targetConnectionInfo property: Connection information for Azure SQL Database Managed Instance. + * + * @return the targetConnectionInfo value. + */ + public MiSqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set the targetConnectionInfo property: Connection information for Azure SQL Database Managed Instance. + * + * @param targetConnectionInfo the targetConnectionInfo value to set. + * @return the ConnectToTargetSqlMISyncTaskInput object itself. + */ + public ConnectToTargetSqlMISyncTaskInput withTargetConnectionInfo(MiSqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Get the azureApp property: Azure Active Directory Application the DMS instance will use to connect to the target + * instance of Azure SQL Database Managed Instance and the Azure Storage Account. + * + * @return the azureApp value. + */ + public AzureActiveDirectoryApp azureApp() { + return this.azureApp; + } + + /** + * Set the azureApp property: Azure Active Directory Application the DMS instance will use to connect to the target + * instance of Azure SQL Database Managed Instance and the Azure Storage Account. + * + * @param azureApp the azureApp value to set. + * @return the ConnectToTargetSqlMISyncTaskInput object itself. + */ + public ConnectToTargetSqlMISyncTaskInput withAzureApp(AzureActiveDirectoryApp azureApp) { + this.azureApp = azureApp; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetConnectionInfo in model ConnectToTargetSqlMISyncTaskInput")); + } else { + targetConnectionInfo().validate(); + } + if (azureApp() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property azureApp in model ConnectToTargetSqlMISyncTaskInput")); + } else { + azureApp().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMISyncTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMISyncTaskOutput.java new file mode 100644 index 000000000000..e678c6bc4abe --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMISyncTaskOutput.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.datamigration.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; + +/** Output for the task that validates connection to Azure SQL Database Managed Instance. */ +@Immutable +public final class ConnectToTargetSqlMISyncTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToTargetSqlMISyncTaskOutput.class); + + /* + * Target server version + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /* + * Target server brand version + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /* + * Validation errors + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the targetServerVersion property: Target server version. + * + * @return the targetServerVersion value. + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get the targetServerBrandVersion property: Target server brand version. + * + * @return the targetServerBrandVersion value. + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + + /** + * Get the validationErrors property: Validation errors. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMISyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMISyncTaskProperties.java new file mode 100644 index 000000000000..a5f56041a560 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMISyncTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that validates connection to Azure SQL Database Managed Instance. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ConnectToTarget.AzureSqlDbMI.Sync.LRS") +@Fluent +public final class ConnectToTargetSqlMISyncTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToTargetSqlMISyncTaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private ConnectToTargetSqlMISyncTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public ConnectToTargetSqlMISyncTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the ConnectToTargetSqlMISyncTaskProperties object itself. + */ + public ConnectToTargetSqlMISyncTaskProperties withInput(ConnectToTargetSqlMISyncTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public ConnectToTargetSqlMISyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMITaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMITaskInput.java new file mode 100644 index 000000000000..a8e44be465cb --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMITaskInput.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.datamigration.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; + +/** Input for the task that validates connection to Azure SQL Database Managed Instance. */ +@Fluent +public final class ConnectToTargetSqlMITaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToTargetSqlMITaskInput.class); + + /* + * Connection information for target SQL Server + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private SqlConnectionInfo targetConnectionInfo; + + /* + * Flag for whether to collect logins from target SQL MI server. + */ + @JsonProperty(value = "collectLogins") + private Boolean collectLogins; + + /* + * Flag for whether to collect agent jobs from target SQL MI server. + */ + @JsonProperty(value = "collectAgentJobs") + private Boolean collectAgentJobs; + + /* + * Flag for whether to validate SSIS catalog is reachable on the target SQL + * MI server. + */ + @JsonProperty(value = "validateSsisCatalogOnly") + private Boolean validateSsisCatalogOnly; + + /** + * Get the targetConnectionInfo property: Connection information for target SQL Server. + * + * @return the targetConnectionInfo value. + */ + public SqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set the targetConnectionInfo property: Connection information for target SQL Server. + * + * @param targetConnectionInfo the targetConnectionInfo value to set. + * @return the ConnectToTargetSqlMITaskInput object itself. + */ + public ConnectToTargetSqlMITaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Get the collectLogins property: Flag for whether to collect logins from target SQL MI server. + * + * @return the collectLogins value. + */ + public Boolean collectLogins() { + return this.collectLogins; + } + + /** + * Set the collectLogins property: Flag for whether to collect logins from target SQL MI server. + * + * @param collectLogins the collectLogins value to set. + * @return the ConnectToTargetSqlMITaskInput object itself. + */ + public ConnectToTargetSqlMITaskInput withCollectLogins(Boolean collectLogins) { + this.collectLogins = collectLogins; + return this; + } + + /** + * Get the collectAgentJobs property: Flag for whether to collect agent jobs from target SQL MI server. + * + * @return the collectAgentJobs value. + */ + public Boolean collectAgentJobs() { + return this.collectAgentJobs; + } + + /** + * Set the collectAgentJobs property: Flag for whether to collect agent jobs from target SQL MI server. + * + * @param collectAgentJobs the collectAgentJobs value to set. + * @return the ConnectToTargetSqlMITaskInput object itself. + */ + public ConnectToTargetSqlMITaskInput withCollectAgentJobs(Boolean collectAgentJobs) { + this.collectAgentJobs = collectAgentJobs; + return this; + } + + /** + * Get the validateSsisCatalogOnly property: Flag for whether to validate SSIS catalog is reachable on the target + * SQL MI server. + * + * @return the validateSsisCatalogOnly value. + */ + public Boolean validateSsisCatalogOnly() { + return this.validateSsisCatalogOnly; + } + + /** + * Set the validateSsisCatalogOnly property: Flag for whether to validate SSIS catalog is reachable on the target + * SQL MI server. + * + * @param validateSsisCatalogOnly the validateSsisCatalogOnly value to set. + * @return the ConnectToTargetSqlMITaskInput object itself. + */ + public ConnectToTargetSqlMITaskInput withValidateSsisCatalogOnly(Boolean validateSsisCatalogOnly) { + this.validateSsisCatalogOnly = validateSsisCatalogOnly; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetConnectionInfo in model ConnectToTargetSqlMITaskInput")); + } else { + targetConnectionInfo().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMITaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMITaskOutput.java new file mode 100644 index 000000000000..a08a08262842 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMITaskOutput.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.datamigration.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; + +/** Output for the task that validates connection to Azure SQL Database Managed Instance. */ +@Immutable +public final class ConnectToTargetSqlMITaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToTargetSqlMITaskOutput.class); + + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Target server version + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /* + * Target server brand version + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /* + * List of logins on the target server. + */ + @JsonProperty(value = "logins", access = JsonProperty.Access.WRITE_ONLY) + private List logins; + + /* + * List of agent jobs on the target server. + */ + @JsonProperty(value = "agentJobs", access = JsonProperty.Access.WRITE_ONLY) + private List agentJobs; + + /* + * Validation errors + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the targetServerVersion property: Target server version. + * + * @return the targetServerVersion value. + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get the targetServerBrandVersion property: Target server brand version. + * + * @return the targetServerBrandVersion value. + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + + /** + * Get the logins property: List of logins on the target server. + * + * @return the logins value. + */ + public List logins() { + return this.logins; + } + + /** + * Get the agentJobs property: List of agent jobs on the target server. + * + * @return the agentJobs value. + */ + public List agentJobs() { + return this.agentJobs; + } + + /** + * Get the validationErrors property: Validation errors. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMITaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMITaskProperties.java new file mode 100644 index 000000000000..7c750b8a9992 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectToTargetSqlMITaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that validates connection to Azure SQL Database Managed Instance. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ConnectToTarget.AzureSqlDbMI") +@Fluent +public final class ConnectToTargetSqlMITaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectToTargetSqlMITaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private ConnectToTargetSqlMITaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public ConnectToTargetSqlMITaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the ConnectToTargetSqlMITaskProperties object itself. + */ + public ConnectToTargetSqlMITaskProperties withInput(ConnectToTargetSqlMITaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public ConnectToTargetSqlMITaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectionInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectionInfo.java new file mode 100644 index 000000000000..f761b47ac7d2 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ConnectionInfo.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the connection properties of a server. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + defaultImpl = ConnectionInfo.class) +@JsonTypeName("ConnectionInfo") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "MongoDbConnectionInfo", value = MongoDbConnectionInfo.class), + @JsonSubTypes.Type(name = "SqlConnectionInfo", value = SqlConnectionInfo.class), + @JsonSubTypes.Type(name = "MySqlConnectionInfo", value = MySqlConnectionInfo.class), + @JsonSubTypes.Type(name = "OracleConnectionInfo", value = OracleConnectionInfo.class), + @JsonSubTypes.Type(name = "PostgreSqlConnectionInfo", value = PostgreSqlConnectionInfo.class), + @JsonSubTypes.Type(name = "MiSqlConnectionInfo", value = MiSqlConnectionInfo.class) +}) +@Fluent +public class ConnectionInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionInfo.class); + + /* + * User name + */ + @JsonProperty(value = "userName") + private String username; + + /* + * Password credential. + */ + @JsonProperty(value = "password") + private String password; + + /** + * Get the username property: User name. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: User name. + * + * @param username the username value to set. + * @return the ConnectionInfo object itself. + */ + public ConnectionInfo withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: Password credential. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Password credential. + * + * @param password the password value to set. + * @return the ConnectionInfo object itself. + */ + public ConnectionInfo withPassword(String password) { + this.password = password; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataIntegrityValidationResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataIntegrityValidationResult.java new file mode 100644 index 000000000000..3066ec84ffb9 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataIntegrityValidationResult.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Results for checksum based Data Integrity validation results. */ +@Fluent +public final class DataIntegrityValidationResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataIntegrityValidationResult.class); + + /* + * List of failed table names of source and target pair + */ + @JsonProperty(value = "failedObjects") + private Map failedObjects; + + /* + * List of errors that happened while performing data integrity validation + */ + @JsonProperty(value = "validationErrors") + private ValidationError validationErrors; + + /** + * Get the failedObjects property: List of failed table names of source and target pair. + * + * @return the failedObjects value. + */ + public Map failedObjects() { + return this.failedObjects; + } + + /** + * Set the failedObjects property: List of failed table names of source and target pair. + * + * @param failedObjects the failedObjects value to set. + * @return the DataIntegrityValidationResult object itself. + */ + public DataIntegrityValidationResult withFailedObjects(Map failedObjects) { + this.failedObjects = failedObjects; + return this; + } + + /** + * Get the validationErrors property: List of errors that happened while performing data integrity validation. + * + * @return the validationErrors value. + */ + public ValidationError validationErrors() { + return this.validationErrors; + } + + /** + * Set the validationErrors property: List of errors that happened while performing data integrity validation. + * + * @param validationErrors the validationErrors value to set. + * @return the DataIntegrityValidationResult object itself. + */ + public DataIntegrityValidationResult withValidationErrors(ValidationError validationErrors) { + this.validationErrors = validationErrors; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validationErrors() != null) { + validationErrors().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataItemMigrationSummaryResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataItemMigrationSummaryResult.java new file mode 100644 index 000000000000..377fa2f0f3dc --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataItemMigrationSummaryResult.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Basic summary of a data item migration. */ +@Immutable +public class DataItemMigrationSummaryResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataItemMigrationSummaryResult.class); + + /* + * Name of the item + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Current state of migration + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /* + * Status message + */ + @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String statusMessage; + + /* + * Number of items + */ + @JsonProperty(value = "itemsCount", access = JsonProperty.Access.WRITE_ONLY) + private Long itemsCount; + + /* + * Number of successfully completed items + */ + @JsonProperty(value = "itemsCompletedCount", access = JsonProperty.Access.WRITE_ONLY) + private Long itemsCompletedCount; + + /* + * Wildcard string prefix to use for querying all errors of the item + */ + @JsonProperty(value = "errorPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String errorPrefix; + + /* + * Wildcard string prefix to use for querying all sub-tem results of the + * item + */ + @JsonProperty(value = "resultPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String resultPrefix; + + /** + * Get the name property: Name of the item. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the state property: Current state of migration. + * + * @return the state value. + */ + public MigrationState state() { + return this.state; + } + + /** + * Get the statusMessage property: Status message. + * + * @return the statusMessage value. + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Get the itemsCount property: Number of items. + * + * @return the itemsCount value. + */ + public Long itemsCount() { + return this.itemsCount; + } + + /** + * Get the itemsCompletedCount property: Number of successfully completed items. + * + * @return the itemsCompletedCount value. + */ + public Long itemsCompletedCount() { + return this.itemsCompletedCount; + } + + /** + * Get the errorPrefix property: Wildcard string prefix to use for querying all errors of the item. + * + * @return the errorPrefix value. + */ + public String errorPrefix() { + return this.errorPrefix; + } + + /** + * Get the resultPrefix property: Wildcard string prefix to use for querying all sub-tem results of the item. + * + * @return the resultPrefix value. + */ + public String resultPrefix() { + return this.resultPrefix; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationError.java new file mode 100644 index 000000000000..805a9a6701bd --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationError.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Migration Task errors. */ +@Fluent +public final class DataMigrationError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataMigrationError.class); + + /* + * Error description + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * Error type + */ + @JsonProperty(value = "type") + private ErrorType type; + + /** + * Get the message property: Error description. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the type property: Error type. + * + * @return the type value. + */ + public ErrorType type() { + return this.type; + } + + /** + * Set the type property: Error type. + * + * @param type the type value to set. + * @return the DataMigrationError object itself. + */ + public DataMigrationError withType(ErrorType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationResultCode.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationResultCode.java new file mode 100644 index 000000000000..affe03594063 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationResultCode.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DataMigrationResultCode. */ +public final class DataMigrationResultCode extends ExpandableStringEnum { + /** Static value Initial for DataMigrationResultCode. */ + public static final DataMigrationResultCode INITIAL = fromString("Initial"); + + /** Static value Completed for DataMigrationResultCode. */ + public static final DataMigrationResultCode COMPLETED = fromString("Completed"); + + /** Static value ObjectNotExistsInSource for DataMigrationResultCode. */ + public static final DataMigrationResultCode OBJECT_NOT_EXISTS_IN_SOURCE = fromString("ObjectNotExistsInSource"); + + /** Static value ObjectNotExistsInTarget for DataMigrationResultCode. */ + public static final DataMigrationResultCode OBJECT_NOT_EXISTS_IN_TARGET = fromString("ObjectNotExistsInTarget"); + + /** Static value TargetObjectIsInaccessible for DataMigrationResultCode. */ + public static final DataMigrationResultCode TARGET_OBJECT_IS_INACCESSIBLE = + fromString("TargetObjectIsInaccessible"); + + /** Static value FatalError for DataMigrationResultCode. */ + public static final DataMigrationResultCode FATAL_ERROR = fromString("FatalError"); + + /** + * Creates or finds a DataMigrationResultCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataMigrationResultCode. + */ + @JsonCreator + public static DataMigrationResultCode fromString(String name) { + return fromString(name, DataMigrationResultCode.class); + } + + /** @return known DataMigrationResultCode values. */ + public static Collection values() { + return values(DataMigrationResultCode.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationService.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationService.java new file mode 100644 index 000000000000..e50f8f61102b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationService.java @@ -0,0 +1,474 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.DataMigrationServiceInner; +import java.util.Map; + +/** An immutable client-side representation of DataMigrationService. */ +public interface DataMigrationService { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: HTTP strong entity tag value. Ignored if submitted. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the kind property: The resource kind. Only 'vm' (the default) is supported. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the sku property: Service SKU. + * + * @return the sku value. + */ + ServiceSku sku(); + + /** + * Gets the provisioningState property: The resource's provisioning state. + * + * @return the provisioningState value. + */ + ServiceProvisioningState provisioningState(); + + /** + * Gets the publicKey property: The public key of the service, used to encrypt secrets sent to the service. + * + * @return the publicKey value. + */ + String publicKey(); + + /** + * Gets the virtualSubnetId property: The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the + * service should be joined. + * + * @return the virtualSubnetId value. + */ + String virtualSubnetId(); + + /** + * Gets the virtualNicId property: The ID of the Microsoft.Network/networkInterfaces resource which the service + * have. + * + * @return the virtualNicId value. + */ + String virtualNicId(); + + /** + * 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.datamigration.fluent.models.DataMigrationServiceInner object. + * + * @return the inner object. + */ + DataMigrationServiceInner innerModel(); + + /** The entirety of the DataMigrationService definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The DataMigrationService definition stages. */ + interface DefinitionStages { + /** The first stage of the DataMigrationService definition. */ + interface Blank extends WithLocation { + } + /** The stage of the DataMigrationService definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the DataMigrationService definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies groupName. + * + * @param groupName Name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String groupName); + } + /** + * The stage of the DataMigrationService 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.WithEtag, + DefinitionStages.WithKind, + DefinitionStages.WithSku, + DefinitionStages.WithPublicKey, + DefinitionStages.WithVirtualSubnetId, + DefinitionStages.WithVirtualNicId { + /** + * Executes the create request. + * + * @return the created resource. + */ + DataMigrationService create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DataMigrationService create(Context context); + } + /** The stage of the DataMigrationService definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the DataMigrationService definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: HTTP strong entity tag value. Ignored if submitted. + * + * @param etag HTTP strong entity tag value. Ignored if submitted. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the DataMigrationService definition allowing to specify kind. */ + interface WithKind { + /** + * Specifies the kind property: The resource kind. Only 'vm' (the default) is supported.. + * + * @param kind The resource kind. Only 'vm' (the default) is supported. + * @return the next definition stage. + */ + WithCreate withKind(String kind); + } + /** The stage of the DataMigrationService definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Service SKU. + * + * @param sku Service SKU. + * @return the next definition stage. + */ + WithCreate withSku(ServiceSku sku); + } + /** The stage of the DataMigrationService definition allowing to specify publicKey. */ + interface WithPublicKey { + /** + * Specifies the publicKey property: The public key of the service, used to encrypt secrets sent to the + * service. + * + * @param publicKey The public key of the service, used to encrypt secrets sent to the service. + * @return the next definition stage. + */ + WithCreate withPublicKey(String publicKey); + } + /** The stage of the DataMigrationService definition allowing to specify virtualSubnetId. */ + interface WithVirtualSubnetId { + /** + * Specifies the virtualSubnetId property: The ID of the Microsoft.Network/virtualNetworks/subnets resource + * to which the service should be joined. + * + * @param virtualSubnetId The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the + * service should be joined. + * @return the next definition stage. + */ + WithCreate withVirtualSubnetId(String virtualSubnetId); + } + /** The stage of the DataMigrationService definition allowing to specify virtualNicId. */ + interface WithVirtualNicId { + /** + * Specifies the virtualNicId property: The ID of the Microsoft.Network/networkInterfaces resource which the + * service have. + * + * @param virtualNicId The ID of the Microsoft.Network/networkInterfaces resource which the service have. + * @return the next definition stage. + */ + WithCreate withVirtualNicId(String virtualNicId); + } + } + /** + * Begins update for the DataMigrationService resource. + * + * @return the stage of resource update. + */ + DataMigrationService.Update update(); + + /** The template for DataMigrationService update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithEtag, + UpdateStages.WithKind, + UpdateStages.WithSku, + UpdateStages.WithPublicKey, + UpdateStages.WithVirtualSubnetId, + UpdateStages.WithVirtualNicId { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DataMigrationService apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DataMigrationService apply(Context context); + } + /** The DataMigrationService update stages. */ + interface UpdateStages { + /** The stage of the DataMigrationService update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the DataMigrationService update allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: HTTP strong entity tag value. Ignored if submitted. + * + * @param etag HTTP strong entity tag value. Ignored if submitted. + * @return the next definition stage. + */ + Update withEtag(String etag); + } + /** The stage of the DataMigrationService update allowing to specify kind. */ + interface WithKind { + /** + * Specifies the kind property: The resource kind. Only 'vm' (the default) is supported.. + * + * @param kind The resource kind. Only 'vm' (the default) is supported. + * @return the next definition stage. + */ + Update withKind(String kind); + } + /** The stage of the DataMigrationService update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Service SKU. + * + * @param sku Service SKU. + * @return the next definition stage. + */ + Update withSku(ServiceSku sku); + } + /** The stage of the DataMigrationService update allowing to specify publicKey. */ + interface WithPublicKey { + /** + * Specifies the publicKey property: The public key of the service, used to encrypt secrets sent to the + * service. + * + * @param publicKey The public key of the service, used to encrypt secrets sent to the service. + * @return the next definition stage. + */ + Update withPublicKey(String publicKey); + } + /** The stage of the DataMigrationService update allowing to specify virtualSubnetId. */ + interface WithVirtualSubnetId { + /** + * Specifies the virtualSubnetId property: The ID of the Microsoft.Network/virtualNetworks/subnets resource + * to which the service should be joined. + * + * @param virtualSubnetId The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the + * service should be joined. + * @return the next definition stage. + */ + Update withVirtualSubnetId(String virtualSubnetId); + } + /** The stage of the DataMigrationService update allowing to specify virtualNicId. */ + interface WithVirtualNicId { + /** + * Specifies the virtualNicId property: The ID of the Microsoft.Network/networkInterfaces resource which the + * service have. + * + * @param virtualNicId The ID of the Microsoft.Network/networkInterfaces resource which the service have. + * @return the next definition stage. + */ + Update withVirtualNicId(String virtualNicId); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DataMigrationService refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DataMigrationService refresh(Context context); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * performs a health check and returns the status of the service and virtual machine size. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service health status. + */ + DataMigrationServiceStatusResponse checkStatus(); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * performs a health check and returns the status of the service and virtual machine size. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service health status. + */ + Response checkStatusWithResponse(Context context); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * starts the service and the service can be used for data migration. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * starts the service and the service can be used for data migration. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(Context context); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action stops + * the service and the service cannot be used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @throws com.azure.core.management.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 stop(); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action stops + * the service and the service cannot be used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 stop(Context context); + + /** + * This method checks whether a proposed nested resource name is valid and available. + * + * @param parameters Requested name to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return indicates whether a proposed resource name is available. + */ + NameAvailabilityResponse checkChildrenNameAvailability(NameAvailabilityRequest parameters); + + /** + * This method checks whether a proposed nested resource name is valid and available. + * + * @param parameters Requested name to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return indicates whether a proposed resource name is available. + */ + Response checkChildrenNameAvailabilityWithResponse( + NameAvailabilityRequest parameters, Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationServiceList.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationServiceList.java new file mode 100644 index 000000000000..45333a416e36 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationServiceList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.models.DataMigrationServiceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** OData page of service objects. */ +@Fluent +public final class DataMigrationServiceList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataMigrationServiceList.class); + + /* + * List of services + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to load the next page of services + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of services. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of services. + * + * @param value the value value to set. + * @return the DataMigrationServiceList object itself. + */ + public DataMigrationServiceList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to load the next page of services. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to load the next page of services. + * + * @param nextLink the nextLink value to set. + * @return the DataMigrationServiceList object itself. + */ + public DataMigrationServiceList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationServiceStatusResponse.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationServiceStatusResponse.java new file mode 100644 index 000000000000..57c244272945 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DataMigrationServiceStatusResponse.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.resourcemanager.datamigration.fluent.models.DataMigrationServiceStatusResponseInner; +import java.util.List; + +/** An immutable client-side representation of DataMigrationServiceStatusResponse. */ +public interface DataMigrationServiceStatusResponse { + /** + * Gets the agentVersion property: The DMS instance agent version. + * + * @return the agentVersion value. + */ + String agentVersion(); + + /** + * Gets the status property: The machine-readable status, such as 'Initializing', 'Offline', 'Online', 'Deploying', + * 'Deleting', 'Stopped', 'Stopping', 'Starting', 'FailedToStart', 'FailedToStop' or 'Failed'. + * + * @return the status value. + */ + String status(); + + /** + * Gets the vmSize property: The services virtual machine size, such as 'Standard_D2_v2'. + * + * @return the vmSize value. + */ + String vmSize(); + + /** + * Gets the supportedTaskTypes property: The list of supported task types. + * + * @return the supportedTaskTypes value. + */ + List supportedTaskTypes(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.DataMigrationServiceStatusResponseInner + * object. + * + * @return the inner object. + */ + DataMigrationServiceStatusResponseInner innerModel(); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseBackupInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseBackupInfo.java new file mode 100644 index 000000000000..72dd6c49188a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseBackupInfo.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Information about backup files when existing backup mode is used. */ +@Immutable +public final class DatabaseBackupInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseBackupInfo.class); + + /* + * Database name. + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /* + * Backup Type. + */ + @JsonProperty(value = "backupType", access = JsonProperty.Access.WRITE_ONLY) + private BackupType backupType; + + /* + * The list of backup files for the current database. + */ + @JsonProperty(value = "backupFiles", access = JsonProperty.Access.WRITE_ONLY) + private List backupFiles; + + /* + * Position of current database backup in the file. + */ + @JsonProperty(value = "position", access = JsonProperty.Access.WRITE_ONLY) + private Integer position; + + /* + * Database was damaged when backed up, but the backup operation was + * requested to continue despite errors. + */ + @JsonProperty(value = "isDamaged", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDamaged; + + /* + * Whether the backup set is compressed + */ + @JsonProperty(value = "isCompressed", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isCompressed; + + /* + * Number of files in the backup set. + */ + @JsonProperty(value = "familyCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer familyCount; + + /* + * Date and time when the backup operation finished. + */ + @JsonProperty(value = "backupFinishDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime backupFinishDate; + + /** + * Get the databaseName property: Database name. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get the backupType property: Backup Type. + * + * @return the backupType value. + */ + public BackupType backupType() { + return this.backupType; + } + + /** + * Get the backupFiles property: The list of backup files for the current database. + * + * @return the backupFiles value. + */ + public List backupFiles() { + return this.backupFiles; + } + + /** + * Get the position property: Position of current database backup in the file. + * + * @return the position value. + */ + public Integer position() { + return this.position; + } + + /** + * Get the isDamaged property: Database was damaged when backed up, but the backup operation was requested to + * continue despite errors. + * + * @return the isDamaged value. + */ + public Boolean isDamaged() { + return this.isDamaged; + } + + /** + * Get the isCompressed property: Whether the backup set is compressed. + * + * @return the isCompressed value. + */ + public Boolean isCompressed() { + return this.isCompressed; + } + + /** + * Get the familyCount property: Number of files in the backup set. + * + * @return the familyCount value. + */ + public Integer familyCount() { + return this.familyCount; + } + + /** + * Get the backupFinishDate property: Date and time when the backup operation finished. + * + * @return the backupFinishDate value. + */ + public OffsetDateTime backupFinishDate() { + return this.backupFinishDate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseCompatLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseCompatLevel.java new file mode 100644 index 000000000000..aa68bdbe92fc --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseCompatLevel.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DatabaseCompatLevel. */ +public final class DatabaseCompatLevel extends ExpandableStringEnum { + /** Static value CompatLevel80 for DatabaseCompatLevel. */ + public static final DatabaseCompatLevel COMPAT_LEVEL80 = fromString("CompatLevel80"); + + /** Static value CompatLevel90 for DatabaseCompatLevel. */ + public static final DatabaseCompatLevel COMPAT_LEVEL90 = fromString("CompatLevel90"); + + /** Static value CompatLevel100 for DatabaseCompatLevel. */ + public static final DatabaseCompatLevel COMPAT_LEVEL100 = fromString("CompatLevel100"); + + /** Static value CompatLevel110 for DatabaseCompatLevel. */ + public static final DatabaseCompatLevel COMPAT_LEVEL110 = fromString("CompatLevel110"); + + /** Static value CompatLevel120 for DatabaseCompatLevel. */ + public static final DatabaseCompatLevel COMPAT_LEVEL120 = fromString("CompatLevel120"); + + /** Static value CompatLevel130 for DatabaseCompatLevel. */ + public static final DatabaseCompatLevel COMPAT_LEVEL130 = fromString("CompatLevel130"); + + /** Static value CompatLevel140 for DatabaseCompatLevel. */ + public static final DatabaseCompatLevel COMPAT_LEVEL140 = fromString("CompatLevel140"); + + /** + * Creates or finds a DatabaseCompatLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding DatabaseCompatLevel. + */ + @JsonCreator + public static DatabaseCompatLevel fromString(String name) { + return fromString(name, DatabaseCompatLevel.class); + } + + /** @return known DatabaseCompatLevel values. */ + public static Collection values() { + return values(DatabaseCompatLevel.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseFileInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseFileInfo.java new file mode 100644 index 000000000000..da8cd95f1cdc --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseFileInfo.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Database file specific information. */ +@Fluent +public final class DatabaseFileInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseFileInfo.class); + + /* + * Name of the database + */ + @JsonProperty(value = "databaseName") + private String databaseName; + + /* + * Unique identifier for database file + */ + @JsonProperty(value = "id") + private String id; + + /* + * Logical name of the file + */ + @JsonProperty(value = "logicalName") + private String logicalName; + + /* + * Operating-system full path of the file + */ + @JsonProperty(value = "physicalFullName") + private String physicalFullName; + + /* + * Suggested full path of the file for restoring + */ + @JsonProperty(value = "restoreFullName") + private String restoreFullName; + + /* + * Database file type + */ + @JsonProperty(value = "fileType") + private DatabaseFileType fileType; + + /* + * Size of the file in megabytes + */ + @JsonProperty(value = "sizeMB") + private Double sizeMB; + + /** + * Get the databaseName property: Name of the database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: Name of the database. + * + * @param databaseName the databaseName value to set. + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the id property: Unique identifier for database file. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Unique identifier for database file. + * + * @param id the id value to set. + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withId(String id) { + this.id = id; + return this; + } + + /** + * Get the logicalName property: Logical name of the file. + * + * @return the logicalName value. + */ + public String logicalName() { + return this.logicalName; + } + + /** + * Set the logicalName property: Logical name of the file. + * + * @param logicalName the logicalName value to set. + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withLogicalName(String logicalName) { + this.logicalName = logicalName; + return this; + } + + /** + * Get the physicalFullName property: Operating-system full path of the file. + * + * @return the physicalFullName value. + */ + public String physicalFullName() { + return this.physicalFullName; + } + + /** + * Set the physicalFullName property: Operating-system full path of the file. + * + * @param physicalFullName the physicalFullName value to set. + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withPhysicalFullName(String physicalFullName) { + this.physicalFullName = physicalFullName; + return this; + } + + /** + * Get the restoreFullName property: Suggested full path of the file for restoring. + * + * @return the restoreFullName value. + */ + public String restoreFullName() { + return this.restoreFullName; + } + + /** + * Set the restoreFullName property: Suggested full path of the file for restoring. + * + * @param restoreFullName the restoreFullName value to set. + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withRestoreFullName(String restoreFullName) { + this.restoreFullName = restoreFullName; + return this; + } + + /** + * Get the fileType property: Database file type. + * + * @return the fileType value. + */ + public DatabaseFileType fileType() { + return this.fileType; + } + + /** + * Set the fileType property: Database file type. + * + * @param fileType the fileType value to set. + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withFileType(DatabaseFileType fileType) { + this.fileType = fileType; + return this; + } + + /** + * Get the sizeMB property: Size of the file in megabytes. + * + * @return the sizeMB value. + */ + public Double sizeMB() { + return this.sizeMB; + } + + /** + * Set the sizeMB property: Size of the file in megabytes. + * + * @param sizeMB the sizeMB value to set. + * @return the DatabaseFileInfo object itself. + */ + public DatabaseFileInfo withSizeMB(Double sizeMB) { + this.sizeMB = sizeMB; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseFileInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseFileInput.java new file mode 100644 index 000000000000..741ad6aacd9a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseFileInput.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Database file specific information for input. */ +@Fluent +public final class DatabaseFileInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseFileInput.class); + + /* + * Unique identifier for database file + */ + @JsonProperty(value = "id") + private String id; + + /* + * Logical name of the file + */ + @JsonProperty(value = "logicalName") + private String logicalName; + + /* + * Operating-system full path of the file + */ + @JsonProperty(value = "physicalFullName") + private String physicalFullName; + + /* + * Suggested full path of the file for restoring + */ + @JsonProperty(value = "restoreFullName") + private String restoreFullName; + + /* + * Database file type + */ + @JsonProperty(value = "fileType") + private DatabaseFileType fileType; + + /** + * Get the id property: Unique identifier for database file. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Unique identifier for database file. + * + * @param id the id value to set. + * @return the DatabaseFileInput object itself. + */ + public DatabaseFileInput withId(String id) { + this.id = id; + return this; + } + + /** + * Get the logicalName property: Logical name of the file. + * + * @return the logicalName value. + */ + public String logicalName() { + return this.logicalName; + } + + /** + * Set the logicalName property: Logical name of the file. + * + * @param logicalName the logicalName value to set. + * @return the DatabaseFileInput object itself. + */ + public DatabaseFileInput withLogicalName(String logicalName) { + this.logicalName = logicalName; + return this; + } + + /** + * Get the physicalFullName property: Operating-system full path of the file. + * + * @return the physicalFullName value. + */ + public String physicalFullName() { + return this.physicalFullName; + } + + /** + * Set the physicalFullName property: Operating-system full path of the file. + * + * @param physicalFullName the physicalFullName value to set. + * @return the DatabaseFileInput object itself. + */ + public DatabaseFileInput withPhysicalFullName(String physicalFullName) { + this.physicalFullName = physicalFullName; + return this; + } + + /** + * Get the restoreFullName property: Suggested full path of the file for restoring. + * + * @return the restoreFullName value. + */ + public String restoreFullName() { + return this.restoreFullName; + } + + /** + * Set the restoreFullName property: Suggested full path of the file for restoring. + * + * @param restoreFullName the restoreFullName value to set. + * @return the DatabaseFileInput object itself. + */ + public DatabaseFileInput withRestoreFullName(String restoreFullName) { + this.restoreFullName = restoreFullName; + return this; + } + + /** + * Get the fileType property: Database file type. + * + * @return the fileType value. + */ + public DatabaseFileType fileType() { + return this.fileType; + } + + /** + * Set the fileType property: Database file type. + * + * @param fileType the fileType value to set. + * @return the DatabaseFileInput object itself. + */ + public DatabaseFileInput withFileType(DatabaseFileType fileType) { + this.fileType = fileType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseFileType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseFileType.java new file mode 100644 index 000000000000..7f93ebf204fc --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseFileType.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DatabaseFileType. */ +public final class DatabaseFileType extends ExpandableStringEnum { + /** Static value Rows for DatabaseFileType. */ + public static final DatabaseFileType ROWS = fromString("Rows"); + + /** Static value Log for DatabaseFileType. */ + public static final DatabaseFileType LOG = fromString("Log"); + + /** Static value Filestream for DatabaseFileType. */ + public static final DatabaseFileType FILESTREAM = fromString("Filestream"); + + /** Static value NotSupported for DatabaseFileType. */ + public static final DatabaseFileType NOT_SUPPORTED = fromString("NotSupported"); + + /** Static value Fulltext for DatabaseFileType. */ + public static final DatabaseFileType FULLTEXT = fromString("Fulltext"); + + /** + * Creates or finds a DatabaseFileType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DatabaseFileType. + */ + @JsonCreator + public static DatabaseFileType fromString(String name) { + return fromString(name, DatabaseFileType.class); + } + + /** @return known DatabaseFileType values. */ + public static Collection values() { + return values(DatabaseFileType.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseInfo.java new file mode 100644 index 000000000000..12a3552bc302 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseInfo.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.datamigration.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; + +/** Project Database Details. */ +@Fluent +public final class DatabaseInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseInfo.class); + + /* + * Name of the database + */ + @JsonProperty(value = "sourceDatabaseName", required = true) + private String sourceDatabaseName; + + /** + * Get the sourceDatabaseName property: Name of the database. + * + * @return the sourceDatabaseName value. + */ + public String sourceDatabaseName() { + return this.sourceDatabaseName; + } + + /** + * Set the sourceDatabaseName property: Name of the database. + * + * @param sourceDatabaseName the sourceDatabaseName value to set. + * @return the DatabaseInfo object itself. + */ + public DatabaseInfo withSourceDatabaseName(String sourceDatabaseName) { + this.sourceDatabaseName = sourceDatabaseName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceDatabaseName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property sourceDatabaseName in model DatabaseInfo")); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationStage.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationStage.java new file mode 100644 index 000000000000..3c146684a2ea --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationStage.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DatabaseMigrationStage. */ +public final class DatabaseMigrationStage extends ExpandableStringEnum { + /** Static value None for DatabaseMigrationStage. */ + public static final DatabaseMigrationStage NONE = fromString("None"); + + /** Static value Initialize for DatabaseMigrationStage. */ + public static final DatabaseMigrationStage INITIALIZE = fromString("Initialize"); + + /** Static value Backup for DatabaseMigrationStage. */ + public static final DatabaseMigrationStage BACKUP = fromString("Backup"); + + /** Static value FileCopy for DatabaseMigrationStage. */ + public static final DatabaseMigrationStage FILE_COPY = fromString("FileCopy"); + + /** Static value Restore for DatabaseMigrationStage. */ + public static final DatabaseMigrationStage RESTORE = fromString("Restore"); + + /** Static value Completed for DatabaseMigrationStage. */ + public static final DatabaseMigrationStage COMPLETED = fromString("Completed"); + + /** + * Creates or finds a DatabaseMigrationStage from its string representation. + * + * @param name a name to look for. + * @return the corresponding DatabaseMigrationStage. + */ + @JsonCreator + public static DatabaseMigrationStage fromString(String name) { + return fromString(name, DatabaseMigrationStage.class); + } + + /** @return known DatabaseMigrationStage values. */ + public static Collection values() { + return values(DatabaseMigrationStage.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationState.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationState.java new file mode 100644 index 000000000000..629e96df8a7c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseMigrationState.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DatabaseMigrationState. */ +public final class DatabaseMigrationState extends ExpandableStringEnum { + /** Static value UNDEFINED for DatabaseMigrationState. */ + public static final DatabaseMigrationState UNDEFINED = fromString("UNDEFINED"); + + /** Static value INITIAL for DatabaseMigrationState. */ + public static final DatabaseMigrationState INITIAL = fromString("INITIAL"); + + /** Static value FULL_BACKUP_UPLOAD_START for DatabaseMigrationState. */ + public static final DatabaseMigrationState FULL_BACKUP_UPLOAD_START = fromString("FULL_BACKUP_UPLOAD_START"); + + /** Static value LOG_SHIPPING_START for DatabaseMigrationState. */ + public static final DatabaseMigrationState LOG_SHIPPING_START = fromString("LOG_SHIPPING_START"); + + /** Static value UPLOAD_LOG_FILES_START for DatabaseMigrationState. */ + public static final DatabaseMigrationState UPLOAD_LOG_FILES_START = fromString("UPLOAD_LOG_FILES_START"); + + /** Static value CUTOVER_START for DatabaseMigrationState. */ + public static final DatabaseMigrationState CUTOVER_START = fromString("CUTOVER_START"); + + /** Static value POST_CUTOVER_COMPLETE for DatabaseMigrationState. */ + public static final DatabaseMigrationState POST_CUTOVER_COMPLETE = fromString("POST_CUTOVER_COMPLETE"); + + /** Static value COMPLETED for DatabaseMigrationState. */ + public static final DatabaseMigrationState COMPLETED = fromString("COMPLETED"); + + /** Static value CANCELLED for DatabaseMigrationState. */ + public static final DatabaseMigrationState CANCELLED = fromString("CANCELLED"); + + /** Static value FAILED for DatabaseMigrationState. */ + public static final DatabaseMigrationState FAILED = fromString("FAILED"); + + /** + * Creates or finds a DatabaseMigrationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DatabaseMigrationState. + */ + @JsonCreator + public static DatabaseMigrationState fromString(String name) { + return fromString(name, DatabaseMigrationState.class); + } + + /** @return known DatabaseMigrationState values. */ + public static Collection values() { + return values(DatabaseMigrationState.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseState.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseState.java new file mode 100644 index 000000000000..95f4e02fb11c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseState.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DatabaseState. */ +public final class DatabaseState extends ExpandableStringEnum { + /** Static value Online for DatabaseState. */ + public static final DatabaseState ONLINE = fromString("Online"); + + /** Static value Restoring for DatabaseState. */ + public static final DatabaseState RESTORING = fromString("Restoring"); + + /** Static value Recovering for DatabaseState. */ + public static final DatabaseState RECOVERING = fromString("Recovering"); + + /** Static value RecoveryPending for DatabaseState. */ + public static final DatabaseState RECOVERY_PENDING = fromString("RecoveryPending"); + + /** Static value Suspect for DatabaseState. */ + public static final DatabaseState SUSPECT = fromString("Suspect"); + + /** Static value Emergency for DatabaseState. */ + public static final DatabaseState EMERGENCY = fromString("Emergency"); + + /** Static value Offline for DatabaseState. */ + public static final DatabaseState OFFLINE = fromString("Offline"); + + /** Static value Copying for DatabaseState. */ + public static final DatabaseState COPYING = fromString("Copying"); + + /** Static value OfflineSecondary for DatabaseState. */ + public static final DatabaseState OFFLINE_SECONDARY = fromString("OfflineSecondary"); + + /** + * Creates or finds a DatabaseState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DatabaseState. + */ + @JsonCreator + public static DatabaseState fromString(String name) { + return fromString(name, DatabaseState.class); + } + + /** @return known DatabaseState values. */ + public static Collection values() { + return values(DatabaseState.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseSummaryResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseSummaryResult.java new file mode 100644 index 000000000000..cba75a58e8be --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseSummaryResult.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.datamigration.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; + +/** Summary of database results in the migration. */ +@Immutable +public final class DatabaseSummaryResult extends DataItemMigrationSummaryResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseSummaryResult.class); + + /* + * Size of the database in megabytes + */ + @JsonProperty(value = "sizeMB", access = JsonProperty.Access.WRITE_ONLY) + private Double sizeMB; + + /** + * Get the sizeMB property: Size of the database in megabytes. + * + * @return the sizeMB value. + */ + public Double sizeMB() { + return this.sizeMB; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseTable.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseTable.java new file mode 100644 index 000000000000..bfa25420d87e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/DatabaseTable.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.datamigration.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; + +/** Table properties. */ +@Immutable +public final class DatabaseTable { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseTable.class); + + /* + * Indicates whether table is empty or not + */ + @JsonProperty(value = "hasRows", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasRows; + + /* + * Schema-qualified name of the table + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Get the hasRows property: Indicates whether table is empty or not. + * + * @return the hasRows value. + */ + public Boolean hasRows() { + return this.hasRows; + } + + /** + * Get the name property: Schema-qualified name of the table. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ErrorType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ErrorType.java new file mode 100644 index 000000000000..1fbd7170eb44 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ErrorType.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ErrorType. */ +public final class ErrorType extends ExpandableStringEnum { + /** Static value Default for ErrorType. */ + public static final ErrorType DEFAULT = fromString("Default"); + + /** Static value Warning for ErrorType. */ + public static final ErrorType WARNING = fromString("Warning"); + + /** Static value Error for ErrorType. */ + public static final ErrorType ERROR = fromString("Error"); + + /** + * Creates or finds a ErrorType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ErrorType. + */ + @JsonCreator + public static ErrorType fromString(String name) { + return fromString(name, ErrorType.class); + } + + /** @return known ErrorType values. */ + public static Collection values() { + return values(ErrorType.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ExecutionStatistics.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ExecutionStatistics.java new file mode 100644 index 000000000000..190c9843f2b7 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ExecutionStatistics.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; +import java.util.Map; + +/** Description about the errors happen while performing migration validation. */ +@Fluent +public final class ExecutionStatistics { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExecutionStatistics.class); + + /* + * No. of query executions + */ + @JsonProperty(value = "executionCount") + private Long executionCount; + + /* + * CPU Time in millisecond(s) for the query execution + */ + @JsonProperty(value = "cpuTimeMs") + private Float cpuTimeMs; + + /* + * Time taken in millisecond(s) for executing the query + */ + @JsonProperty(value = "elapsedTimeMs") + private Float elapsedTimeMs; + + /* + * Dictionary of sql query execution wait types and the respective + * statistics + */ + @JsonProperty(value = "waitStats") + private Map waitStats; + + /* + * Indicates whether the query resulted in an error + */ + @JsonProperty(value = "hasErrors") + private Boolean hasErrors; + + /* + * List of sql Errors + */ + @JsonProperty(value = "sqlErrors") + private List sqlErrors; + + /** + * Get the executionCount property: No. of query executions. + * + * @return the executionCount value. + */ + public Long executionCount() { + return this.executionCount; + } + + /** + * Set the executionCount property: No. of query executions. + * + * @param executionCount the executionCount value to set. + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withExecutionCount(Long executionCount) { + this.executionCount = executionCount; + return this; + } + + /** + * Get the cpuTimeMs property: CPU Time in millisecond(s) for the query execution. + * + * @return the cpuTimeMs value. + */ + public Float cpuTimeMs() { + return this.cpuTimeMs; + } + + /** + * Set the cpuTimeMs property: CPU Time in millisecond(s) for the query execution. + * + * @param cpuTimeMs the cpuTimeMs value to set. + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withCpuTimeMs(Float cpuTimeMs) { + this.cpuTimeMs = cpuTimeMs; + return this; + } + + /** + * Get the elapsedTimeMs property: Time taken in millisecond(s) for executing the query. + * + * @return the elapsedTimeMs value. + */ + public Float elapsedTimeMs() { + return this.elapsedTimeMs; + } + + /** + * Set the elapsedTimeMs property: Time taken in millisecond(s) for executing the query. + * + * @param elapsedTimeMs the elapsedTimeMs value to set. + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withElapsedTimeMs(Float elapsedTimeMs) { + this.elapsedTimeMs = elapsedTimeMs; + return this; + } + + /** + * Get the waitStats property: Dictionary of sql query execution wait types and the respective statistics. + * + * @return the waitStats value. + */ + public Map waitStats() { + return this.waitStats; + } + + /** + * Set the waitStats property: Dictionary of sql query execution wait types and the respective statistics. + * + * @param waitStats the waitStats value to set. + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withWaitStats(Map waitStats) { + this.waitStats = waitStats; + return this; + } + + /** + * Get the hasErrors property: Indicates whether the query resulted in an error. + * + * @return the hasErrors value. + */ + public Boolean hasErrors() { + return this.hasErrors; + } + + /** + * Set the hasErrors property: Indicates whether the query resulted in an error. + * + * @param hasErrors the hasErrors value to set. + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withHasErrors(Boolean hasErrors) { + this.hasErrors = hasErrors; + return this; + } + + /** + * Get the sqlErrors property: List of sql Errors. + * + * @return the sqlErrors value. + */ + public List sqlErrors() { + return this.sqlErrors; + } + + /** + * Set the sqlErrors property: List of sql Errors. + * + * @param sqlErrors the sqlErrors value to set. + * @return the ExecutionStatistics object itself. + */ + public ExecutionStatistics withSqlErrors(List sqlErrors) { + this.sqlErrors = sqlErrors; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (waitStats() != null) { + waitStats() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileList.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileList.java new file mode 100644 index 000000000000..00dba58191e6 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectFileInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** OData page of files. */ +@Fluent +public final class FileList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FileList.class); + + /* + * List of files + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to load the next page of files + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of files. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of files. + * + * @param value the value value to set. + * @return the FileList object itself. + */ + public FileList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to load the next page of files. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to load the next page of files. + * + * @param nextLink the nextLink value to set. + * @return the FileList object itself. + */ + public FileList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileShare.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileShare.java new file mode 100644 index 000000000000..e9a7d20eb675 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileShare.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 share information with Path, Username, and Password. */ +@Fluent +public final class FileShare { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FileShare.class); + + /* + * User name credential to connect to the share location + */ + @JsonProperty(value = "userName") + private String username; + + /* + * Password credential used to connect to the share location. + */ + @JsonProperty(value = "password") + private String password; + + /* + * The folder path for this share. + */ + @JsonProperty(value = "path", required = true) + private String path; + + /** + * Get the username property: User name credential to connect to the share location. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: User name credential to connect to the share location. + * + * @param username the username value to set. + * @return the FileShare object itself. + */ + public FileShare withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: Password credential used to connect to the share location. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Password credential used to connect to the share location. + * + * @param password the password value to set. + * @return the FileShare object itself. + */ + public FileShare withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the path property: The folder path for this share. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: The folder path for this share. + * + * @param path the path value to set. + * @return the FileShare object itself. + */ + public FileShare withPath(String path) { + this.path = path; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (path() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property path in model FileShare")); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileStorageInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileStorageInfo.java new file mode 100644 index 000000000000..658db604dec3 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/FileStorageInfo.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.datamigration.models; + +import com.azure.resourcemanager.datamigration.fluent.models.FileStorageInfoInner; +import java.util.Map; + +/** An immutable client-side representation of FileStorageInfo. */ +public interface FileStorageInfo { + /** + * Gets the uri property: A URI that can be used to access the file content. + * + * @return the uri value. + */ + String uri(); + + /** + * Gets the headers property: Dictionary of <string>. + * + * @return the headers value. + */ + Map headers(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.FileStorageInfoInner object. + * + * @return the inner object. + */ + FileStorageInfoInner innerModel(); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Files.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Files.java new file mode 100644 index 000000000000..e3a1d00d1710 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Files.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 Files. */ +public interface Files { + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files. + */ + PagedIterable list(String groupName, String serviceName, String projectName); + + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * files owned by a project resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of files. + */ + PagedIterable list(String groupName, String serviceName, String projectName, Context context); + + /** + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + ProjectFile get(String groupName, String serviceName, String projectName, String fileName); + + /** + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a file resource. + */ + Response getWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context); + + /** + * This method deletes a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String groupName, String serviceName, String projectName, String fileName); + + /** + * This method deletes a file. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context); + + /** + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + FileStorageInfo read(String groupName, String serviceName, String projectName, String fileName); + + /** + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + Response readWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context); + + /** + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + FileStorageInfo readWrite(String groupName, String serviceName, String projectName, String fileName); + + /** + * This method is used for requesting information for reading and writing the file content. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param fileName Name of the File. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + Response readWriteWithResponse( + String groupName, String serviceName, String projectName, String fileName, Context context); + + /** + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @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 file resource. + */ + ProjectFile getById(String id); + + /** + * The files resource is a nested, proxy-only resource representing a file stored under the project resource. This + * method retrieves information about a file. + * + * @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 file resource. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * This method deletes a file. + * + * @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); + + /** + * This method deletes a file. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ProjectFile resource. + * + * @param name resource name. + * @return the first stage of the new ProjectFile definition. + */ + ProjectFile.DefinitionStages.Blank define(String name); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetTdeCertificatesSqlTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetTdeCertificatesSqlTaskInput.java new file mode 100644 index 000000000000..d14cd4744e57 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetTdeCertificatesSqlTaskInput.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.datamigration.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; + +/** Input for the task that gets TDE certificates in Base64 encoded format. */ +@Fluent +public final class GetTdeCertificatesSqlTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetTdeCertificatesSqlTaskInput.class); + + /* + * Connection information for SQL Server + */ + @JsonProperty(value = "connectionInfo", required = true) + private SqlConnectionInfo connectionInfo; + + /* + * Backup file share information for file share to be used for temporarily + * storing files. + */ + @JsonProperty(value = "backupFileShare", required = true) + private FileShare backupFileShare; + + /* + * List containing certificate names and corresponding password to use for + * encrypting the exported certificate. + */ + @JsonProperty(value = "selectedCertificates", required = true) + private List selectedCertificates; + + /** + * Get the connectionInfo property: Connection information for SQL Server. + * + * @return the connectionInfo value. + */ + public SqlConnectionInfo connectionInfo() { + return this.connectionInfo; + } + + /** + * Set the connectionInfo property: Connection information for SQL Server. + * + * @param connectionInfo the connectionInfo value to set. + * @return the GetTdeCertificatesSqlTaskInput object itself. + */ + public GetTdeCertificatesSqlTaskInput withConnectionInfo(SqlConnectionInfo connectionInfo) { + this.connectionInfo = connectionInfo; + return this; + } + + /** + * Get the backupFileShare property: Backup file share information for file share to be used for temporarily storing + * files. + * + * @return the backupFileShare value. + */ + public FileShare backupFileShare() { + return this.backupFileShare; + } + + /** + * Set the backupFileShare property: Backup file share information for file share to be used for temporarily storing + * files. + * + * @param backupFileShare the backupFileShare value to set. + * @return the GetTdeCertificatesSqlTaskInput object itself. + */ + public GetTdeCertificatesSqlTaskInput withBackupFileShare(FileShare backupFileShare) { + this.backupFileShare = backupFileShare; + return this; + } + + /** + * Get the selectedCertificates property: List containing certificate names and corresponding password to use for + * encrypting the exported certificate. + * + * @return the selectedCertificates value. + */ + public List selectedCertificates() { + return this.selectedCertificates; + } + + /** + * Set the selectedCertificates property: List containing certificate names and corresponding password to use for + * encrypting the exported certificate. + * + * @param selectedCertificates the selectedCertificates value to set. + * @return the GetTdeCertificatesSqlTaskInput object itself. + */ + public GetTdeCertificatesSqlTaskInput withSelectedCertificates( + List selectedCertificates) { + this.selectedCertificates = selectedCertificates; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property connectionInfo in model GetTdeCertificatesSqlTaskInput")); + } else { + connectionInfo().validate(); + } + if (backupFileShare() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property backupFileShare in model GetTdeCertificatesSqlTaskInput")); + } else { + backupFileShare().validate(); + } + if (selectedCertificates() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectedCertificates in model GetTdeCertificatesSqlTaskInput")); + } else { + selectedCertificates().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetTdeCertificatesSqlTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetTdeCertificatesSqlTaskOutput.java new file mode 100644 index 000000000000..9f60afa9dba2 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetTdeCertificatesSqlTaskOutput.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Output of the task that gets TDE certificates in Base64 encoded format. */ +@Immutable +public final class GetTdeCertificatesSqlTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetTdeCertificatesSqlTaskOutput.class); + + /* + * Mapping from certificate name to base 64 encoded format. + */ + @JsonProperty(value = "base64EncodedCertificates", access = JsonProperty.Access.WRITE_ONLY) + private String base64EncodedCertificates; + + /* + * Validation errors + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the base64EncodedCertificates property: Mapping from certificate name to base 64 encoded format. + * + * @return the base64EncodedCertificates value. + */ + public String base64EncodedCertificates() { + return this.base64EncodedCertificates; + } + + /** + * Get the validationErrors property: Validation errors. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetTdeCertificatesSqlTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetTdeCertificatesSqlTaskProperties.java new file mode 100644 index 000000000000..ecdf5e3eb244 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetTdeCertificatesSqlTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that gets TDE certificates in Base64 encoded format. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("GetTDECertificates.Sql") +@Fluent +public final class GetTdeCertificatesSqlTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetTdeCertificatesSqlTaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private GetTdeCertificatesSqlTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public GetTdeCertificatesSqlTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the GetTdeCertificatesSqlTaskProperties object itself. + */ + public GetTdeCertificatesSqlTaskProperties withInput(GetTdeCertificatesSqlTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public GetTdeCertificatesSqlTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskInput.java new file mode 100644 index 000000000000..9c1d27e824dd --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskInput.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Input for the task that gets the list of tables contained within a provided list of Oracle schemas. */ +@Fluent +public final class GetUserTablesOracleTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesOracleTaskInput.class); + + /* + * Information for connecting to Oracle source + */ + @JsonProperty(value = "connectionInfo", required = true) + private OracleConnectionInfo connectionInfo; + + /* + * List of Oracle schemas for which to collect tables + */ + @JsonProperty(value = "selectedSchemas", required = true) + private List selectedSchemas; + + /** + * Get the connectionInfo property: Information for connecting to Oracle source. + * + * @return the connectionInfo value. + */ + public OracleConnectionInfo connectionInfo() { + return this.connectionInfo; + } + + /** + * Set the connectionInfo property: Information for connecting to Oracle source. + * + * @param connectionInfo the connectionInfo value to set. + * @return the GetUserTablesOracleTaskInput object itself. + */ + public GetUserTablesOracleTaskInput withConnectionInfo(OracleConnectionInfo connectionInfo) { + this.connectionInfo = connectionInfo; + return this; + } + + /** + * Get the selectedSchemas property: List of Oracle schemas for which to collect tables. + * + * @return the selectedSchemas value. + */ + public List selectedSchemas() { + return this.selectedSchemas; + } + + /** + * Set the selectedSchemas property: List of Oracle schemas for which to collect tables. + * + * @param selectedSchemas the selectedSchemas value to set. + * @return the GetUserTablesOracleTaskInput object itself. + */ + public GetUserTablesOracleTaskInput withSelectedSchemas(List selectedSchemas) { + this.selectedSchemas = selectedSchemas; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property connectionInfo in model GetUserTablesOracleTaskInput")); + } else { + connectionInfo().validate(); + } + if (selectedSchemas() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectedSchemas in model GetUserTablesOracleTaskInput")); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskOutput.java new file mode 100644 index 000000000000..83d9a5454734 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskOutput.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.datamigration.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; + +/** Output for the task that gets the list of tables contained within a provided list of Oracle schemas. */ +@Immutable +public final class GetUserTablesOracleTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesOracleTaskOutput.class); + + /* + * The schema this result is for + */ + @JsonProperty(value = "schemaName", access = JsonProperty.Access.WRITE_ONLY) + private String schemaName; + + /* + * List of valid tables found for this schema + */ + @JsonProperty(value = "tables", access = JsonProperty.Access.WRITE_ONLY) + private List tables; + + /* + * Validation errors associated with the task + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the schemaName property: The schema this result is for. + * + * @return the schemaName value. + */ + public String schemaName() { + return this.schemaName; + } + + /** + * Get the tables property: List of valid tables found for this schema. + * + * @return the tables value. + */ + public List tables() { + return this.tables; + } + + /** + * Get the validationErrors property: Validation errors associated with the task. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tables() != null) { + tables().forEach(e -> e.validate()); + } + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskProperties.java new file mode 100644 index 000000000000..0f6c8f3919b2 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesOracleTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that collects user tables for the given list of Oracle schemas. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("GetUserTablesOracle") +@Fluent +public final class GetUserTablesOracleTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesOracleTaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private GetUserTablesOracleTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public GetUserTablesOracleTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the GetUserTablesOracleTaskProperties object itself. + */ + public GetUserTablesOracleTaskProperties withInput(GetUserTablesOracleTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public GetUserTablesOracleTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskInput.java new file mode 100644 index 000000000000..a243e8ef2586 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskInput.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Input for the task that gets the list of tables for a provided list of PostgreSQL databases. */ +@Fluent +public final class GetUserTablesPostgreSqlTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesPostgreSqlTaskInput.class); + + /* + * Information for connecting to PostgreSQL source + */ + @JsonProperty(value = "connectionInfo", required = true) + private PostgreSqlConnectionInfo connectionInfo; + + /* + * List of PostgreSQL databases for which to collect tables + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /** + * Get the connectionInfo property: Information for connecting to PostgreSQL source. + * + * @return the connectionInfo value. + */ + public PostgreSqlConnectionInfo connectionInfo() { + return this.connectionInfo; + } + + /** + * Set the connectionInfo property: Information for connecting to PostgreSQL source. + * + * @param connectionInfo the connectionInfo value to set. + * @return the GetUserTablesPostgreSqlTaskInput object itself. + */ + public GetUserTablesPostgreSqlTaskInput withConnectionInfo(PostgreSqlConnectionInfo connectionInfo) { + this.connectionInfo = connectionInfo; + return this; + } + + /** + * Get the selectedDatabases property: List of PostgreSQL databases for which to collect tables. + * + * @return the selectedDatabases value. + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set the selectedDatabases property: List of PostgreSQL databases for which to collect tables. + * + * @param selectedDatabases the selectedDatabases value to set. + * @return the GetUserTablesPostgreSqlTaskInput object itself. + */ + public GetUserTablesPostgreSqlTaskInput withSelectedDatabases(List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property connectionInfo in model GetUserTablesPostgreSqlTaskInput")); + } else { + connectionInfo().validate(); + } + if (selectedDatabases() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectedDatabases in model GetUserTablesPostgreSqlTaskInput")); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskOutput.java new file mode 100644 index 000000000000..1c1dd1a58d31 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskOutput.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.datamigration.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; + +/** Output for the task that gets the list of tables for a provided list of PostgreSQL databases. */ +@Immutable +public final class GetUserTablesPostgreSqlTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesPostgreSqlTaskOutput.class); + + /* + * The database this result is for + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /* + * List of valid tables found for this database + */ + @JsonProperty(value = "tables", access = JsonProperty.Access.WRITE_ONLY) + private List tables; + + /* + * Validation errors associated with the task + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the databaseName property: The database this result is for. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get the tables property: List of valid tables found for this database. + * + * @return the tables value. + */ + public List tables() { + return this.tables; + } + + /** + * Get the validationErrors property: Validation errors associated with the task. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tables() != null) { + tables().forEach(e -> e.validate()); + } + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskProperties.java new file mode 100644 index 000000000000..d12fa10b27a8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesPostgreSqlTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that collects user tables for the given list of databases. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("GetUserTablesPostgreSql") +@Fluent +public final class GetUserTablesPostgreSqlTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesPostgreSqlTaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private GetUserTablesPostgreSqlTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public GetUserTablesPostgreSqlTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the GetUserTablesPostgreSqlTaskProperties object itself. + */ + public GetUserTablesPostgreSqlTaskProperties withInput(GetUserTablesPostgreSqlTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public GetUserTablesPostgreSqlTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlSyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlSyncTaskInput.java new file mode 100644 index 000000000000..dc435193f862 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlSyncTaskInput.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.datamigration.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; + +/** Input for the task that collects user tables for the given list of databases. */ +@Fluent +public final class GetUserTablesSqlSyncTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesSqlSyncTaskInput.class); + + /* + * Connection information for SQL Server + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private SqlConnectionInfo sourceConnectionInfo; + + /* + * Connection information for SQL DB + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private SqlConnectionInfo targetConnectionInfo; + + /* + * List of source database names to collect tables for + */ + @JsonProperty(value = "selectedSourceDatabases", required = true) + private List selectedSourceDatabases; + + /* + * List of target database names to collect tables for + */ + @JsonProperty(value = "selectedTargetDatabases", required = true) + private List selectedTargetDatabases; + + /** + * Get the sourceConnectionInfo property: Connection information for SQL Server. + * + * @return the sourceConnectionInfo value. + */ + public SqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set the sourceConnectionInfo property: Connection information for SQL Server. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set. + * @return the GetUserTablesSqlSyncTaskInput object itself. + */ + public GetUserTablesSqlSyncTaskInput withSourceConnectionInfo(SqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get the targetConnectionInfo property: Connection information for SQL DB. + * + * @return the targetConnectionInfo value. + */ + public SqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set the targetConnectionInfo property: Connection information for SQL DB. + * + * @param targetConnectionInfo the targetConnectionInfo value to set. + * @return the GetUserTablesSqlSyncTaskInput object itself. + */ + public GetUserTablesSqlSyncTaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Get the selectedSourceDatabases property: List of source database names to collect tables for. + * + * @return the selectedSourceDatabases value. + */ + public List selectedSourceDatabases() { + return this.selectedSourceDatabases; + } + + /** + * Set the selectedSourceDatabases property: List of source database names to collect tables for. + * + * @param selectedSourceDatabases the selectedSourceDatabases value to set. + * @return the GetUserTablesSqlSyncTaskInput object itself. + */ + public GetUserTablesSqlSyncTaskInput withSelectedSourceDatabases(List selectedSourceDatabases) { + this.selectedSourceDatabases = selectedSourceDatabases; + return this; + } + + /** + * Get the selectedTargetDatabases property: List of target database names to collect tables for. + * + * @return the selectedTargetDatabases value. + */ + public List selectedTargetDatabases() { + return this.selectedTargetDatabases; + } + + /** + * Set the selectedTargetDatabases property: List of target database names to collect tables for. + * + * @param selectedTargetDatabases the selectedTargetDatabases value to set. + * @return the GetUserTablesSqlSyncTaskInput object itself. + */ + public GetUserTablesSqlSyncTaskInput withSelectedTargetDatabases(List selectedTargetDatabases) { + this.selectedTargetDatabases = selectedTargetDatabases; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceConnectionInfo in model GetUserTablesSqlSyncTaskInput")); + } else { + sourceConnectionInfo().validate(); + } + if (targetConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetConnectionInfo in model GetUserTablesSqlSyncTaskInput")); + } else { + targetConnectionInfo().validate(); + } + if (selectedSourceDatabases() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectedSourceDatabases in model GetUserTablesSqlSyncTaskInput")); + } + if (selectedTargetDatabases() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectedTargetDatabases in model GetUserTablesSqlSyncTaskInput")); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlSyncTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlSyncTaskOutput.java new file mode 100644 index 000000000000..3b76ecd344d2 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlSyncTaskOutput.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.datamigration.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; + +/** Output of the task that collects user tables for the given list of databases. */ +@Immutable +public final class GetUserTablesSqlSyncTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesSqlSyncTaskOutput.class); + + /* + * Mapping from database name to list of source tables + */ + @JsonProperty(value = "databasesToSourceTables", access = JsonProperty.Access.WRITE_ONLY) + private String databasesToSourceTables; + + /* + * Mapping from database name to list of target tables + */ + @JsonProperty(value = "databasesToTargetTables", access = JsonProperty.Access.WRITE_ONLY) + private String databasesToTargetTables; + + /* + * Mapping from database name to list of validation errors + */ + @JsonProperty(value = "tableValidationErrors", access = JsonProperty.Access.WRITE_ONLY) + private String tableValidationErrors; + + /* + * Validation errors + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the databasesToSourceTables property: Mapping from database name to list of source tables. + * + * @return the databasesToSourceTables value. + */ + public String databasesToSourceTables() { + return this.databasesToSourceTables; + } + + /** + * Get the databasesToTargetTables property: Mapping from database name to list of target tables. + * + * @return the databasesToTargetTables value. + */ + public String databasesToTargetTables() { + return this.databasesToTargetTables; + } + + /** + * Get the tableValidationErrors property: Mapping from database name to list of validation errors. + * + * @return the tableValidationErrors value. + */ + public String tableValidationErrors() { + return this.tableValidationErrors; + } + + /** + * Get the validationErrors property: Validation errors. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlSyncTaskProperties.java new file mode 100644 index 000000000000..5c45bd81a008 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlSyncTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that collects user tables for the given list of databases. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("GetUserTables.AzureSqlDb.Sync") +@Fluent +public final class GetUserTablesSqlSyncTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesSqlSyncTaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private GetUserTablesSqlSyncTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public GetUserTablesSqlSyncTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the GetUserTablesSqlSyncTaskProperties object itself. + */ + public GetUserTablesSqlSyncTaskProperties withInput(GetUserTablesSqlSyncTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public GetUserTablesSqlSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlTaskInput.java new file mode 100644 index 000000000000..50a2d6a292eb --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlTaskInput.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Input for the task that collects user tables for the given list of databases. */ +@Fluent +public final class GetUserTablesSqlTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesSqlTaskInput.class); + + /* + * Connection information for SQL Server + */ + @JsonProperty(value = "connectionInfo", required = true) + private SqlConnectionInfo connectionInfo; + + /* + * List of database names to collect tables for + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /** + * Get the connectionInfo property: Connection information for SQL Server. + * + * @return the connectionInfo value. + */ + public SqlConnectionInfo connectionInfo() { + return this.connectionInfo; + } + + /** + * Set the connectionInfo property: Connection information for SQL Server. + * + * @param connectionInfo the connectionInfo value to set. + * @return the GetUserTablesSqlTaskInput object itself. + */ + public GetUserTablesSqlTaskInput withConnectionInfo(SqlConnectionInfo connectionInfo) { + this.connectionInfo = connectionInfo; + return this; + } + + /** + * Get the selectedDatabases property: List of database names to collect tables for. + * + * @return the selectedDatabases value. + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set the selectedDatabases property: List of database names to collect tables for. + * + * @param selectedDatabases the selectedDatabases value to set. + * @return the GetUserTablesSqlTaskInput object itself. + */ + public GetUserTablesSqlTaskInput withSelectedDatabases(List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property connectionInfo in model GetUserTablesSqlTaskInput")); + } else { + connectionInfo().validate(); + } + if (selectedDatabases() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectedDatabases in model GetUserTablesSqlTaskInput")); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlTaskOutput.java new file mode 100644 index 000000000000..91208c5eaee7 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlTaskOutput.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.datamigration.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; + +/** Output of the task that collects user tables for the given list of databases. */ +@Immutable +public final class GetUserTablesSqlTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesSqlTaskOutput.class); + + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Mapping from database name to list of tables + */ + @JsonProperty(value = "databasesToTables", access = JsonProperty.Access.WRITE_ONLY) + private String databasesToTables; + + /* + * Validation errors + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the databasesToTables property: Mapping from database name to list of tables. + * + * @return the databasesToTables value. + */ + public String databasesToTables() { + return this.databasesToTables; + } + + /** + * Get the validationErrors property: Validation errors. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlTaskProperties.java new file mode 100644 index 000000000000..1718f2f7c160 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/GetUserTablesSqlTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that collects user tables for the given list of databases. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("GetUserTables.Sql") +@Fluent +public final class GetUserTablesSqlTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetUserTablesSqlTaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private GetUserTablesSqlTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public GetUserTablesSqlTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the GetUserTablesSqlTaskProperties object itself. + */ + public GetUserTablesSqlTaskProperties withInput(GetUserTablesSqlTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public GetUserTablesSqlTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskInput.java new file mode 100644 index 000000000000..8a9ee837c58f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskInput.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Input for the service task to install an OCI driver. */ +@Fluent +public final class InstallOciDriverTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InstallOciDriverTaskInput.class); + + /* + * Name of the uploaded driver package to install. + */ + @JsonProperty(value = "driverPackageName") + private String driverPackageName; + + /** + * Get the driverPackageName property: Name of the uploaded driver package to install. + * + * @return the driverPackageName value. + */ + public String driverPackageName() { + return this.driverPackageName; + } + + /** + * Set the driverPackageName property: Name of the uploaded driver package to install. + * + * @param driverPackageName the driverPackageName value to set. + * @return the InstallOciDriverTaskInput object itself. + */ + public InstallOciDriverTaskInput withDriverPackageName(String driverPackageName) { + this.driverPackageName = driverPackageName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskOutput.java new file mode 100644 index 000000000000..a4260c4da0fd --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskOutput.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.datamigration.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; + +/** Output for the service task to install an OCI driver. */ +@Immutable +public final class InstallOciDriverTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InstallOciDriverTaskOutput.class); + + /* + * Validation errors + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the validationErrors property: Validation errors. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskProperties.java new file mode 100644 index 000000000000..d795cd487c6b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/InstallOciDriverTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that installs an OCI driver. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Service.Install.OCI") +@Fluent +public final class InstallOciDriverTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(InstallOciDriverTaskProperties.class); + + /* + * Input for the service task to install an OCI driver. + */ + @JsonProperty(value = "input") + private InstallOciDriverTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Input for the service task to install an OCI driver. + * + * @return the input value. + */ + public InstallOciDriverTaskInput input() { + return this.input; + } + + /** + * Set the input property: Input for the service task to install an OCI driver. + * + * @param input the input value to set. + * @return the InstallOciDriverTaskProperties object itself. + */ + public InstallOciDriverTaskProperties withInput(InstallOciDriverTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public InstallOciDriverTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/LoginMigrationStage.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/LoginMigrationStage.java new file mode 100644 index 000000000000..ceaddb4fdda1 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/LoginMigrationStage.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LoginMigrationStage. */ +public final class LoginMigrationStage extends ExpandableStringEnum { + /** Static value None for LoginMigrationStage. */ + public static final LoginMigrationStage NONE = fromString("None"); + + /** Static value Initialize for LoginMigrationStage. */ + public static final LoginMigrationStage INITIALIZE = fromString("Initialize"); + + /** Static value LoginMigration for LoginMigrationStage. */ + public static final LoginMigrationStage LOGIN_MIGRATION = fromString("LoginMigration"); + + /** Static value EstablishUserMapping for LoginMigrationStage. */ + public static final LoginMigrationStage ESTABLISH_USER_MAPPING = fromString("EstablishUserMapping"); + + /** Static value AssignRoleMembership for LoginMigrationStage. */ + public static final LoginMigrationStage ASSIGN_ROLE_MEMBERSHIP = fromString("AssignRoleMembership"); + + /** Static value AssignRoleOwnership for LoginMigrationStage. */ + public static final LoginMigrationStage ASSIGN_ROLE_OWNERSHIP = fromString("AssignRoleOwnership"); + + /** Static value EstablishServerPermissions for LoginMigrationStage. */ + public static final LoginMigrationStage ESTABLISH_SERVER_PERMISSIONS = fromString("EstablishServerPermissions"); + + /** Static value EstablishObjectPermissions for LoginMigrationStage. */ + public static final LoginMigrationStage ESTABLISH_OBJECT_PERMISSIONS = fromString("EstablishObjectPermissions"); + + /** Static value Completed for LoginMigrationStage. */ + public static final LoginMigrationStage COMPLETED = fromString("Completed"); + + /** + * Creates or finds a LoginMigrationStage from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoginMigrationStage. + */ + @JsonCreator + public static LoginMigrationStage fromString(String name) { + return fromString(name, LoginMigrationStage.class); + } + + /** @return known LoginMigrationStage values. */ + public static Collection values() { + return values(LoginMigrationStage.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/LoginType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/LoginType.java new file mode 100644 index 000000000000..3d13ea0c9bd8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/LoginType.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LoginType. */ +public final class LoginType extends ExpandableStringEnum { + /** Static value WindowsUser for LoginType. */ + public static final LoginType WINDOWS_USER = fromString("WindowsUser"); + + /** Static value WindowsGroup for LoginType. */ + public static final LoginType WINDOWS_GROUP = fromString("WindowsGroup"); + + /** Static value SqlLogin for LoginType. */ + public static final LoginType SQL_LOGIN = fromString("SqlLogin"); + + /** Static value Certificate for LoginType. */ + public static final LoginType CERTIFICATE = fromString("Certificate"); + + /** Static value AsymmetricKey for LoginType. */ + public static final LoginType ASYMMETRIC_KEY = fromString("AsymmetricKey"); + + /** Static value ExternalUser for LoginType. */ + public static final LoginType EXTERNAL_USER = fromString("ExternalUser"); + + /** Static value ExternalGroup for LoginType. */ + public static final LoginType EXTERNAL_GROUP = fromString("ExternalGroup"); + + /** + * Creates or finds a LoginType from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoginType. + */ + @JsonCreator + public static LoginType fromString(String name) { + return fromString(name, LoginType.class); + } + + /** @return known LoginType values. */ + public static Collection values() { + return values(LoginType.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MiSqlConnectionInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MiSqlConnectionInfo.java new file mode 100644 index 000000000000..7e04a1c07093 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MiSqlConnectionInfo.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Properties required to create a connection to Azure SQL database Managed instance. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("MiSqlConnectionInfo") +@Fluent +public final class MiSqlConnectionInfo extends ConnectionInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MiSqlConnectionInfo.class); + + /* + * Resource id for Azure SQL database Managed instance + */ + @JsonProperty(value = "managedInstanceResourceId", required = true) + private String managedInstanceResourceId; + + /** + * Get the managedInstanceResourceId property: Resource id for Azure SQL database Managed instance. + * + * @return the managedInstanceResourceId value. + */ + public String managedInstanceResourceId() { + return this.managedInstanceResourceId; + } + + /** + * Set the managedInstanceResourceId property: Resource id for Azure SQL database Managed instance. + * + * @param managedInstanceResourceId the managedInstanceResourceId value to set. + * @return the MiSqlConnectionInfo object itself. + */ + public MiSqlConnectionInfo withManagedInstanceResourceId(String managedInstanceResourceId) { + this.managedInstanceResourceId = managedInstanceResourceId; + return this; + } + + /** {@inheritDoc} */ + @Override + public MiSqlConnectionInfo withUsername(String username) { + super.withUsername(username); + return this; + } + + /** {@inheritDoc} */ + @Override + public MiSqlConnectionInfo withPassword(String password) { + super.withPassword(password); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (managedInstanceResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property managedInstanceResourceId in model MiSqlConnectionInfo")); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMISyncCompleteCommandInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMISyncCompleteCommandInput.java new file mode 100644 index 000000000000..af024eb545cc --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMISyncCompleteCommandInput.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Input for command that completes online migration for an Azure SQL Database Managed Instance. */ +@Fluent +public final class MigrateMISyncCompleteCommandInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateMISyncCompleteCommandInput.class); + + /* + * Name of managed instance database + */ + @JsonProperty(value = "sourceDatabaseName", required = true) + private String sourceDatabaseName; + + /** + * Get the sourceDatabaseName property: Name of managed instance database. + * + * @return the sourceDatabaseName value. + */ + public String sourceDatabaseName() { + return this.sourceDatabaseName; + } + + /** + * Set the sourceDatabaseName property: Name of managed instance database. + * + * @param sourceDatabaseName the sourceDatabaseName value to set. + * @return the MigrateMISyncCompleteCommandInput object itself. + */ + public MigrateMISyncCompleteCommandInput withSourceDatabaseName(String sourceDatabaseName) { + this.sourceDatabaseName = sourceDatabaseName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceDatabaseName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceDatabaseName in model MigrateMISyncCompleteCommandInput")); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMISyncCompleteCommandOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMISyncCompleteCommandOutput.java new file mode 100644 index 000000000000..a1abb17844ab --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMISyncCompleteCommandOutput.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.datamigration.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; + +/** Output for command that completes online migration for an Azure SQL Database Managed Instance. */ +@Fluent +public final class MigrateMISyncCompleteCommandOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateMISyncCompleteCommandOutput.class); + + /* + * List of errors that happened during the command execution + */ + @JsonProperty(value = "errors") + private List errors; + + /** + * Get the errors property: List of errors that happened during the command execution. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Set the errors property: List of errors that happened during the command execution. + * + * @param errors the errors value to set. + * @return the MigrateMISyncCompleteCommandOutput object itself. + */ + public MigrateMISyncCompleteCommandOutput withErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (errors() != null) { + errors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMISyncCompleteCommandProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMISyncCompleteCommandProperties.java new file mode 100644 index 000000000000..afc8ad474ba6 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMISyncCompleteCommandProperties.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.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Properties for the command that completes online migration for an Azure SQL Database Managed Instance. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "commandType") +@JsonTypeName("Migrate.SqlServer.AzureDbSqlMi.Complete") +@Fluent +public final class MigrateMISyncCompleteCommandProperties extends CommandPropertiesInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateMISyncCompleteCommandProperties.class); + + /* + * Command input + */ + @JsonProperty(value = "input") + private MigrateMISyncCompleteCommandInput input; + + /* + * Command output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private MigrateMISyncCompleteCommandOutput output; + + /** + * Get the input property: Command input. + * + * @return the input value. + */ + public MigrateMISyncCompleteCommandInput input() { + return this.input; + } + + /** + * Set the input property: Command input. + * + * @param input the input value to set. + * @return the MigrateMISyncCompleteCommandProperties object itself. + */ + public MigrateMISyncCompleteCommandProperties withInput(MigrateMISyncCompleteCommandInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Command output. This is ignored if submitted. + * + * @return the output value. + */ + public MigrateMISyncCompleteCommandOutput output() { + return this.output; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMongoDbTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMongoDbTaskProperties.java new file mode 100644 index 000000000000..87fdd2b21c7b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMongoDbTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that migrates data between MongoDB data sources. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Migrate.MongoDb") +@Fluent +public final class MigrateMongoDbTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateMongoDbTaskProperties.class); + + /* + * Describes how a MongoDB data migration should be performed + */ + @JsonProperty(value = "input") + private MongoDbMigrationSettings input; + + /* + * The output property. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Describes how a MongoDB data migration should be performed. + * + * @return the input value. + */ + public MongoDbMigrationSettings input() { + return this.input; + } + + /** + * Set the input property: Describes how a MongoDB data migration should be performed. + * + * @param input the input value to set. + * @return the MigrateMongoDbTaskProperties object itself. + */ + public MigrateMongoDbTaskProperties withInput(MongoDbMigrationSettings input) { + this.input = input; + return this; + } + + /** + * Get the output property: The output property. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public MigrateMongoDbTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncDatabaseInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncDatabaseInput.java new file mode 100644 index 000000000000..0f87fb438720 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncDatabaseInput.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Database specific information for MySQL to Azure Database for MySQL migration task inputs. */ +@Fluent +public final class MigrateMySqlAzureDbForMySqlSyncDatabaseInput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateMySqlAzureDbForMySqlSyncDatabaseInput.class); + + /* + * Name of the database + */ + @JsonProperty(value = "name") + private String name; + + /* + * Name of target database. Note: Target database will be truncated before + * starting migration. + */ + @JsonProperty(value = "targetDatabaseName") + private String targetDatabaseName; + + /* + * Migration settings which tune the migration behavior + */ + @JsonProperty(value = "migrationSetting") + private Map migrationSetting; + + /* + * Source settings to tune source endpoint migration behavior + */ + @JsonProperty(value = "sourceSetting") + private Map sourceSetting; + + /* + * Target settings to tune target endpoint migration behavior + */ + @JsonProperty(value = "targetSetting") + private Map targetSetting; + + /* + * Mapping of source to target tables + */ + @JsonProperty(value = "tableMap") + private Map tableMap; + + /** + * Get the name property: Name of the database. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the database. + * + * @param name the name value to set. + * @return the MigrateMySqlAzureDbForMySqlSyncDatabaseInput object itself. + */ + public MigrateMySqlAzureDbForMySqlSyncDatabaseInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get the targetDatabaseName property: Name of target database. Note: Target database will be truncated before + * starting migration. + * + * @return the targetDatabaseName value. + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Set the targetDatabaseName property: Name of target database. Note: Target database will be truncated before + * starting migration. + * + * @param targetDatabaseName the targetDatabaseName value to set. + * @return the MigrateMySqlAzureDbForMySqlSyncDatabaseInput object itself. + */ + public MigrateMySqlAzureDbForMySqlSyncDatabaseInput withTargetDatabaseName(String targetDatabaseName) { + this.targetDatabaseName = targetDatabaseName; + return this; + } + + /** + * Get the migrationSetting property: Migration settings which tune the migration behavior. + * + * @return the migrationSetting value. + */ + public Map migrationSetting() { + return this.migrationSetting; + } + + /** + * Set the migrationSetting property: Migration settings which tune the migration behavior. + * + * @param migrationSetting the migrationSetting value to set. + * @return the MigrateMySqlAzureDbForMySqlSyncDatabaseInput object itself. + */ + public MigrateMySqlAzureDbForMySqlSyncDatabaseInput withMigrationSetting(Map migrationSetting) { + this.migrationSetting = migrationSetting; + return this; + } + + /** + * Get the sourceSetting property: Source settings to tune source endpoint migration behavior. + * + * @return the sourceSetting value. + */ + public Map sourceSetting() { + return this.sourceSetting; + } + + /** + * Set the sourceSetting property: Source settings to tune source endpoint migration behavior. + * + * @param sourceSetting the sourceSetting value to set. + * @return the MigrateMySqlAzureDbForMySqlSyncDatabaseInput object itself. + */ + public MigrateMySqlAzureDbForMySqlSyncDatabaseInput withSourceSetting(Map sourceSetting) { + this.sourceSetting = sourceSetting; + return this; + } + + /** + * Get the targetSetting property: Target settings to tune target endpoint migration behavior. + * + * @return the targetSetting value. + */ + public Map targetSetting() { + return this.targetSetting; + } + + /** + * Set the targetSetting property: Target settings to tune target endpoint migration behavior. + * + * @param targetSetting the targetSetting value to set. + * @return the MigrateMySqlAzureDbForMySqlSyncDatabaseInput object itself. + */ + public MigrateMySqlAzureDbForMySqlSyncDatabaseInput withTargetSetting(Map targetSetting) { + this.targetSetting = targetSetting; + return this; + } + + /** + * Get the tableMap property: Mapping of source to target tables. + * + * @return the tableMap value. + */ + public Map tableMap() { + return this.tableMap; + } + + /** + * Set the tableMap property: Mapping of source to target tables. + * + * @param tableMap the tableMap value to set. + * @return the MigrateMySqlAzureDbForMySqlSyncDatabaseInput object itself. + */ + public MigrateMySqlAzureDbForMySqlSyncDatabaseInput withTableMap(Map tableMap) { + this.tableMap = tableMap; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskInput.java new file mode 100644 index 000000000000..2e3210a141b9 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskInput.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Input for the task that migrates MySQL databases to Azure Database for MySQL for online migrations. */ +@Fluent +public final class MigrateMySqlAzureDbForMySqlSyncTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateMySqlAzureDbForMySqlSyncTaskInput.class); + + /* + * Connection information for source MySQL + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private MySqlConnectionInfo sourceConnectionInfo; + + /* + * Connection information for target Azure Database for MySQL + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private MySqlConnectionInfo targetConnectionInfo; + + /* + * Databases to migrate + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /** + * Get the sourceConnectionInfo property: Connection information for source MySQL. + * + * @return the sourceConnectionInfo value. + */ + public MySqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set the sourceConnectionInfo property: Connection information for source MySQL. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set. + * @return the MigrateMySqlAzureDbForMySqlSyncTaskInput object itself. + */ + public MigrateMySqlAzureDbForMySqlSyncTaskInput withSourceConnectionInfo(MySqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get the targetConnectionInfo property: Connection information for target Azure Database for MySQL. + * + * @return the targetConnectionInfo value. + */ + public MySqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set the targetConnectionInfo property: Connection information for target Azure Database for MySQL. + * + * @param targetConnectionInfo the targetConnectionInfo value to set. + * @return the MigrateMySqlAzureDbForMySqlSyncTaskInput object itself. + */ + public MigrateMySqlAzureDbForMySqlSyncTaskInput withTargetConnectionInfo(MySqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Get the selectedDatabases property: Databases to migrate. + * + * @return the selectedDatabases value. + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set the selectedDatabases property: Databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set. + * @return the MigrateMySqlAzureDbForMySqlSyncTaskInput object itself. + */ + public MigrateMySqlAzureDbForMySqlSyncTaskInput withSelectedDatabases( + List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceConnectionInfo in model" + + " MigrateMySqlAzureDbForMySqlSyncTaskInput")); + } else { + sourceConnectionInfo().validate(); + } + if (targetConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetConnectionInfo in model" + + " MigrateMySqlAzureDbForMySqlSyncTaskInput")); + } else { + targetConnectionInfo().validate(); + } + if (selectedDatabases() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectedDatabases in model" + + " MigrateMySqlAzureDbForMySqlSyncTaskInput")); + } else { + selectedDatabases().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutput.java new file mode 100644 index 000000000000..fcd30f642165 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutput.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.datamigration.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 com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Output for the task that migrates MySQL databases to Azure Database for MySQL for online migrations. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "resultType", + defaultImpl = MigrateMySqlAzureDbForMySqlSyncTaskOutput.class) +@JsonTypeName("MigrateMySqlAzureDbForMySqlSyncTaskOutput") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "MigrationLevelOutput", + value = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.class), + @JsonSubTypes.Type( + name = "DatabaseLevelOutput", + value = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.class), + @JsonSubTypes.Type(name = "TableLevelOutput", value = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.class), + @JsonSubTypes.Type(name = "ErrorOutput", value = MigrateMySqlAzureDbForMySqlSyncTaskOutputError.class), + @JsonSubTypes.Type( + name = "DatabaseLevelErrorOutput", + value = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.class) +}) +@Immutable +public class MigrateMySqlAzureDbForMySqlSyncTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateMySqlAzureDbForMySqlSyncTaskOutput.class); + + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.java new file mode 100644 index 000000000000..a931f2fae2c8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelErrorOutput") +@Fluent +public final class MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + extends MigrateMySqlAzureDbForMySqlSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.class); + + /* + * Error message + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /* + * List of error events. + */ + @JsonProperty(value = "events") + private List events; + + /** + * Get the errorMessage property: Error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: Error message. + * + * @param errorMessage the errorMessage value to set. + * @return the MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError object itself. + */ + public MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the events property: List of error events. + * + * @return the events value. + */ + public List events() { + return this.events; + } + + /** + * Set the events property: List of error events. + * + * @param events the events value to set. + * @return the MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError object itself. + */ + public MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError withEvents( + List events) { + this.events = events; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (events() != null) { + events().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.java new file mode 100644 index 000000000000..816633abd637 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.java @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** The MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelOutput") +@Immutable +public final class MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + extends MigrateMySqlAzureDbForMySqlSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.class); + + /* + * Name of the database + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Migration state that this database is in + */ + @JsonProperty(value = "migrationState", access = JsonProperty.Access.WRITE_ONLY) + private SyncDatabaseMigrationReportingState migrationState; + + /* + * Number of incoming changes + */ + @JsonProperty(value = "incomingChanges", access = JsonProperty.Access.WRITE_ONLY) + private Long incomingChanges; + + /* + * Number of applied changes + */ + @JsonProperty(value = "appliedChanges", access = JsonProperty.Access.WRITE_ONLY) + private Long appliedChanges; + + /* + * Number of cdc inserts + */ + @JsonProperty(value = "cdcInsertCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcInsertCounter; + + /* + * Number of cdc deletes + */ + @JsonProperty(value = "cdcDeleteCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcDeleteCounter; + + /* + * Number of cdc updates + */ + @JsonProperty(value = "cdcUpdateCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcUpdateCounter; + + /* + * Number of tables completed in full load + */ + @JsonProperty(value = "fullLoadCompletedTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadCompletedTables; + + /* + * Number of tables loading in full load + */ + @JsonProperty(value = "fullLoadLoadingTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadLoadingTables; + + /* + * Number of tables queued in full load + */ + @JsonProperty(value = "fullLoadQueuedTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadQueuedTables; + + /* + * Number of tables errored in full load + */ + @JsonProperty(value = "fullLoadErroredTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadErroredTables; + + /* + * Indicates if initial load (full load) has been completed + */ + @JsonProperty(value = "initializationCompleted", access = JsonProperty.Access.WRITE_ONLY) + private Boolean initializationCompleted; + + /* + * CDC apply latency + */ + @JsonProperty(value = "latency", access = JsonProperty.Access.WRITE_ONLY) + private Long latency; + + /** + * Get the databaseName property: Name of the database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the migrationState property: Migration state that this database is in. + * + * @return the migrationState value. + */ + public SyncDatabaseMigrationReportingState migrationState() { + return this.migrationState; + } + + /** + * Get the incomingChanges property: Number of incoming changes. + * + * @return the incomingChanges value. + */ + public Long incomingChanges() { + return this.incomingChanges; + } + + /** + * Get the appliedChanges property: Number of applied changes. + * + * @return the appliedChanges value. + */ + public Long appliedChanges() { + return this.appliedChanges; + } + + /** + * Get the cdcInsertCounter property: Number of cdc inserts. + * + * @return the cdcInsertCounter value. + */ + public Long cdcInsertCounter() { + return this.cdcInsertCounter; + } + + /** + * Get the cdcDeleteCounter property: Number of cdc deletes. + * + * @return the cdcDeleteCounter value. + */ + public Long cdcDeleteCounter() { + return this.cdcDeleteCounter; + } + + /** + * Get the cdcUpdateCounter property: Number of cdc updates. + * + * @return the cdcUpdateCounter value. + */ + public Long cdcUpdateCounter() { + return this.cdcUpdateCounter; + } + + /** + * Get the fullLoadCompletedTables property: Number of tables completed in full load. + * + * @return the fullLoadCompletedTables value. + */ + public Long fullLoadCompletedTables() { + return this.fullLoadCompletedTables; + } + + /** + * Get the fullLoadLoadingTables property: Number of tables loading in full load. + * + * @return the fullLoadLoadingTables value. + */ + public Long fullLoadLoadingTables() { + return this.fullLoadLoadingTables; + } + + /** + * Get the fullLoadQueuedTables property: Number of tables queued in full load. + * + * @return the fullLoadQueuedTables value. + */ + public Long fullLoadQueuedTables() { + return this.fullLoadQueuedTables; + } + + /** + * Get the fullLoadErroredTables property: Number of tables errored in full load. + * + * @return the fullLoadErroredTables value. + */ + public Long fullLoadErroredTables() { + return this.fullLoadErroredTables; + } + + /** + * Get the initializationCompleted property: Indicates if initial load (full load) has been completed. + * + * @return the initializationCompleted value. + */ + public Boolean initializationCompleted() { + return this.initializationCompleted; + } + + /** + * Get the latency property: CDC apply latency. + * + * @return the latency value. + */ + public Long latency() { + return this.latency; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputError.java new file mode 100644 index 000000000000..6ca14d3c0302 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputError.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The MigrateMySqlAzureDbForMySqlSyncTaskOutputError model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("ErrorOutput") +@Immutable +public final class MigrateMySqlAzureDbForMySqlSyncTaskOutputError extends MigrateMySqlAzureDbForMySqlSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateMySqlAzureDbForMySqlSyncTaskOutputError.class); + + /* + * Migration error + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ReportableException error; + + /** + * Get the error property: Migration error. + * + * @return the error value. + */ + public ReportableException error() { + return this.error; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.java new file mode 100644 index 000000000000..21b3ea1396f4 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** The MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrationLevelOutput") +@Immutable +public final class MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + extends MigrateMySqlAzureDbForMySqlSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.class); + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Source server version + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /* + * Source server name + */ + @JsonProperty(value = "sourceServer", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServer; + + /* + * Target server version + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /* + * Target server name + */ + @JsonProperty(value = "targetServer", access = JsonProperty.Access.WRITE_ONLY) + private String targetServer; + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the sourceServerVersion property: Source server version. + * + * @return the sourceServerVersion value. + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get the sourceServer property: Source server name. + * + * @return the sourceServer value. + */ + public String sourceServer() { + return this.sourceServer; + } + + /** + * Get the targetServerVersion property: Target server version. + * + * @return the targetServerVersion value. + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get the targetServer property: Target server name. + * + * @return the targetServer value. + */ + public String targetServer() { + return this.targetServer; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.java new file mode 100644 index 000000000000..c4e50b1707da --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** The MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("TableLevelOutput") +@Immutable +public final class MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + extends MigrateMySqlAzureDbForMySqlSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.class); + + /* + * Name of the table + */ + @JsonProperty(value = "tableName", access = JsonProperty.Access.WRITE_ONLY) + private String tableName; + + /* + * Name of the database + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /* + * Number of applied inserts + */ + @JsonProperty(value = "cdcInsertCounter", access = JsonProperty.Access.WRITE_ONLY) + private String cdcInsertCounter; + + /* + * Number of applied updates + */ + @JsonProperty(value = "cdcUpdateCounter", access = JsonProperty.Access.WRITE_ONLY) + private String cdcUpdateCounter; + + /* + * Number of applied deletes + */ + @JsonProperty(value = "cdcDeleteCounter", access = JsonProperty.Access.WRITE_ONLY) + private String cdcDeleteCounter; + + /* + * Estimate to finish full load + */ + @JsonProperty(value = "fullLoadEstFinishTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime fullLoadEstFinishTime; + + /* + * Full load start time + */ + @JsonProperty(value = "fullLoadStartedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime fullLoadStartedOn; + + /* + * Full load end time + */ + @JsonProperty(value = "fullLoadEndedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime fullLoadEndedOn; + + /* + * Number of rows applied in full load + */ + @JsonProperty(value = "fullLoadTotalRows", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadTotalRows; + + /* + * Current state of the table migration + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private SyncTableMigrationState state; + + /* + * Total number of applied changes + */ + @JsonProperty(value = "totalChangesApplied", access = JsonProperty.Access.WRITE_ONLY) + private Long totalChangesApplied; + + /* + * Number of data errors occurred + */ + @JsonProperty(value = "dataErrorsCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long dataErrorsCounter; + + /* + * Last modified time on target + */ + @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTime; + + /** + * Get the tableName property: Name of the table. + * + * @return the tableName value. + */ + public String tableName() { + return this.tableName; + } + + /** + * Get the databaseName property: Name of the database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get the cdcInsertCounter property: Number of applied inserts. + * + * @return the cdcInsertCounter value. + */ + public String cdcInsertCounter() { + return this.cdcInsertCounter; + } + + /** + * Get the cdcUpdateCounter property: Number of applied updates. + * + * @return the cdcUpdateCounter value. + */ + public String cdcUpdateCounter() { + return this.cdcUpdateCounter; + } + + /** + * Get the cdcDeleteCounter property: Number of applied deletes. + * + * @return the cdcDeleteCounter value. + */ + public String cdcDeleteCounter() { + return this.cdcDeleteCounter; + } + + /** + * Get the fullLoadEstFinishTime property: Estimate to finish full load. + * + * @return the fullLoadEstFinishTime value. + */ + public OffsetDateTime fullLoadEstFinishTime() { + return this.fullLoadEstFinishTime; + } + + /** + * Get the fullLoadStartedOn property: Full load start time. + * + * @return the fullLoadStartedOn value. + */ + public OffsetDateTime fullLoadStartedOn() { + return this.fullLoadStartedOn; + } + + /** + * Get the fullLoadEndedOn property: Full load end time. + * + * @return the fullLoadEndedOn value. + */ + public OffsetDateTime fullLoadEndedOn() { + return this.fullLoadEndedOn; + } + + /** + * Get the fullLoadTotalRows property: Number of rows applied in full load. + * + * @return the fullLoadTotalRows value. + */ + public Long fullLoadTotalRows() { + return this.fullLoadTotalRows; + } + + /** + * Get the state property: Current state of the table migration. + * + * @return the state value. + */ + public SyncTableMigrationState state() { + return this.state; + } + + /** + * Get the totalChangesApplied property: Total number of applied changes. + * + * @return the totalChangesApplied value. + */ + public Long totalChangesApplied() { + return this.totalChangesApplied; + } + + /** + * Get the dataErrorsCounter property: Number of data errors occurred. + * + * @return the dataErrorsCounter value. + */ + public Long dataErrorsCounter() { + return this.dataErrorsCounter; + } + + /** + * Get the lastModifiedTime property: Last modified time on target. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskProperties.java new file mode 100644 index 000000000000..1434807b9001 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateMySqlAzureDbForMySqlSyncTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that migrates MySQL databases to Azure Database for MySQL for online migrations. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Migrate.MySql.AzureDbForMySql.Sync") +@Fluent +public final class MigrateMySqlAzureDbForMySqlSyncTaskProperties extends ProjectTaskProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateMySqlAzureDbForMySqlSyncTaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private MigrateMySqlAzureDbForMySqlSyncTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public MigrateMySqlAzureDbForMySqlSyncTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the MigrateMySqlAzureDbForMySqlSyncTaskProperties object itself. + */ + public MigrateMySqlAzureDbForMySqlSyncTaskProperties withInput(MigrateMySqlAzureDbForMySqlSyncTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public MigrateMySqlAzureDbForMySqlSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.java new file mode 100644 index 000000000000..5f97ffbcafe6 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that migrates Oracle to Azure Database for PostgreSQL for online migrations. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Migrate.Oracle.AzureDbForPostgreSql.Sync") +@Fluent +public final class MigrateOracleAzureDbForPostgreSqlSyncTaskProperties extends ProjectTaskProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private MigrateOracleAzureDbPostgreSqlSyncTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public MigrateOracleAzureDbPostgreSqlSyncTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the MigrateOracleAzureDbForPostgreSqlSyncTaskProperties object itself. + */ + public MigrateOracleAzureDbForPostgreSqlSyncTaskProperties withInput( + MigrateOracleAzureDbPostgreSqlSyncTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public MigrateOracleAzureDbForPostgreSqlSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.java new file mode 100644 index 000000000000..ed35d733c311 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Database specific information for Oracle to Azure Database for PostgreSQL migration task inputs. */ +@Fluent +public final class MigrateOracleAzureDbPostgreSqlSyncDatabaseInput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.class); + + /* + * How to handle object name casing: either Preserve or ToLower + */ + @JsonProperty(value = "caseManipulation") + private String caseManipulation; + + /* + * Name of the migration pipeline + */ + @JsonProperty(value = "name") + private String name; + + /* + * Name of the source schema + */ + @JsonProperty(value = "schemaName") + private String schemaName; + + /* + * Mapping of source to target tables + */ + @JsonProperty(value = "tableMap") + private Map tableMap; + + /* + * Name of target database. Note: Target database will be truncated before + * starting migration. + */ + @JsonProperty(value = "targetDatabaseName") + private String targetDatabaseName; + + /* + * Migration settings which tune the migration behavior + */ + @JsonProperty(value = "migrationSetting") + private Map migrationSetting; + + /* + * Source settings to tune source endpoint migration behavior + */ + @JsonProperty(value = "sourceSetting") + private Map sourceSetting; + + /* + * Target settings to tune target endpoint migration behavior + */ + @JsonProperty(value = "targetSetting") + private Map targetSetting; + + /** + * Get the caseManipulation property: How to handle object name casing: either Preserve or ToLower. + * + * @return the caseManipulation value. + */ + public String caseManipulation() { + return this.caseManipulation; + } + + /** + * Set the caseManipulation property: How to handle object name casing: either Preserve or ToLower. + * + * @param caseManipulation the caseManipulation value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncDatabaseInput object itself. + */ + public MigrateOracleAzureDbPostgreSqlSyncDatabaseInput withCaseManipulation(String caseManipulation) { + this.caseManipulation = caseManipulation; + return this; + } + + /** + * Get the name property: Name of the migration pipeline. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the migration pipeline. + * + * @param name the name value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncDatabaseInput object itself. + */ + public MigrateOracleAzureDbPostgreSqlSyncDatabaseInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get the schemaName property: Name of the source schema. + * + * @return the schemaName value. + */ + public String schemaName() { + return this.schemaName; + } + + /** + * Set the schemaName property: Name of the source schema. + * + * @param schemaName the schemaName value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncDatabaseInput object itself. + */ + public MigrateOracleAzureDbPostgreSqlSyncDatabaseInput withSchemaName(String schemaName) { + this.schemaName = schemaName; + return this; + } + + /** + * Get the tableMap property: Mapping of source to target tables. + * + * @return the tableMap value. + */ + public Map tableMap() { + return this.tableMap; + } + + /** + * Set the tableMap property: Mapping of source to target tables. + * + * @param tableMap the tableMap value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncDatabaseInput object itself. + */ + public MigrateOracleAzureDbPostgreSqlSyncDatabaseInput withTableMap(Map tableMap) { + this.tableMap = tableMap; + return this; + } + + /** + * Get the targetDatabaseName property: Name of target database. Note: Target database will be truncated before + * starting migration. + * + * @return the targetDatabaseName value. + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Set the targetDatabaseName property: Name of target database. Note: Target database will be truncated before + * starting migration. + * + * @param targetDatabaseName the targetDatabaseName value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncDatabaseInput object itself. + */ + public MigrateOracleAzureDbPostgreSqlSyncDatabaseInput withTargetDatabaseName(String targetDatabaseName) { + this.targetDatabaseName = targetDatabaseName; + return this; + } + + /** + * Get the migrationSetting property: Migration settings which tune the migration behavior. + * + * @return the migrationSetting value. + */ + public Map migrationSetting() { + return this.migrationSetting; + } + + /** + * Set the migrationSetting property: Migration settings which tune the migration behavior. + * + * @param migrationSetting the migrationSetting value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncDatabaseInput object itself. + */ + public MigrateOracleAzureDbPostgreSqlSyncDatabaseInput withMigrationSetting(Map migrationSetting) { + this.migrationSetting = migrationSetting; + return this; + } + + /** + * Get the sourceSetting property: Source settings to tune source endpoint migration behavior. + * + * @return the sourceSetting value. + */ + public Map sourceSetting() { + return this.sourceSetting; + } + + /** + * Set the sourceSetting property: Source settings to tune source endpoint migration behavior. + * + * @param sourceSetting the sourceSetting value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncDatabaseInput object itself. + */ + public MigrateOracleAzureDbPostgreSqlSyncDatabaseInput withSourceSetting(Map sourceSetting) { + this.sourceSetting = sourceSetting; + return this; + } + + /** + * Get the targetSetting property: Target settings to tune target endpoint migration behavior. + * + * @return the targetSetting value. + */ + public Map targetSetting() { + return this.targetSetting; + } + + /** + * Set the targetSetting property: Target settings to tune target endpoint migration behavior. + * + * @param targetSetting the targetSetting value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncDatabaseInput object itself. + */ + public MigrateOracleAzureDbPostgreSqlSyncDatabaseInput withTargetSetting(Map targetSetting) { + this.targetSetting = targetSetting; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskInput.java new file mode 100644 index 000000000000..b46b3b145290 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskInput.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Input for the task that migrates Oracle databases to Azure Database for PostgreSQL for online migrations. */ +@Fluent +public final class MigrateOracleAzureDbPostgreSqlSyncTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateOracleAzureDbPostgreSqlSyncTaskInput.class); + + /* + * Databases to migrate + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /* + * Connection information for target Azure Database for PostgreSQL + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private PostgreSqlConnectionInfo targetConnectionInfo; + + /* + * Connection information for source Oracle + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private OracleConnectionInfo sourceConnectionInfo; + + /** + * Get the selectedDatabases property: Databases to migrate. + * + * @return the selectedDatabases value. + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set the selectedDatabases property: Databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncTaskInput object itself. + */ + public MigrateOracleAzureDbPostgreSqlSyncTaskInput withSelectedDatabases( + List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Get the targetConnectionInfo property: Connection information for target Azure Database for PostgreSQL. + * + * @return the targetConnectionInfo value. + */ + public PostgreSqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set the targetConnectionInfo property: Connection information for target Azure Database for PostgreSQL. + * + * @param targetConnectionInfo the targetConnectionInfo value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncTaskInput object itself. + */ + public MigrateOracleAzureDbPostgreSqlSyncTaskInput withTargetConnectionInfo( + PostgreSqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Get the sourceConnectionInfo property: Connection information for source Oracle. + * + * @return the sourceConnectionInfo value. + */ + public OracleConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set the sourceConnectionInfo property: Connection information for source Oracle. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncTaskInput object itself. + */ + public MigrateOracleAzureDbPostgreSqlSyncTaskInput withSourceConnectionInfo( + OracleConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (selectedDatabases() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectedDatabases in model" + + " MigrateOracleAzureDbPostgreSqlSyncTaskInput")); + } else { + selectedDatabases().forEach(e -> e.validate()); + } + if (targetConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetConnectionInfo in model" + + " MigrateOracleAzureDbPostgreSqlSyncTaskInput")); + } else { + targetConnectionInfo().validate(); + } + if (sourceConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceConnectionInfo in model" + + " MigrateOracleAzureDbPostgreSqlSyncTaskInput")); + } else { + sourceConnectionInfo().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutput.java new file mode 100644 index 000000000000..711e872b6b0c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutput.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Output for the task that migrates Oracle databases to Azure Database for PostgreSQL for online migrations. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "resultType", + defaultImpl = MigrateOracleAzureDbPostgreSqlSyncTaskOutput.class) +@JsonTypeName("MigrateOracleAzureDbPostgreSqlSyncTaskOutput") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "MigrationLevelOutput", + value = MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.class), + @JsonSubTypes.Type( + name = "DatabaseLevelOutput", + value = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.class), + @JsonSubTypes.Type(name = "TableLevelOutput", value = MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.class), + @JsonSubTypes.Type(name = "ErrorOutput", value = MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.class), + @JsonSubTypes.Type( + name = "DatabaseLevelErrorOutput", + value = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.class) +}) +@Immutable +public class MigrateOracleAzureDbPostgreSqlSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateOracleAzureDbPostgreSqlSyncTaskOutput.class); + + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.java new file mode 100644 index 000000000000..61048a97f3a2 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelErrorOutput") +@Fluent +public final class MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + extends MigrateOracleAzureDbPostgreSqlSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.class); + + /* + * Error message + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /* + * List of error events. + */ + @JsonProperty(value = "events") + private List events; + + /** + * Get the errorMessage property: Error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: Error message. + * + * @param errorMessage the errorMessage value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError object itself. + */ + public MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the events property: List of error events. + * + * @return the events value. + */ + public List events() { + return this.events; + } + + /** + * Set the events property: List of error events. + * + * @param events the events value to set. + * @return the MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError object itself. + */ + public MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError withEvents( + List events) { + this.events = events; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (events() != null) { + events().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.java new file mode 100644 index 000000000000..2b769cf31b93 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** The MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelOutput") +@Immutable +public final class MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + extends MigrateOracleAzureDbPostgreSqlSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.class); + + /* + * Name of the database + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Migration state that this database is in + */ + @JsonProperty(value = "migrationState", access = JsonProperty.Access.WRITE_ONLY) + private SyncDatabaseMigrationReportingState migrationState; + + /* + * Number of incoming changes + */ + @JsonProperty(value = "incomingChanges", access = JsonProperty.Access.WRITE_ONLY) + private Long incomingChanges; + + /* + * Number of applied changes + */ + @JsonProperty(value = "appliedChanges", access = JsonProperty.Access.WRITE_ONLY) + private Long appliedChanges; + + /* + * Number of cdc inserts + */ + @JsonProperty(value = "cdcInsertCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcInsertCounter; + + /* + * Number of cdc deletes + */ + @JsonProperty(value = "cdcDeleteCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcDeleteCounter; + + /* + * Number of cdc updates + */ + @JsonProperty(value = "cdcUpdateCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcUpdateCounter; + + /* + * Number of tables completed in full load + */ + @JsonProperty(value = "fullLoadCompletedTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadCompletedTables; + + /* + * Number of tables loading in full load + */ + @JsonProperty(value = "fullLoadLoadingTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadLoadingTables; + + /* + * Number of tables queued in full load + */ + @JsonProperty(value = "fullLoadQueuedTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadQueuedTables; + + /* + * Number of tables errored in full load + */ + @JsonProperty(value = "fullLoadErroredTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadErroredTables; + + /* + * Indicates if initial load (full load) has been completed + */ + @JsonProperty(value = "initializationCompleted", access = JsonProperty.Access.WRITE_ONLY) + private Boolean initializationCompleted; + + /* + * CDC apply latency + */ + @JsonProperty(value = "latency", access = JsonProperty.Access.WRITE_ONLY) + private Long latency; + + /** + * Get the databaseName property: Name of the database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the migrationState property: Migration state that this database is in. + * + * @return the migrationState value. + */ + public SyncDatabaseMigrationReportingState migrationState() { + return this.migrationState; + } + + /** + * Get the incomingChanges property: Number of incoming changes. + * + * @return the incomingChanges value. + */ + public Long incomingChanges() { + return this.incomingChanges; + } + + /** + * Get the appliedChanges property: Number of applied changes. + * + * @return the appliedChanges value. + */ + public Long appliedChanges() { + return this.appliedChanges; + } + + /** + * Get the cdcInsertCounter property: Number of cdc inserts. + * + * @return the cdcInsertCounter value. + */ + public Long cdcInsertCounter() { + return this.cdcInsertCounter; + } + + /** + * Get the cdcDeleteCounter property: Number of cdc deletes. + * + * @return the cdcDeleteCounter value. + */ + public Long cdcDeleteCounter() { + return this.cdcDeleteCounter; + } + + /** + * Get the cdcUpdateCounter property: Number of cdc updates. + * + * @return the cdcUpdateCounter value. + */ + public Long cdcUpdateCounter() { + return this.cdcUpdateCounter; + } + + /** + * Get the fullLoadCompletedTables property: Number of tables completed in full load. + * + * @return the fullLoadCompletedTables value. + */ + public Long fullLoadCompletedTables() { + return this.fullLoadCompletedTables; + } + + /** + * Get the fullLoadLoadingTables property: Number of tables loading in full load. + * + * @return the fullLoadLoadingTables value. + */ + public Long fullLoadLoadingTables() { + return this.fullLoadLoadingTables; + } + + /** + * Get the fullLoadQueuedTables property: Number of tables queued in full load. + * + * @return the fullLoadQueuedTables value. + */ + public Long fullLoadQueuedTables() { + return this.fullLoadQueuedTables; + } + + /** + * Get the fullLoadErroredTables property: Number of tables errored in full load. + * + * @return the fullLoadErroredTables value. + */ + public Long fullLoadErroredTables() { + return this.fullLoadErroredTables; + } + + /** + * Get the initializationCompleted property: Indicates if initial load (full load) has been completed. + * + * @return the initializationCompleted value. + */ + public Boolean initializationCompleted() { + return this.initializationCompleted; + } + + /** + * Get the latency property: CDC apply latency. + * + * @return the latency value. + */ + public Long latency() { + return this.latency; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.java new file mode 100644 index 000000000000..ba6b7b6cff0f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The MigrateOracleAzureDbPostgreSqlSyncTaskOutputError model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("ErrorOutput") +@Immutable +public final class MigrateOracleAzureDbPostgreSqlSyncTaskOutputError + extends MigrateOracleAzureDbPostgreSqlSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.class); + + /* + * Migration error + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ReportableException error; + + /** + * Get the error property: Migration error. + * + * @return the error value. + */ + public ReportableException error() { + return this.error; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.java new file mode 100644 index 000000000000..28372f8df6f1 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** The MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrationLevelOutput") +@Immutable +public final class MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + extends MigrateOracleAzureDbPostgreSqlSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.class); + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Source server version + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /* + * Source server name + */ + @JsonProperty(value = "sourceServer", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServer; + + /* + * Target server version + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /* + * Target server name + */ + @JsonProperty(value = "targetServer", access = JsonProperty.Access.WRITE_ONLY) + private String targetServer; + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the sourceServerVersion property: Source server version. + * + * @return the sourceServerVersion value. + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get the sourceServer property: Source server name. + * + * @return the sourceServer value. + */ + public String sourceServer() { + return this.sourceServer; + } + + /** + * Get the targetServerVersion property: Target server version. + * + * @return the targetServerVersion value. + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get the targetServer property: Target server name. + * + * @return the targetServer value. + */ + public String targetServer() { + return this.targetServer; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.java new file mode 100644 index 000000000000..2eb4aa96fa66 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** The MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("TableLevelOutput") +@Immutable +public final class MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + extends MigrateOracleAzureDbPostgreSqlSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.class); + + /* + * Name of the table + */ + @JsonProperty(value = "tableName", access = JsonProperty.Access.WRITE_ONLY) + private String tableName; + + /* + * Name of the database + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /* + * Number of applied inserts + */ + @JsonProperty(value = "cdcInsertCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcInsertCounter; + + /* + * Number of applied updates + */ + @JsonProperty(value = "cdcUpdateCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcUpdateCounter; + + /* + * Number of applied deletes + */ + @JsonProperty(value = "cdcDeleteCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcDeleteCounter; + + /* + * Estimate to finish full load + */ + @JsonProperty(value = "fullLoadEstFinishTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime fullLoadEstFinishTime; + + /* + * Full load start time + */ + @JsonProperty(value = "fullLoadStartedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime fullLoadStartedOn; + + /* + * Full load end time + */ + @JsonProperty(value = "fullLoadEndedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime fullLoadEndedOn; + + /* + * Number of rows applied in full load + */ + @JsonProperty(value = "fullLoadTotalRows", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadTotalRows; + + /* + * Current state of the table migration + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private SyncTableMigrationState state; + + /* + * Total number of applied changes + */ + @JsonProperty(value = "totalChangesApplied", access = JsonProperty.Access.WRITE_ONLY) + private Long totalChangesApplied; + + /* + * Number of data errors occurred + */ + @JsonProperty(value = "dataErrorsCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long dataErrorsCounter; + + /* + * Last modified time on target + */ + @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTime; + + /** + * Get the tableName property: Name of the table. + * + * @return the tableName value. + */ + public String tableName() { + return this.tableName; + } + + /** + * Get the databaseName property: Name of the database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get the cdcInsertCounter property: Number of applied inserts. + * + * @return the cdcInsertCounter value. + */ + public Long cdcInsertCounter() { + return this.cdcInsertCounter; + } + + /** + * Get the cdcUpdateCounter property: Number of applied updates. + * + * @return the cdcUpdateCounter value. + */ + public Long cdcUpdateCounter() { + return this.cdcUpdateCounter; + } + + /** + * Get the cdcDeleteCounter property: Number of applied deletes. + * + * @return the cdcDeleteCounter value. + */ + public Long cdcDeleteCounter() { + return this.cdcDeleteCounter; + } + + /** + * Get the fullLoadEstFinishTime property: Estimate to finish full load. + * + * @return the fullLoadEstFinishTime value. + */ + public OffsetDateTime fullLoadEstFinishTime() { + return this.fullLoadEstFinishTime; + } + + /** + * Get the fullLoadStartedOn property: Full load start time. + * + * @return the fullLoadStartedOn value. + */ + public OffsetDateTime fullLoadStartedOn() { + return this.fullLoadStartedOn; + } + + /** + * Get the fullLoadEndedOn property: Full load end time. + * + * @return the fullLoadEndedOn value. + */ + public OffsetDateTime fullLoadEndedOn() { + return this.fullLoadEndedOn; + } + + /** + * Get the fullLoadTotalRows property: Number of rows applied in full load. + * + * @return the fullLoadTotalRows value. + */ + public Long fullLoadTotalRows() { + return this.fullLoadTotalRows; + } + + /** + * Get the state property: Current state of the table migration. + * + * @return the state value. + */ + public SyncTableMigrationState state() { + return this.state; + } + + /** + * Get the totalChangesApplied property: Total number of applied changes. + * + * @return the totalChangesApplied value. + */ + public Long totalChangesApplied() { + return this.totalChangesApplied; + } + + /** + * Get the dataErrorsCounter property: Number of data errors occurred. + * + * @return the dataErrorsCounter value. + */ + public Long dataErrorsCounter() { + return this.dataErrorsCounter; + } + + /** + * Get the lastModifiedTime property: Last modified time on target. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.java new file mode 100644 index 000000000000..b57ba1d200e6 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; +import java.util.Map; + +/** Database specific information for PostgreSQL to Azure Database for PostgreSQL migration task inputs. */ +@Fluent +public final class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput.class); + + /* + * Name of the database + */ + @JsonProperty(value = "name") + private String name; + + /* + * Name of target database. Note: Target database will be truncated before + * starting migration. + */ + @JsonProperty(value = "targetDatabaseName") + private String targetDatabaseName; + + /* + * Migration settings which tune the migration behavior + */ + @JsonProperty(value = "migrationSetting") + private Map migrationSetting; + + /* + * Source settings to tune source endpoint migration behavior + */ + @JsonProperty(value = "sourceSetting") + private Map sourceSetting; + + /* + * Target settings to tune target endpoint migration behavior + */ + @JsonProperty(value = "targetSetting") + private Map targetSetting; + + /* + * Tables selected for migration + */ + @JsonProperty(value = "selectedTables") + private List selectedTables; + + /** + * Get the name property: Name of the database. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the database. + * + * @param name the name value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get the targetDatabaseName property: Name of target database. Note: Target database will be truncated before + * starting migration. + * + * @return the targetDatabaseName value. + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Set the targetDatabaseName property: Name of target database. Note: Target database will be truncated before + * starting migration. + * + * @param targetDatabaseName the targetDatabaseName value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput withTargetDatabaseName(String targetDatabaseName) { + this.targetDatabaseName = targetDatabaseName; + return this; + } + + /** + * Get the migrationSetting property: Migration settings which tune the migration behavior. + * + * @return the migrationSetting value. + */ + public Map migrationSetting() { + return this.migrationSetting; + } + + /** + * Set the migrationSetting property: Migration settings which tune the migration behavior. + * + * @param migrationSetting the migrationSetting value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput withMigrationSetting( + Map migrationSetting) { + this.migrationSetting = migrationSetting; + return this; + } + + /** + * Get the sourceSetting property: Source settings to tune source endpoint migration behavior. + * + * @return the sourceSetting value. + */ + public Map sourceSetting() { + return this.sourceSetting; + } + + /** + * Set the sourceSetting property: Source settings to tune source endpoint migration behavior. + * + * @param sourceSetting the sourceSetting value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput withSourceSetting(Map sourceSetting) { + this.sourceSetting = sourceSetting; + return this; + } + + /** + * Get the targetSetting property: Target settings to tune target endpoint migration behavior. + * + * @return the targetSetting value. + */ + public Map targetSetting() { + return this.targetSetting; + } + + /** + * Set the targetSetting property: Target settings to tune target endpoint migration behavior. + * + * @param targetSetting the targetSetting value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput withTargetSetting(Map targetSetting) { + this.targetSetting = targetSetting; + return this; + } + + /** + * Get the selectedTables property: Tables selected for migration. + * + * @return the selectedTables value. + */ + public List selectedTables() { + return this.selectedTables; + } + + /** + * Set the selectedTables property: Tables selected for migration. + * + * @param selectedTables the selectedTables value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput withSelectedTables( + List selectedTables) { + this.selectedTables = selectedTables; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (selectedTables() != null) { + selectedTables().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.java new file mode 100644 index 000000000000..b39a35b3fee7 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.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.datamigration.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; + +/** Selected tables for the migration. */ +@Fluent +public final class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput.class); + + /* + * Name of the table to migrate + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the name property: Name of the table to migrate. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the table to migrate. + * + * @param name the name value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.java new file mode 100644 index 000000000000..adab2a9383fd --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.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.datamigration.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; + +/** Input for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations. */ +@Fluent +public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput.class); + + /* + * Databases to migrate + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /* + * Connection information for target Azure Database for PostgreSQL + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private PostgreSqlConnectionInfo targetConnectionInfo; + + /* + * Connection information for source PostgreSQL + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private PostgreSqlConnectionInfo sourceConnectionInfo; + + /** + * Get the selectedDatabases property: Databases to migrate. + * + * @return the selectedDatabases value. + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set the selectedDatabases property: Databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput withSelectedDatabases( + List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Get the targetConnectionInfo property: Connection information for target Azure Database for PostgreSQL. + * + * @return the targetConnectionInfo value. + */ + public PostgreSqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set the targetConnectionInfo property: Connection information for target Azure Database for PostgreSQL. + * + * @param targetConnectionInfo the targetConnectionInfo value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput withTargetConnectionInfo( + PostgreSqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Get the sourceConnectionInfo property: Connection information for source PostgreSQL. + * + * @return the sourceConnectionInfo value. + */ + public PostgreSqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set the sourceConnectionInfo property: Connection information for source PostgreSQL. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput withSourceConnectionInfo( + PostgreSqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (selectedDatabases() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectedDatabases in model" + + " MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput")); + } else { + selectedDatabases().forEach(e -> e.validate()); + } + if (targetConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetConnectionInfo in model" + + " MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput")); + } else { + targetConnectionInfo().validate(); + } + if (sourceConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceConnectionInfo in model" + + " MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput")); + } else { + sourceConnectionInfo().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.java new file mode 100644 index 000000000000..940950ba54ce --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.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.datamigration.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 com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Output for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "resultType", + defaultImpl = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.class) +@JsonTypeName("MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "MigrationLevelOutput", + value = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.class), + @JsonSubTypes.Type( + name = "DatabaseLevelOutput", + value = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.class), + @JsonSubTypes.Type( + name = "TableLevelOutput", + value = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.class), + @JsonSubTypes.Type(name = "ErrorOutput", value = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.class), + @JsonSubTypes.Type( + name = "DatabaseLevelErrorOutput", + value = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.class) +}) +@Immutable +public class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput.class); + + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.java new file mode 100644 index 000000000000..b9a4a86a0c8d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelErrorOutput") +@Fluent +public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + extends MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.class); + + /* + * Error message + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /* + * List of error events. + */ + @JsonProperty(value = "events") + private List events; + + /** + * Get the errorMessage property: Error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: Error message. + * + * @param errorMessage the errorMessage value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the events property: List of error events. + * + * @return the events value. + */ + public List events() { + return this.events; + } + + /** + * Set the events property: List of error events. + * + * @param events the events value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError withEvents( + List events) { + this.events = events; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (events() != null) { + events().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.java new file mode 100644 index 000000000000..6d3bf92b6a02 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** The MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelOutput") +@Immutable +public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + extends MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.class); + + /* + * Name of the database + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Migration state that this database is in + */ + @JsonProperty(value = "migrationState", access = JsonProperty.Access.WRITE_ONLY) + private SyncDatabaseMigrationReportingState migrationState; + + /* + * Number of incoming changes + */ + @JsonProperty(value = "incomingChanges", access = JsonProperty.Access.WRITE_ONLY) + private Long incomingChanges; + + /* + * Number of applied changes + */ + @JsonProperty(value = "appliedChanges", access = JsonProperty.Access.WRITE_ONLY) + private Long appliedChanges; + + /* + * Number of cdc inserts + */ + @JsonProperty(value = "cdcInsertCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcInsertCounter; + + /* + * Number of cdc deletes + */ + @JsonProperty(value = "cdcDeleteCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcDeleteCounter; + + /* + * Number of cdc updates + */ + @JsonProperty(value = "cdcUpdateCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcUpdateCounter; + + /* + * Number of tables completed in full load + */ + @JsonProperty(value = "fullLoadCompletedTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadCompletedTables; + + /* + * Number of tables loading in full load + */ + @JsonProperty(value = "fullLoadLoadingTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadLoadingTables; + + /* + * Number of tables queued in full load + */ + @JsonProperty(value = "fullLoadQueuedTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadQueuedTables; + + /* + * Number of tables errored in full load + */ + @JsonProperty(value = "fullLoadErroredTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadErroredTables; + + /* + * Indicates if initial load (full load) has been completed + */ + @JsonProperty(value = "initializationCompleted", access = JsonProperty.Access.WRITE_ONLY) + private Boolean initializationCompleted; + + /* + * CDC apply latency + */ + @JsonProperty(value = "latency", access = JsonProperty.Access.WRITE_ONLY) + private Long latency; + + /** + * Get the databaseName property: Name of the database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the migrationState property: Migration state that this database is in. + * + * @return the migrationState value. + */ + public SyncDatabaseMigrationReportingState migrationState() { + return this.migrationState; + } + + /** + * Get the incomingChanges property: Number of incoming changes. + * + * @return the incomingChanges value. + */ + public Long incomingChanges() { + return this.incomingChanges; + } + + /** + * Get the appliedChanges property: Number of applied changes. + * + * @return the appliedChanges value. + */ + public Long appliedChanges() { + return this.appliedChanges; + } + + /** + * Get the cdcInsertCounter property: Number of cdc inserts. + * + * @return the cdcInsertCounter value. + */ + public Long cdcInsertCounter() { + return this.cdcInsertCounter; + } + + /** + * Get the cdcDeleteCounter property: Number of cdc deletes. + * + * @return the cdcDeleteCounter value. + */ + public Long cdcDeleteCounter() { + return this.cdcDeleteCounter; + } + + /** + * Get the cdcUpdateCounter property: Number of cdc updates. + * + * @return the cdcUpdateCounter value. + */ + public Long cdcUpdateCounter() { + return this.cdcUpdateCounter; + } + + /** + * Get the fullLoadCompletedTables property: Number of tables completed in full load. + * + * @return the fullLoadCompletedTables value. + */ + public Long fullLoadCompletedTables() { + return this.fullLoadCompletedTables; + } + + /** + * Get the fullLoadLoadingTables property: Number of tables loading in full load. + * + * @return the fullLoadLoadingTables value. + */ + public Long fullLoadLoadingTables() { + return this.fullLoadLoadingTables; + } + + /** + * Get the fullLoadQueuedTables property: Number of tables queued in full load. + * + * @return the fullLoadQueuedTables value. + */ + public Long fullLoadQueuedTables() { + return this.fullLoadQueuedTables; + } + + /** + * Get the fullLoadErroredTables property: Number of tables errored in full load. + * + * @return the fullLoadErroredTables value. + */ + public Long fullLoadErroredTables() { + return this.fullLoadErroredTables; + } + + /** + * Get the initializationCompleted property: Indicates if initial load (full load) has been completed. + * + * @return the initializationCompleted value. + */ + public Boolean initializationCompleted() { + return this.initializationCompleted; + } + + /** + * Get the latency property: CDC apply latency. + * + * @return the latency value. + */ + public Long latency() { + return this.latency; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.java new file mode 100644 index 000000000000..2ee7ea9ededd --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("ErrorOutput") +@Immutable +public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + extends MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.class); + + /* + * Migration error + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ReportableException error; + + /** + * Get the error property: Migration error. + * + * @return the error value. + */ + public ReportableException error() { + return this.error; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.java new file mode 100644 index 000000000000..7d8c2764540d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** The MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrationLevelOutput") +@Immutable +public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + extends MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.class); + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Source server version + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /* + * Source server name + */ + @JsonProperty(value = "sourceServer", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServer; + + /* + * Target server version + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /* + * Target server name + */ + @JsonProperty(value = "targetServer", access = JsonProperty.Access.WRITE_ONLY) + private String targetServer; + + /* + * Source server type. + */ + @JsonProperty(value = "sourceServerType", access = JsonProperty.Access.WRITE_ONLY) + private ScenarioSource sourceServerType; + + /* + * Target server type. + */ + @JsonProperty(value = "targetServerType", access = JsonProperty.Access.WRITE_ONLY) + private ScenarioTarget targetServerType; + + /* + * Migration status + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private ReplicateMigrationState state; + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the sourceServerVersion property: Source server version. + * + * @return the sourceServerVersion value. + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get the sourceServer property: Source server name. + * + * @return the sourceServer value. + */ + public String sourceServer() { + return this.sourceServer; + } + + /** + * Get the targetServerVersion property: Target server version. + * + * @return the targetServerVersion value. + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get the targetServer property: Target server name. + * + * @return the targetServer value. + */ + public String targetServer() { + return this.targetServer; + } + + /** + * Get the sourceServerType property: Source server type. + * + * @return the sourceServerType value. + */ + public ScenarioSource sourceServerType() { + return this.sourceServerType; + } + + /** + * Get the targetServerType property: Target server type. + * + * @return the targetServerType value. + */ + public ScenarioTarget targetServerType() { + return this.targetServerType; + } + + /** + * Get the state property: Migration status. + * + * @return the state value. + */ + public ReplicateMigrationState state() { + return this.state; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.java new file mode 100644 index 000000000000..d99a9f10eb08 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** The MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("TableLevelOutput") +@Immutable +public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + extends MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.class); + + /* + * Name of the table + */ + @JsonProperty(value = "tableName", access = JsonProperty.Access.WRITE_ONLY) + private String tableName; + + /* + * Name of the database + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /* + * Number of applied inserts + */ + @JsonProperty(value = "cdcInsertCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcInsertCounter; + + /* + * Number of applied updates + */ + @JsonProperty(value = "cdcUpdateCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcUpdateCounter; + + /* + * Number of applied deletes + */ + @JsonProperty(value = "cdcDeleteCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcDeleteCounter; + + /* + * Estimate to finish full load + */ + @JsonProperty(value = "fullLoadEstFinishTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime fullLoadEstFinishTime; + + /* + * Full load start time + */ + @JsonProperty(value = "fullLoadStartedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime fullLoadStartedOn; + + /* + * Full load end time + */ + @JsonProperty(value = "fullLoadEndedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime fullLoadEndedOn; + + /* + * Number of rows applied in full load + */ + @JsonProperty(value = "fullLoadTotalRows", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadTotalRows; + + /* + * Current state of the table migration + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private SyncTableMigrationState state; + + /* + * Total number of applied changes + */ + @JsonProperty(value = "totalChangesApplied", access = JsonProperty.Access.WRITE_ONLY) + private Long totalChangesApplied; + + /* + * Number of data errors occurred + */ + @JsonProperty(value = "dataErrorsCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long dataErrorsCounter; + + /* + * Last modified time on target + */ + @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTime; + + /** + * Get the tableName property: Name of the table. + * + * @return the tableName value. + */ + public String tableName() { + return this.tableName; + } + + /** + * Get the databaseName property: Name of the database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get the cdcInsertCounter property: Number of applied inserts. + * + * @return the cdcInsertCounter value. + */ + public Long cdcInsertCounter() { + return this.cdcInsertCounter; + } + + /** + * Get the cdcUpdateCounter property: Number of applied updates. + * + * @return the cdcUpdateCounter value. + */ + public Long cdcUpdateCounter() { + return this.cdcUpdateCounter; + } + + /** + * Get the cdcDeleteCounter property: Number of applied deletes. + * + * @return the cdcDeleteCounter value. + */ + public Long cdcDeleteCounter() { + return this.cdcDeleteCounter; + } + + /** + * Get the fullLoadEstFinishTime property: Estimate to finish full load. + * + * @return the fullLoadEstFinishTime value. + */ + public OffsetDateTime fullLoadEstFinishTime() { + return this.fullLoadEstFinishTime; + } + + /** + * Get the fullLoadStartedOn property: Full load start time. + * + * @return the fullLoadStartedOn value. + */ + public OffsetDateTime fullLoadStartedOn() { + return this.fullLoadStartedOn; + } + + /** + * Get the fullLoadEndedOn property: Full load end time. + * + * @return the fullLoadEndedOn value. + */ + public OffsetDateTime fullLoadEndedOn() { + return this.fullLoadEndedOn; + } + + /** + * Get the fullLoadTotalRows property: Number of rows applied in full load. + * + * @return the fullLoadTotalRows value. + */ + public Long fullLoadTotalRows() { + return this.fullLoadTotalRows; + } + + /** + * Get the state property: Current state of the table migration. + * + * @return the state value. + */ + public SyncTableMigrationState state() { + return this.state; + } + + /** + * Get the totalChangesApplied property: Total number of applied changes. + * + * @return the totalChangesApplied value. + */ + public Long totalChangesApplied() { + return this.totalChangesApplied; + } + + /** + * Get the dataErrorsCounter property: Number of data errors occurred. + * + * @return the dataErrorsCounter value. + */ + public Long dataErrorsCounter() { + return this.dataErrorsCounter; + } + + /** + * Get the lastModifiedTime property: Last modified time on target. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.java new file mode 100644 index 000000000000..b30b53cfe7ad --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** + * Properties for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for online migrations. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2") +@Fluent +public final class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties extends ProjectTaskProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties object itself. + */ + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties withInput( + MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbDatabaseInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbDatabaseInput.java new file mode 100644 index 000000000000..713074574ada --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbDatabaseInput.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Database input for migrate schema Sql Server to Azure SQL Server scenario. */ +@Fluent +public final class MigrateSchemaSqlServerSqlDbDatabaseInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSchemaSqlServerSqlDbDatabaseInput.class); + + /* + * Name of source database + */ + @JsonProperty(value = "name") + private String name; + + /* + * Name of target database + */ + @JsonProperty(value = "targetDatabaseName") + private String targetDatabaseName; + + /* + * Database schema migration settings + */ + @JsonProperty(value = "schemaSetting") + private SchemaMigrationSetting schemaSetting; + + /** + * Get the name property: Name of source database. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of source database. + * + * @param name the name value to set. + * @return the MigrateSchemaSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSchemaSqlServerSqlDbDatabaseInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get the targetDatabaseName property: Name of target database. + * + * @return the targetDatabaseName value. + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Set the targetDatabaseName property: Name of target database. + * + * @param targetDatabaseName the targetDatabaseName value to set. + * @return the MigrateSchemaSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSchemaSqlServerSqlDbDatabaseInput withTargetDatabaseName(String targetDatabaseName) { + this.targetDatabaseName = targetDatabaseName; + return this; + } + + /** + * Get the schemaSetting property: Database schema migration settings. + * + * @return the schemaSetting value. + */ + public SchemaMigrationSetting schemaSetting() { + return this.schemaSetting; + } + + /** + * Set the schemaSetting property: Database schema migration settings. + * + * @param schemaSetting the schemaSetting value to set. + * @return the MigrateSchemaSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSchemaSqlServerSqlDbDatabaseInput withSchemaSetting(SchemaMigrationSetting schemaSetting) { + this.schemaSetting = schemaSetting; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (schemaSetting() != null) { + schemaSetting().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskInput.java new file mode 100644 index 000000000000..73d5d10b18b6 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskInput.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.datamigration.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; + +/** Input for task that migrates Schema for SQL Server databases to Azure SQL databases. */ +@Fluent +public final class MigrateSchemaSqlServerSqlDbTaskInput extends SqlMigrationTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSchemaSqlServerSqlDbTaskInput.class); + + /* + * Databases to migrate + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /** + * Get the selectedDatabases property: Databases to migrate. + * + * @return the selectedDatabases value. + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set the selectedDatabases property: Databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set. + * @return the MigrateSchemaSqlServerSqlDbTaskInput object itself. + */ + public MigrateSchemaSqlServerSqlDbTaskInput withSelectedDatabases( + List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** {@inheritDoc} */ + @Override + public MigrateSchemaSqlServerSqlDbTaskInput withSourceConnectionInfo(SqlConnectionInfo sourceConnectionInfo) { + super.withSourceConnectionInfo(sourceConnectionInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public MigrateSchemaSqlServerSqlDbTaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + super.withTargetConnectionInfo(targetConnectionInfo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (selectedDatabases() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectedDatabases in model MigrateSchemaSqlServerSqlDbTaskInput")); + } else { + selectedDatabases().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutput.java new file mode 100644 index 000000000000..529a656a033c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutput.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Output for the task that migrates Schema for SQL Server databases to Azure SQL databases. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "resultType", + defaultImpl = MigrateSchemaSqlServerSqlDbTaskOutput.class) +@JsonTypeName("MigrateSchemaSqlServerSqlDbTaskOutput") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "MigrationLevelOutput", + value = MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.class), + @JsonSubTypes.Type(name = "DatabaseLevelOutput", value = MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.class), + @JsonSubTypes.Type(name = "SchemaErrorOutput", value = MigrateSchemaSqlServerSqlDbTaskOutputError.class), + @JsonSubTypes.Type(name = "ErrorOutput", value = MigrateSchemaSqlTaskOutputError.class) +}) +@Immutable +public class MigrateSchemaSqlServerSqlDbTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSchemaSqlServerSqlDbTaskOutput.class); + + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.java new file mode 100644 index 000000000000..24f907ae5c9b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** The MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelOutput") +@Immutable +public final class MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel extends MigrateSchemaSqlServerSqlDbTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.class); + + /* + * The name of the database + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /* + * State of the schema migration for this database + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /* + * Schema migration stage for this database + */ + @JsonProperty(value = "stage", access = JsonProperty.Access.WRITE_ONLY) + private SchemaMigrationStage stage; + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Prefix string to use for querying errors for this database + */ + @JsonProperty(value = "databaseErrorResultPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String databaseErrorResultPrefix; + + /* + * Prefix string to use for querying schema errors for this database + */ + @JsonProperty(value = "schemaErrorResultPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String schemaErrorResultPrefix; + + /* + * Number of successful operations for this database + */ + @JsonProperty(value = "numberOfSuccessfulOperations", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfSuccessfulOperations; + + /* + * Number of failed operations for this database + */ + @JsonProperty(value = "numberOfFailedOperations", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfFailedOperations; + + /* + * Identifier for the file resource containing the schema of this database + */ + @JsonProperty(value = "fileId", access = JsonProperty.Access.WRITE_ONLY) + private String fileId; + + /** + * Get the databaseName property: The name of the database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get the state property: State of the schema migration for this database. + * + * @return the state value. + */ + public MigrationState state() { + return this.state; + } + + /** + * Get the stage property: Schema migration stage for this database. + * + * @return the stage value. + */ + public SchemaMigrationStage stage() { + return this.stage; + } + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the databaseErrorResultPrefix property: Prefix string to use for querying errors for this database. + * + * @return the databaseErrorResultPrefix value. + */ + public String databaseErrorResultPrefix() { + return this.databaseErrorResultPrefix; + } + + /** + * Get the schemaErrorResultPrefix property: Prefix string to use for querying schema errors for this database. + * + * @return the schemaErrorResultPrefix value. + */ + public String schemaErrorResultPrefix() { + return this.schemaErrorResultPrefix; + } + + /** + * Get the numberOfSuccessfulOperations property: Number of successful operations for this database. + * + * @return the numberOfSuccessfulOperations value. + */ + public Long numberOfSuccessfulOperations() { + return this.numberOfSuccessfulOperations; + } + + /** + * Get the numberOfFailedOperations property: Number of failed operations for this database. + * + * @return the numberOfFailedOperations value. + */ + public Long numberOfFailedOperations() { + return this.numberOfFailedOperations; + } + + /** + * Get the fileId property: Identifier for the file resource containing the schema of this database. + * + * @return the fileId value. + */ + public String fileId() { + return this.fileId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputError.java new file mode 100644 index 000000000000..9bac41baa6aa --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputError.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The MigrateSchemaSqlServerSqlDbTaskOutputError model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("SchemaErrorOutput") +@Immutable +public final class MigrateSchemaSqlServerSqlDbTaskOutputError extends MigrateSchemaSqlServerSqlDbTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSchemaSqlServerSqlDbTaskOutputError.class); + + /* + * Schema command which failed + */ + @JsonProperty(value = "commandText", access = JsonProperty.Access.WRITE_ONLY) + private String commandText; + + /* + * Reason of failure + */ + @JsonProperty(value = "errorText", access = JsonProperty.Access.WRITE_ONLY) + private String errorText; + + /** + * Get the commandText property: Schema command which failed. + * + * @return the commandText value. + */ + public String commandText() { + return this.commandText; + } + + /** + * Get the errorText property: Reason of failure. + * + * @return the errorText value. + */ + public String errorText() { + return this.errorText; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.java new file mode 100644 index 000000000000..2b7640c69ddc --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** The MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrationLevelOutput") +@Immutable +public final class MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel extends MigrateSchemaSqlServerSqlDbTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.class); + + /* + * Overall state of the schema migration + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Source server version + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /* + * Source server brand version + */ + @JsonProperty(value = "sourceServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerBrandVersion; + + /* + * Target server version + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /* + * Target server brand version + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /** + * Get the state property: Overall state of the schema migration. + * + * @return the state value. + */ + public MigrationState state() { + return this.state; + } + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the sourceServerVersion property: Source server version. + * + * @return the sourceServerVersion value. + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get the sourceServerBrandVersion property: Source server brand version. + * + * @return the sourceServerBrandVersion value. + */ + public String sourceServerBrandVersion() { + return this.sourceServerBrandVersion; + } + + /** + * Get the targetServerVersion property: Target server version. + * + * @return the targetServerVersion value. + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get the targetServerBrandVersion property: Target server brand version. + * + * @return the targetServerBrandVersion value. + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskProperties.java new file mode 100644 index 000000000000..9b94a611ec57 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlServerSqlDbTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for task that migrates Schema for SQL Server databases to Azure SQL databases. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("MigrateSchemaSqlServerSqlDb") +@Fluent +public final class MigrateSchemaSqlServerSqlDbTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSchemaSqlServerSqlDbTaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private MigrateSchemaSqlServerSqlDbTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public MigrateSchemaSqlServerSqlDbTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the MigrateSchemaSqlServerSqlDbTaskProperties object itself. + */ + public MigrateSchemaSqlServerSqlDbTaskProperties withInput(MigrateSchemaSqlServerSqlDbTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public MigrateSchemaSqlServerSqlDbTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlTaskOutputError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlTaskOutputError.java new file mode 100644 index 000000000000..adcdc53667d3 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSchemaSqlTaskOutputError.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The MigrateSchemaSqlTaskOutputError model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("ErrorOutput") +@Immutable +public final class MigrateSchemaSqlTaskOutputError extends MigrateSchemaSqlServerSqlDbTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSchemaSqlTaskOutputError.class); + + /* + * Migration error + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ReportableException error; + + /** + * Get the error property: Migration error. + * + * @return the error value. + */ + public ReportableException error() { + return this.error; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbDatabaseInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbDatabaseInput.java new file mode 100644 index 000000000000..cee7957f657b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbDatabaseInput.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.datamigration.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; + +/** Database specific information for SQL to Azure SQL DB migration task inputs. */ +@Fluent +public final class MigrateSqlServerSqlDbDatabaseInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbDatabaseInput.class); + + /* + * Name of the database + */ + @JsonProperty(value = "name") + private String name; + + /* + * Name of target database. Note: Target database will be truncated before + * starting migration. + */ + @JsonProperty(value = "targetDatabaseName") + private String targetDatabaseName; + + /* + * Whether to set database read only before migration + */ + @JsonProperty(value = "makeSourceDbReadOnly") + private Boolean makeSourceDbReadOnly; + + /* + * Mapping of source to target tables + */ + @JsonProperty(value = "tableMap") + private Map tableMap; + + /** + * Get the name property: Name of the database. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the database. + * + * @param name the name value to set. + * @return the MigrateSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbDatabaseInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get the targetDatabaseName property: Name of target database. Note: Target database will be truncated before + * starting migration. + * + * @return the targetDatabaseName value. + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Set the targetDatabaseName property: Name of target database. Note: Target database will be truncated before + * starting migration. + * + * @param targetDatabaseName the targetDatabaseName value to set. + * @return the MigrateSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbDatabaseInput withTargetDatabaseName(String targetDatabaseName) { + this.targetDatabaseName = targetDatabaseName; + return this; + } + + /** + * Get the makeSourceDbReadOnly property: Whether to set database read only before migration. + * + * @return the makeSourceDbReadOnly value. + */ + public Boolean makeSourceDbReadOnly() { + return this.makeSourceDbReadOnly; + } + + /** + * Set the makeSourceDbReadOnly property: Whether to set database read only before migration. + * + * @param makeSourceDbReadOnly the makeSourceDbReadOnly value to set. + * @return the MigrateSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbDatabaseInput withMakeSourceDbReadOnly(Boolean makeSourceDbReadOnly) { + this.makeSourceDbReadOnly = makeSourceDbReadOnly; + return this; + } + + /** + * Get the tableMap property: Mapping of source to target tables. + * + * @return the tableMap value. + */ + public Map tableMap() { + return this.tableMap; + } + + /** + * Set the tableMap property: Mapping of source to target tables. + * + * @param tableMap the tableMap value to set. + * @return the MigrateSqlServerSqlDbDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbDatabaseInput withTableMap(Map tableMap) { + this.tableMap = tableMap; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncDatabaseInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncDatabaseInput.java new file mode 100644 index 000000000000..f1a6cd7f12f6 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncDatabaseInput.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.datamigration.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; + +/** Database specific information for SQL to Azure SQL DB sync migration task inputs. */ +@Fluent +public final class MigrateSqlServerSqlDbSyncDatabaseInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbSyncDatabaseInput.class); + + /* + * Unique identifier for database + */ + @JsonProperty(value = "id") + private String id; + + /* + * Name of database + */ + @JsonProperty(value = "name") + private String name; + + /* + * Target database name + */ + @JsonProperty(value = "targetDatabaseName") + private String targetDatabaseName; + + /* + * Schema name to be migrated + */ + @JsonProperty(value = "schemaName") + private String schemaName; + + /* + * Mapping of source to target tables + */ + @JsonProperty(value = "tableMap") + private Map tableMap; + + /* + * Migration settings which tune the migration behavior + */ + @JsonProperty(value = "migrationSetting") + private Map migrationSetting; + + /* + * Source settings to tune source endpoint migration behavior + */ + @JsonProperty(value = "sourceSetting") + private Map sourceSetting; + + /* + * Target settings to tune target endpoint migration behavior + */ + @JsonProperty(value = "targetSetting") + private Map targetSetting; + + /** + * Get the id property: Unique identifier for database. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Unique identifier for database. + * + * @param id the id value to set. + * @return the MigrateSqlServerSqlDbSyncDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbSyncDatabaseInput withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Name of database. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of database. + * + * @param name the name value to set. + * @return the MigrateSqlServerSqlDbSyncDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbSyncDatabaseInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get the targetDatabaseName property: Target database name. + * + * @return the targetDatabaseName value. + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Set the targetDatabaseName property: Target database name. + * + * @param targetDatabaseName the targetDatabaseName value to set. + * @return the MigrateSqlServerSqlDbSyncDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbSyncDatabaseInput withTargetDatabaseName(String targetDatabaseName) { + this.targetDatabaseName = targetDatabaseName; + return this; + } + + /** + * Get the schemaName property: Schema name to be migrated. + * + * @return the schemaName value. + */ + public String schemaName() { + return this.schemaName; + } + + /** + * Set the schemaName property: Schema name to be migrated. + * + * @param schemaName the schemaName value to set. + * @return the MigrateSqlServerSqlDbSyncDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbSyncDatabaseInput withSchemaName(String schemaName) { + this.schemaName = schemaName; + return this; + } + + /** + * Get the tableMap property: Mapping of source to target tables. + * + * @return the tableMap value. + */ + public Map tableMap() { + return this.tableMap; + } + + /** + * Set the tableMap property: Mapping of source to target tables. + * + * @param tableMap the tableMap value to set. + * @return the MigrateSqlServerSqlDbSyncDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbSyncDatabaseInput withTableMap(Map tableMap) { + this.tableMap = tableMap; + return this; + } + + /** + * Get the migrationSetting property: Migration settings which tune the migration behavior. + * + * @return the migrationSetting value. + */ + public Map migrationSetting() { + return this.migrationSetting; + } + + /** + * Set the migrationSetting property: Migration settings which tune the migration behavior. + * + * @param migrationSetting the migrationSetting value to set. + * @return the MigrateSqlServerSqlDbSyncDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbSyncDatabaseInput withMigrationSetting(Map migrationSetting) { + this.migrationSetting = migrationSetting; + return this; + } + + /** + * Get the sourceSetting property: Source settings to tune source endpoint migration behavior. + * + * @return the sourceSetting value. + */ + public Map sourceSetting() { + return this.sourceSetting; + } + + /** + * Set the sourceSetting property: Source settings to tune source endpoint migration behavior. + * + * @param sourceSetting the sourceSetting value to set. + * @return the MigrateSqlServerSqlDbSyncDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbSyncDatabaseInput withSourceSetting(Map sourceSetting) { + this.sourceSetting = sourceSetting; + return this; + } + + /** + * Get the targetSetting property: Target settings to tune target endpoint migration behavior. + * + * @return the targetSetting value. + */ + public Map targetSetting() { + return this.targetSetting; + } + + /** + * Set the targetSetting property: Target settings to tune target endpoint migration behavior. + * + * @param targetSetting the targetSetting value to set. + * @return the MigrateSqlServerSqlDbSyncDatabaseInput object itself. + */ + public MigrateSqlServerSqlDbSyncDatabaseInput withTargetSetting(Map targetSetting) { + this.targetSetting = targetSetting; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskInput.java new file mode 100644 index 000000000000..9e336bc475a1 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskInput.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Input for the task that migrates on-prem SQL Server databases to Azure SQL Database for online migrations. */ +@Fluent +public final class MigrateSqlServerSqlDbSyncTaskInput extends SqlMigrationTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbSyncTaskInput.class); + + /* + * Databases to migrate + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /* + * Validation options + */ + @JsonProperty(value = "validationOptions") + private MigrationValidationOptions validationOptions; + + /** + * Get the selectedDatabases property: Databases to migrate. + * + * @return the selectedDatabases value. + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set the selectedDatabases property: Databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set. + * @return the MigrateSqlServerSqlDbSyncTaskInput object itself. + */ + public MigrateSqlServerSqlDbSyncTaskInput withSelectedDatabases( + List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Get the validationOptions property: Validation options. + * + * @return the validationOptions value. + */ + public MigrationValidationOptions validationOptions() { + return this.validationOptions; + } + + /** + * Set the validationOptions property: Validation options. + * + * @param validationOptions the validationOptions value to set. + * @return the MigrateSqlServerSqlDbSyncTaskInput object itself. + */ + public MigrateSqlServerSqlDbSyncTaskInput withValidationOptions(MigrationValidationOptions validationOptions) { + this.validationOptions = validationOptions; + return this; + } + + /** {@inheritDoc} */ + @Override + public MigrateSqlServerSqlDbSyncTaskInput withSourceConnectionInfo(SqlConnectionInfo sourceConnectionInfo) { + super.withSourceConnectionInfo(sourceConnectionInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public MigrateSqlServerSqlDbSyncTaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + super.withTargetConnectionInfo(targetConnectionInfo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (selectedDatabases() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectedDatabases in model MigrateSqlServerSqlDbSyncTaskInput")); + } else { + selectedDatabases().forEach(e -> e.validate()); + } + if (validationOptions() != null) { + validationOptions().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutput.java new file mode 100644 index 000000000000..ebbcf594d354 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutput.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Output for the task that migrates on-prem SQL Server databases to Azure SQL Database for online migrations. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "resultType", + defaultImpl = MigrateSqlServerSqlDbSyncTaskOutput.class) +@JsonTypeName("MigrateSqlServerSqlDbSyncTaskOutput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "MigrationLevelOutput", value = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.class), + @JsonSubTypes.Type(name = "DatabaseLevelOutput", value = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.class), + @JsonSubTypes.Type(name = "TableLevelOutput", value = MigrateSqlServerSqlDbSyncTaskOutputTableLevel.class), + @JsonSubTypes.Type(name = "ErrorOutput", value = MigrateSqlServerSqlDbSyncTaskOutputError.class), + @JsonSubTypes.Type( + name = "DatabaseLevelErrorOutput", + value = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.class) +}) +@Immutable +public class MigrateSqlServerSqlDbSyncTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbSyncTaskOutput.class); + + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.java new file mode 100644 index 000000000000..cdd5adb684c8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The MigrateSqlServerSqlDbSyncTaskOutputDatabaseError model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelErrorOutput") +@Fluent +public final class MigrateSqlServerSqlDbSyncTaskOutputDatabaseError extends MigrateSqlServerSqlDbSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.class); + + /* + * Error message + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /* + * List of error events. + */ + @JsonProperty(value = "events") + private List events; + + /** + * Get the errorMessage property: Error message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: Error message. + * + * @param errorMessage the errorMessage value to set. + * @return the MigrateSqlServerSqlDbSyncTaskOutputDatabaseError object itself. + */ + public MigrateSqlServerSqlDbSyncTaskOutputDatabaseError withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Get the events property: List of error events. + * + * @return the events value. + */ + public List events() { + return this.events; + } + + /** + * Set the events property: List of error events. + * + * @param events the events value to set. + * @return the MigrateSqlServerSqlDbSyncTaskOutputDatabaseError object itself. + */ + public MigrateSqlServerSqlDbSyncTaskOutputDatabaseError withEvents(List events) { + this.events = events; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (events() != null) { + events().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.java new file mode 100644 index 000000000000..f04fdec7e341 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** The MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelOutput") +@Immutable +public final class MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel extends MigrateSqlServerSqlDbSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.class); + + /* + * Name of the database + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Migration state that this database is in + */ + @JsonProperty(value = "migrationState", access = JsonProperty.Access.WRITE_ONLY) + private SyncDatabaseMigrationReportingState migrationState; + + /* + * Number of incoming changes + */ + @JsonProperty(value = "incomingChanges", access = JsonProperty.Access.WRITE_ONLY) + private Long incomingChanges; + + /* + * Number of applied changes + */ + @JsonProperty(value = "appliedChanges", access = JsonProperty.Access.WRITE_ONLY) + private Long appliedChanges; + + /* + * Number of cdc inserts + */ + @JsonProperty(value = "cdcInsertCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcInsertCounter; + + /* + * Number of cdc deletes + */ + @JsonProperty(value = "cdcDeleteCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcDeleteCounter; + + /* + * Number of cdc updates + */ + @JsonProperty(value = "cdcUpdateCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcUpdateCounter; + + /* + * Number of tables completed in full load + */ + @JsonProperty(value = "fullLoadCompletedTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadCompletedTables; + + /* + * Number of tables loading in full load + */ + @JsonProperty(value = "fullLoadLoadingTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadLoadingTables; + + /* + * Number of tables queued in full load + */ + @JsonProperty(value = "fullLoadQueuedTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadQueuedTables; + + /* + * Number of tables errored in full load + */ + @JsonProperty(value = "fullLoadErroredTables", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadErroredTables; + + /* + * Indicates if initial load (full load) has been completed + */ + @JsonProperty(value = "initializationCompleted", access = JsonProperty.Access.WRITE_ONLY) + private Boolean initializationCompleted; + + /* + * CDC apply latency + */ + @JsonProperty(value = "latency", access = JsonProperty.Access.WRITE_ONLY) + private Long latency; + + /** + * Get the databaseName property: Name of the database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the migrationState property: Migration state that this database is in. + * + * @return the migrationState value. + */ + public SyncDatabaseMigrationReportingState migrationState() { + return this.migrationState; + } + + /** + * Get the incomingChanges property: Number of incoming changes. + * + * @return the incomingChanges value. + */ + public Long incomingChanges() { + return this.incomingChanges; + } + + /** + * Get the appliedChanges property: Number of applied changes. + * + * @return the appliedChanges value. + */ + public Long appliedChanges() { + return this.appliedChanges; + } + + /** + * Get the cdcInsertCounter property: Number of cdc inserts. + * + * @return the cdcInsertCounter value. + */ + public Long cdcInsertCounter() { + return this.cdcInsertCounter; + } + + /** + * Get the cdcDeleteCounter property: Number of cdc deletes. + * + * @return the cdcDeleteCounter value. + */ + public Long cdcDeleteCounter() { + return this.cdcDeleteCounter; + } + + /** + * Get the cdcUpdateCounter property: Number of cdc updates. + * + * @return the cdcUpdateCounter value. + */ + public Long cdcUpdateCounter() { + return this.cdcUpdateCounter; + } + + /** + * Get the fullLoadCompletedTables property: Number of tables completed in full load. + * + * @return the fullLoadCompletedTables value. + */ + public Long fullLoadCompletedTables() { + return this.fullLoadCompletedTables; + } + + /** + * Get the fullLoadLoadingTables property: Number of tables loading in full load. + * + * @return the fullLoadLoadingTables value. + */ + public Long fullLoadLoadingTables() { + return this.fullLoadLoadingTables; + } + + /** + * Get the fullLoadQueuedTables property: Number of tables queued in full load. + * + * @return the fullLoadQueuedTables value. + */ + public Long fullLoadQueuedTables() { + return this.fullLoadQueuedTables; + } + + /** + * Get the fullLoadErroredTables property: Number of tables errored in full load. + * + * @return the fullLoadErroredTables value. + */ + public Long fullLoadErroredTables() { + return this.fullLoadErroredTables; + } + + /** + * Get the initializationCompleted property: Indicates if initial load (full load) has been completed. + * + * @return the initializationCompleted value. + */ + public Boolean initializationCompleted() { + return this.initializationCompleted; + } + + /** + * Get the latency property: CDC apply latency. + * + * @return the latency value. + */ + public Long latency() { + return this.latency; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputError.java new file mode 100644 index 000000000000..6ccaf69fc256 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputError.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The MigrateSqlServerSqlDbSyncTaskOutputError model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("ErrorOutput") +@Immutable +public final class MigrateSqlServerSqlDbSyncTaskOutputError extends MigrateSqlServerSqlDbSyncTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbSyncTaskOutputError.class); + + /* + * Migration error + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ReportableException error; + + /** + * Get the error property: Migration error. + * + * @return the error value. + */ + public ReportableException error() { + return this.error; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.java new file mode 100644 index 000000000000..dfebad2dd096 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** The MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrationLevelOutput") +@Immutable +public final class MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel extends MigrateSqlServerSqlDbSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.class); + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Source server version + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /* + * Source server name + */ + @JsonProperty(value = "sourceServer", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServer; + + /* + * Target server version + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /* + * Target server name + */ + @JsonProperty(value = "targetServer", access = JsonProperty.Access.WRITE_ONLY) + private String targetServer; + + /* + * Count of databases + */ + @JsonProperty(value = "databaseCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer databaseCount; + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the sourceServerVersion property: Source server version. + * + * @return the sourceServerVersion value. + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get the sourceServer property: Source server name. + * + * @return the sourceServer value. + */ + public String sourceServer() { + return this.sourceServer; + } + + /** + * Get the targetServerVersion property: Target server version. + * + * @return the targetServerVersion value. + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get the targetServer property: Target server name. + * + * @return the targetServer value. + */ + public String targetServer() { + return this.targetServer; + } + + /** + * Get the databaseCount property: Count of databases. + * + * @return the databaseCount value. + */ + public Integer databaseCount() { + return this.databaseCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputTableLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputTableLevel.java new file mode 100644 index 000000000000..ee0b43c563fd --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskOutputTableLevel.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** The MigrateSqlServerSqlDbSyncTaskOutputTableLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("TableLevelOutput") +@Immutable +public final class MigrateSqlServerSqlDbSyncTaskOutputTableLevel extends MigrateSqlServerSqlDbSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbSyncTaskOutputTableLevel.class); + + /* + * Name of the table + */ + @JsonProperty(value = "tableName", access = JsonProperty.Access.WRITE_ONLY) + private String tableName; + + /* + * Name of the database + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /* + * Number of applied inserts + */ + @JsonProperty(value = "cdcInsertCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcInsertCounter; + + /* + * Number of applied updates + */ + @JsonProperty(value = "cdcUpdateCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcUpdateCounter; + + /* + * Number of applied deletes + */ + @JsonProperty(value = "cdcDeleteCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long cdcDeleteCounter; + + /* + * Estimate to finish full load + */ + @JsonProperty(value = "fullLoadEstFinishTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime fullLoadEstFinishTime; + + /* + * Full load start time + */ + @JsonProperty(value = "fullLoadStartedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime fullLoadStartedOn; + + /* + * Full load end time + */ + @JsonProperty(value = "fullLoadEndedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime fullLoadEndedOn; + + /* + * Number of rows applied in full load + */ + @JsonProperty(value = "fullLoadTotalRows", access = JsonProperty.Access.WRITE_ONLY) + private Long fullLoadTotalRows; + + /* + * Current state of the table migration + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private SyncTableMigrationState state; + + /* + * Total number of applied changes + */ + @JsonProperty(value = "totalChangesApplied", access = JsonProperty.Access.WRITE_ONLY) + private Long totalChangesApplied; + + /* + * Number of data errors occurred + */ + @JsonProperty(value = "dataErrorsCounter", access = JsonProperty.Access.WRITE_ONLY) + private Long dataErrorsCounter; + + /* + * Last modified time on target + */ + @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedTime; + + /** + * Get the tableName property: Name of the table. + * + * @return the tableName value. + */ + public String tableName() { + return this.tableName; + } + + /** + * Get the databaseName property: Name of the database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get the cdcInsertCounter property: Number of applied inserts. + * + * @return the cdcInsertCounter value. + */ + public Long cdcInsertCounter() { + return this.cdcInsertCounter; + } + + /** + * Get the cdcUpdateCounter property: Number of applied updates. + * + * @return the cdcUpdateCounter value. + */ + public Long cdcUpdateCounter() { + return this.cdcUpdateCounter; + } + + /** + * Get the cdcDeleteCounter property: Number of applied deletes. + * + * @return the cdcDeleteCounter value. + */ + public Long cdcDeleteCounter() { + return this.cdcDeleteCounter; + } + + /** + * Get the fullLoadEstFinishTime property: Estimate to finish full load. + * + * @return the fullLoadEstFinishTime value. + */ + public OffsetDateTime fullLoadEstFinishTime() { + return this.fullLoadEstFinishTime; + } + + /** + * Get the fullLoadStartedOn property: Full load start time. + * + * @return the fullLoadStartedOn value. + */ + public OffsetDateTime fullLoadStartedOn() { + return this.fullLoadStartedOn; + } + + /** + * Get the fullLoadEndedOn property: Full load end time. + * + * @return the fullLoadEndedOn value. + */ + public OffsetDateTime fullLoadEndedOn() { + return this.fullLoadEndedOn; + } + + /** + * Get the fullLoadTotalRows property: Number of rows applied in full load. + * + * @return the fullLoadTotalRows value. + */ + public Long fullLoadTotalRows() { + return this.fullLoadTotalRows; + } + + /** + * Get the state property: Current state of the table migration. + * + * @return the state value. + */ + public SyncTableMigrationState state() { + return this.state; + } + + /** + * Get the totalChangesApplied property: Total number of applied changes. + * + * @return the totalChangesApplied value. + */ + public Long totalChangesApplied() { + return this.totalChangesApplied; + } + + /** + * Get the dataErrorsCounter property: Number of data errors occurred. + * + * @return the dataErrorsCounter value. + */ + public Long dataErrorsCounter() { + return this.dataErrorsCounter; + } + + /** + * Get the lastModifiedTime property: Last modified time on target. + * + * @return the lastModifiedTime value. + */ + public OffsetDateTime lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskProperties.java new file mode 100644 index 000000000000..846785ee6dab --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbSyncTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that migrates on-prem SQL Server databases to Azure SQL Database for online migrations. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Migrate.SqlServer.AzureSqlDb.Sync") +@Fluent +public final class MigrateSqlServerSqlDbSyncTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbSyncTaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private MigrateSqlServerSqlDbSyncTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public MigrateSqlServerSqlDbSyncTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the MigrateSqlServerSqlDbSyncTaskProperties object itself. + */ + public MigrateSqlServerSqlDbSyncTaskProperties withInput(MigrateSqlServerSqlDbSyncTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public MigrateSqlServerSqlDbSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskInput.java new file mode 100644 index 000000000000..39ae8e48b517 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskInput.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.datamigration.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; + +/** Input for the task that migrates on-prem SQL Server databases to Azure SQL Database. */ +@Fluent +public final class MigrateSqlServerSqlDbTaskInput extends SqlMigrationTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbTaskInput.class); + + /* + * Databases to migrate + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /* + * Options for enabling various post migration validations. Available + * options, + * 1.) Data Integrity Check: Performs a checksum based comparison on source + * and target tables after the migration to ensure the correctness of the + * data. + * 2.) Schema Validation: Performs a thorough schema comparison between the + * source and target tables and provides a list of differences between the + * source and target database, 3.) Query Analysis: Executes a set of + * queries picked up automatically either from the Query Plan Cache or + * Query Store and execute them and compares the execution time between the + * source and target database. + */ + @JsonProperty(value = "validationOptions") + private MigrationValidationOptions validationOptions; + + /** + * Get the selectedDatabases property: Databases to migrate. + * + * @return the selectedDatabases value. + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set the selectedDatabases property: Databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set. + * @return the MigrateSqlServerSqlDbTaskInput object itself. + */ + public MigrateSqlServerSqlDbTaskInput withSelectedDatabases( + List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Get the validationOptions property: Options for enabling various post migration validations. Available options, + * 1.) Data Integrity Check: Performs a checksum based comparison on source and target tables after the migration to + * ensure the correctness of the data. 2.) Schema Validation: Performs a thorough schema comparison between the + * source and target tables and provides a list of differences between the source and target database, 3.) Query + * Analysis: Executes a set of queries picked up automatically either from the Query Plan Cache or Query Store and + * execute them and compares the execution time between the source and target database. + * + * @return the validationOptions value. + */ + public MigrationValidationOptions validationOptions() { + return this.validationOptions; + } + + /** + * Set the validationOptions property: Options for enabling various post migration validations. Available options, + * 1.) Data Integrity Check: Performs a checksum based comparison on source and target tables after the migration to + * ensure the correctness of the data. 2.) Schema Validation: Performs a thorough schema comparison between the + * source and target tables and provides a list of differences between the source and target database, 3.) Query + * Analysis: Executes a set of queries picked up automatically either from the Query Plan Cache or Query Store and + * execute them and compares the execution time between the source and target database. + * + * @param validationOptions the validationOptions value to set. + * @return the MigrateSqlServerSqlDbTaskInput object itself. + */ + public MigrateSqlServerSqlDbTaskInput withValidationOptions(MigrationValidationOptions validationOptions) { + this.validationOptions = validationOptions; + return this; + } + + /** {@inheritDoc} */ + @Override + public MigrateSqlServerSqlDbTaskInput withSourceConnectionInfo(SqlConnectionInfo sourceConnectionInfo) { + super.withSourceConnectionInfo(sourceConnectionInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public MigrateSqlServerSqlDbTaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + super.withTargetConnectionInfo(targetConnectionInfo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (selectedDatabases() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectedDatabases in model MigrateSqlServerSqlDbTaskInput")); + } else { + selectedDatabases().forEach(e -> e.validate()); + } + if (validationOptions() != null) { + validationOptions().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutput.java new file mode 100644 index 000000000000..3680a83f4593 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutput.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.datamigration.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 com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Output for the task that migrates on-prem SQL Server databases to Azure SQL Database. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "resultType", + defaultImpl = MigrateSqlServerSqlDbTaskOutput.class) +@JsonTypeName("MigrateSqlServerSqlDbTaskOutput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "MigrationLevelOutput", value = MigrateSqlServerSqlDbTaskOutputMigrationLevel.class), + @JsonSubTypes.Type(name = "DatabaseLevelOutput", value = MigrateSqlServerSqlDbTaskOutputDatabaseLevel.class), + @JsonSubTypes.Type(name = "TableLevelOutput", value = MigrateSqlServerSqlDbTaskOutputTableLevel.class), + @JsonSubTypes.Type(name = "ErrorOutput", value = MigrateSqlServerSqlDbTaskOutputError.class) +}) +@Immutable +public class MigrateSqlServerSqlDbTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbTaskOutput.class); + + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.java new file mode 100644 index 000000000000..91241075ce37 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputDatabaseLevel.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** The MigrateSqlServerSqlDbTaskOutputDatabaseLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelOutput") +@Immutable +public final class MigrateSqlServerSqlDbTaskOutputDatabaseLevel extends MigrateSqlServerSqlDbTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbTaskOutputDatabaseLevel.class); + + /* + * Name of the item + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Current state of migration + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /* + * Migration stage that this database is in + */ + @JsonProperty(value = "stage", access = JsonProperty.Access.WRITE_ONLY) + private DatabaseMigrationStage stage; + + /* + * Status message + */ + @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String statusMessage; + + /* + * Migration progress message + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * Number of objects + */ + @JsonProperty(value = "numberOfObjects", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfObjects; + + /* + * Number of successfully completed objects + */ + @JsonProperty(value = "numberOfObjectsCompleted", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfObjectsCompleted; + + /* + * Number of database/object errors. + */ + @JsonProperty(value = "errorCount", access = JsonProperty.Access.WRITE_ONLY) + private Long errorCount; + + /* + * Wildcard string prefix to use for querying all errors of the item + */ + @JsonProperty(value = "errorPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String errorPrefix; + + /* + * Wildcard string prefix to use for querying all sub-tem results of the + * item + */ + @JsonProperty(value = "resultPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String resultPrefix; + + /* + * Migration exceptions and warnings. + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /* + * Summary of object results in the migration + */ + @JsonProperty(value = "objectSummary", access = JsonProperty.Access.WRITE_ONLY) + private String objectSummary; + + /** + * Get the databaseName property: Name of the item. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the state property: Current state of migration. + * + * @return the state value. + */ + public MigrationState state() { + return this.state; + } + + /** + * Get the stage property: Migration stage that this database is in. + * + * @return the stage value. + */ + public DatabaseMigrationStage stage() { + return this.stage; + } + + /** + * Get the statusMessage property: Status message. + * + * @return the statusMessage value. + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Get the message property: Migration progress message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the numberOfObjects property: Number of objects. + * + * @return the numberOfObjects value. + */ + public Long numberOfObjects() { + return this.numberOfObjects; + } + + /** + * Get the numberOfObjectsCompleted property: Number of successfully completed objects. + * + * @return the numberOfObjectsCompleted value. + */ + public Long numberOfObjectsCompleted() { + return this.numberOfObjectsCompleted; + } + + /** + * Get the errorCount property: Number of database/object errors. + * + * @return the errorCount value. + */ + public Long errorCount() { + return this.errorCount; + } + + /** + * Get the errorPrefix property: Wildcard string prefix to use for querying all errors of the item. + * + * @return the errorPrefix value. + */ + public String errorPrefix() { + return this.errorPrefix; + } + + /** + * Get the resultPrefix property: Wildcard string prefix to use for querying all sub-tem results of the item. + * + * @return the resultPrefix value. + */ + public String resultPrefix() { + return this.resultPrefix; + } + + /** + * Get the exceptionsAndWarnings property: Migration exceptions and warnings. + * + * @return the exceptionsAndWarnings value. + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + + /** + * Get the objectSummary property: Summary of object results in the migration. + * + * @return the objectSummary value. + */ + public String objectSummary() { + return this.objectSummary; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (exceptionsAndWarnings() != null) { + exceptionsAndWarnings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputError.java new file mode 100644 index 000000000000..98048bbdabea --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputError.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The MigrateSqlServerSqlDbTaskOutputError model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("ErrorOutput") +@Immutable +public final class MigrateSqlServerSqlDbTaskOutputError extends MigrateSqlServerSqlDbTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbTaskOutputError.class); + + /* + * Migration error + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ReportableException error; + + /** + * Get the error property: Migration error. + * + * @return the error value. + */ + public ReportableException error() { + return this.error; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputMigrationLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputMigrationLevel.java new file mode 100644 index 000000000000..47fca6acfeb8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputMigrationLevel.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** The MigrateSqlServerSqlDbTaskOutputMigrationLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrationLevelOutput") +@Fluent +public final class MigrateSqlServerSqlDbTaskOutputMigrationLevel extends MigrateSqlServerSqlDbTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbTaskOutputMigrationLevel.class); + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Duration of task execution in seconds. + */ + @JsonProperty(value = "durationInSeconds", access = JsonProperty.Access.WRITE_ONLY) + private Long durationInSeconds; + + /* + * Current status of migration + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private MigrationStatus status; + + /* + * Migration status message + */ + @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String statusMessage; + + /* + * Migration progress message + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * Selected databases as a map from database name to database id + */ + @JsonProperty(value = "databases", access = JsonProperty.Access.WRITE_ONLY) + private String databases; + + /* + * Summary of database results in the migration + */ + @JsonProperty(value = "databaseSummary", access = JsonProperty.Access.WRITE_ONLY) + private String databaseSummary; + + /* + * Migration Validation Results + */ + @JsonProperty(value = "migrationValidationResult") + private MigrationValidationResult migrationValidationResult; + + /* + * Migration Report Result, provides unique url for downloading your + * migration report. + */ + @JsonProperty(value = "migrationReportResult") + private MigrationReportResult migrationReportResult; + + /* + * Source server version + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /* + * Source server brand version + */ + @JsonProperty(value = "sourceServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerBrandVersion; + + /* + * Target server version + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /* + * Target server brand version + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /* + * Migration exceptions and warnings. + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the durationInSeconds property: Duration of task execution in seconds. + * + * @return the durationInSeconds value. + */ + public Long durationInSeconds() { + return this.durationInSeconds; + } + + /** + * Get the status property: Current status of migration. + * + * @return the status value. + */ + public MigrationStatus status() { + return this.status; + } + + /** + * Get the statusMessage property: Migration status message. + * + * @return the statusMessage value. + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Get the message property: Migration progress message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the databases property: Selected databases as a map from database name to database id. + * + * @return the databases value. + */ + public String databases() { + return this.databases; + } + + /** + * Get the databaseSummary property: Summary of database results in the migration. + * + * @return the databaseSummary value. + */ + public String databaseSummary() { + return this.databaseSummary; + } + + /** + * Get the migrationValidationResult property: Migration Validation Results. + * + * @return the migrationValidationResult value. + */ + public MigrationValidationResult migrationValidationResult() { + return this.migrationValidationResult; + } + + /** + * Set the migrationValidationResult property: Migration Validation Results. + * + * @param migrationValidationResult the migrationValidationResult value to set. + * @return the MigrateSqlServerSqlDbTaskOutputMigrationLevel object itself. + */ + public MigrateSqlServerSqlDbTaskOutputMigrationLevel withMigrationValidationResult( + MigrationValidationResult migrationValidationResult) { + this.migrationValidationResult = migrationValidationResult; + return this; + } + + /** + * Get the migrationReportResult property: Migration Report Result, provides unique url for downloading your + * migration report. + * + * @return the migrationReportResult value. + */ + public MigrationReportResult migrationReportResult() { + return this.migrationReportResult; + } + + /** + * Set the migrationReportResult property: Migration Report Result, provides unique url for downloading your + * migration report. + * + * @param migrationReportResult the migrationReportResult value to set. + * @return the MigrateSqlServerSqlDbTaskOutputMigrationLevel object itself. + */ + public MigrateSqlServerSqlDbTaskOutputMigrationLevel withMigrationReportResult( + MigrationReportResult migrationReportResult) { + this.migrationReportResult = migrationReportResult; + return this; + } + + /** + * Get the sourceServerVersion property: Source server version. + * + * @return the sourceServerVersion value. + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get the sourceServerBrandVersion property: Source server brand version. + * + * @return the sourceServerBrandVersion value. + */ + public String sourceServerBrandVersion() { + return this.sourceServerBrandVersion; + } + + /** + * Get the targetServerVersion property: Target server version. + * + * @return the targetServerVersion value. + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get the targetServerBrandVersion property: Target server brand version. + * + * @return the targetServerBrandVersion value. + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + + /** + * Get the exceptionsAndWarnings property: Migration exceptions and warnings. + * + * @return the exceptionsAndWarnings value. + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (migrationValidationResult() != null) { + migrationValidationResult().validate(); + } + if (migrationReportResult() != null) { + migrationReportResult().validate(); + } + if (exceptionsAndWarnings() != null) { + exceptionsAndWarnings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputTableLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputTableLevel.java new file mode 100644 index 000000000000..f0717201df2e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskOutputTableLevel.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** The MigrateSqlServerSqlDbTaskOutputTableLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("TableLevelOutput") +@Immutable +public final class MigrateSqlServerSqlDbTaskOutputTableLevel extends MigrateSqlServerSqlDbTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbTaskOutputTableLevel.class); + + /* + * Name of the item + */ + @JsonProperty(value = "objectName", access = JsonProperty.Access.WRITE_ONLY) + private String objectName; + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Current state of migration + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /* + * Status message + */ + @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String statusMessage; + + /* + * Number of items + */ + @JsonProperty(value = "itemsCount", access = JsonProperty.Access.WRITE_ONLY) + private Long itemsCount; + + /* + * Number of successfully completed items + */ + @JsonProperty(value = "itemsCompletedCount", access = JsonProperty.Access.WRITE_ONLY) + private Long itemsCompletedCount; + + /* + * Wildcard string prefix to use for querying all errors of the item + */ + @JsonProperty(value = "errorPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String errorPrefix; + + /* + * Wildcard string prefix to use for querying all sub-tem results of the + * item + */ + @JsonProperty(value = "resultPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String resultPrefix; + + /** + * Get the objectName property: Name of the item. + * + * @return the objectName value. + */ + public String objectName() { + return this.objectName; + } + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the state property: Current state of migration. + * + * @return the state value. + */ + public MigrationState state() { + return this.state; + } + + /** + * Get the statusMessage property: Status message. + * + * @return the statusMessage value. + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Get the itemsCount property: Number of items. + * + * @return the itemsCount value. + */ + public Long itemsCount() { + return this.itemsCount; + } + + /** + * Get the itemsCompletedCount property: Number of successfully completed items. + * + * @return the itemsCompletedCount value. + */ + public Long itemsCompletedCount() { + return this.itemsCompletedCount; + } + + /** + * Get the errorPrefix property: Wildcard string prefix to use for querying all errors of the item. + * + * @return the errorPrefix value. + */ + public String errorPrefix() { + return this.errorPrefix; + } + + /** + * Get the resultPrefix property: Wildcard string prefix to use for querying all sub-tem results of the item. + * + * @return the resultPrefix value. + */ + public String resultPrefix() { + return this.resultPrefix; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskProperties.java new file mode 100644 index 000000000000..f6ea33c7226e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlDbTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that migrates on-prem SQL Server databases to Azure SQL Database. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Migrate.SqlServer.SqlDb") +@Fluent +public final class MigrateSqlServerSqlDbTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlDbTaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private MigrateSqlServerSqlDbTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public MigrateSqlServerSqlDbTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the MigrateSqlServerSqlDbTaskProperties object itself. + */ + public MigrateSqlServerSqlDbTaskProperties withInput(MigrateSqlServerSqlDbTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public MigrateSqlServerSqlDbTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMIDatabaseInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMIDatabaseInput.java new file mode 100644 index 000000000000..f4e3bfb02f0c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMIDatabaseInput.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.datamigration.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; + +/** Database specific information for SQL to Azure SQL DB Managed Instance migration task inputs. */ +@Fluent +public final class MigrateSqlServerSqlMIDatabaseInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMIDatabaseInput.class); + + /* + * Name of the database + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Name of the database at destination + */ + @JsonProperty(value = "restoreDatabaseName", required = true) + private String restoreDatabaseName; + + /* + * Backup file share information for backing up this database. + */ + @JsonProperty(value = "backupFileShare") + private FileShare backupFileShare; + + /* + * The list of backup files to be used in case of existing backups. + */ + @JsonProperty(value = "backupFilePaths") + private List backupFilePaths; + + /** + * Get the name property: Name of the database. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the database. + * + * @param name the name value to set. + * @return the MigrateSqlServerSqlMIDatabaseInput object itself. + */ + public MigrateSqlServerSqlMIDatabaseInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get the restoreDatabaseName property: Name of the database at destination. + * + * @return the restoreDatabaseName value. + */ + public String restoreDatabaseName() { + return this.restoreDatabaseName; + } + + /** + * Set the restoreDatabaseName property: Name of the database at destination. + * + * @param restoreDatabaseName the restoreDatabaseName value to set. + * @return the MigrateSqlServerSqlMIDatabaseInput object itself. + */ + public MigrateSqlServerSqlMIDatabaseInput withRestoreDatabaseName(String restoreDatabaseName) { + this.restoreDatabaseName = restoreDatabaseName; + return this; + } + + /** + * Get the backupFileShare property: Backup file share information for backing up this database. + * + * @return the backupFileShare value. + */ + public FileShare backupFileShare() { + return this.backupFileShare; + } + + /** + * Set the backupFileShare property: Backup file share information for backing up this database. + * + * @param backupFileShare the backupFileShare value to set. + * @return the MigrateSqlServerSqlMIDatabaseInput object itself. + */ + public MigrateSqlServerSqlMIDatabaseInput withBackupFileShare(FileShare backupFileShare) { + this.backupFileShare = backupFileShare; + return this; + } + + /** + * Get the backupFilePaths property: The list of backup files to be used in case of existing backups. + * + * @return the backupFilePaths value. + */ + public List backupFilePaths() { + return this.backupFilePaths; + } + + /** + * Set the backupFilePaths property: The list of backup files to be used in case of existing backups. + * + * @param backupFilePaths the backupFilePaths value to set. + * @return the MigrateSqlServerSqlMIDatabaseInput object itself. + */ + public MigrateSqlServerSqlMIDatabaseInput withBackupFilePaths(List backupFilePaths) { + this.backupFilePaths = backupFilePaths; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model MigrateSqlServerSqlMIDatabaseInput")); + } + if (restoreDatabaseName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property restoreDatabaseName in model MigrateSqlServerSqlMIDatabaseInput")); + } + if (backupFileShare() != null) { + backupFileShare().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskInput.java new file mode 100644 index 000000000000..1dc136339c64 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskInput.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.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. */ +@Immutable +public final class MigrateSqlServerSqlMISyncTaskInput extends SqlServerSqlMISyncTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMISyncTaskInput.class); + + /** {@inheritDoc} */ + @Override + public MigrateSqlServerSqlMISyncTaskInput withSelectedDatabases( + List selectedDatabases) { + super.withSelectedDatabases(selectedDatabases); + return this; + } + + /** {@inheritDoc} */ + @Override + public MigrateSqlServerSqlMISyncTaskInput withBackupFileShare(FileShare backupFileShare) { + super.withBackupFileShare(backupFileShare); + return this; + } + + /** {@inheritDoc} */ + @Override + public MigrateSqlServerSqlMISyncTaskInput withStorageResourceId(String storageResourceId) { + super.withStorageResourceId(storageResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public MigrateSqlServerSqlMISyncTaskInput withSourceConnectionInfo(SqlConnectionInfo sourceConnectionInfo) { + super.withSourceConnectionInfo(sourceConnectionInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public MigrateSqlServerSqlMISyncTaskInput withTargetConnectionInfo(MiSqlConnectionInfo targetConnectionInfo) { + super.withTargetConnectionInfo(targetConnectionInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public MigrateSqlServerSqlMISyncTaskInput withAzureApp(AzureActiveDirectoryApp azureApp) { + super.withAzureApp(azureApp); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutput.java new file mode 100644 index 000000000000..137cbc8c1c9b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutput.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.datamigration.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 com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Output for task that migrates SQL Server databases to Azure SQL Database Managed Instance using Log Replay Service. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "resultType", + defaultImpl = MigrateSqlServerSqlMISyncTaskOutput.class) +@JsonTypeName("MigrateSqlServerSqlMISyncTaskOutput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "MigrationLevelOutput", value = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel.class), + @JsonSubTypes.Type(name = "DatabaseLevelOutput", value = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel.class), + @JsonSubTypes.Type(name = "ErrorOutput", value = MigrateSqlServerSqlMISyncTaskOutputError.class) +}) +@Immutable +public class MigrateSqlServerSqlMISyncTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMISyncTaskOutput.class); + + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel.java new file mode 100644 index 000000000000..76aff2adacc6 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** The MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelOutput") +@Immutable +public final class MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel extends MigrateSqlServerSqlMISyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel.class); + + /* + * Name of the database + */ + @JsonProperty(value = "sourceDatabaseName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceDatabaseName; + + /* + * Current state of database + */ + @JsonProperty(value = "migrationState", access = JsonProperty.Access.WRITE_ONLY) + private DatabaseMigrationState migrationState; + + /* + * Database migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Database migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Details of full backup set + */ + @JsonProperty(value = "fullBackupSetInfo", access = JsonProperty.Access.WRITE_ONLY) + private BackupSetInfo fullBackupSetInfo; + + /* + * Last applied backup set information + */ + @JsonProperty(value = "lastRestoredBackupSetInfo", access = JsonProperty.Access.WRITE_ONLY) + private BackupSetInfo lastRestoredBackupSetInfo; + + /* + * Backup sets that are currently active (Either being uploaded or getting + * restored) + */ + @JsonProperty(value = "activeBackupSets", access = JsonProperty.Access.WRITE_ONLY) + private List activeBackupSets; + + /* + * Name of container created in the Azure Storage account where backups are + * copied to + */ + @JsonProperty(value = "containerName", access = JsonProperty.Access.WRITE_ONLY) + private String containerName; + + /* + * prefix string to use for querying errors for this database + */ + @JsonProperty(value = "errorPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String errorPrefix; + + /* + * Whether full backup has been applied to the target database or not + */ + @JsonProperty(value = "isFullBackupRestored", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isFullBackupRestored; + + /* + * Migration exceptions and warnings + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /** + * Get the sourceDatabaseName property: Name of the database. + * + * @return the sourceDatabaseName value. + */ + public String sourceDatabaseName() { + return this.sourceDatabaseName; + } + + /** + * Get the migrationState property: Current state of database. + * + * @return the migrationState value. + */ + public DatabaseMigrationState migrationState() { + return this.migrationState; + } + + /** + * Get the startedOn property: Database migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Database migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the fullBackupSetInfo property: Details of full backup set. + * + * @return the fullBackupSetInfo value. + */ + public BackupSetInfo fullBackupSetInfo() { + return this.fullBackupSetInfo; + } + + /** + * Get the lastRestoredBackupSetInfo property: Last applied backup set information. + * + * @return the lastRestoredBackupSetInfo value. + */ + public BackupSetInfo lastRestoredBackupSetInfo() { + return this.lastRestoredBackupSetInfo; + } + + /** + * Get the activeBackupSets property: Backup sets that are currently active (Either being uploaded or getting + * restored). + * + * @return the activeBackupSets value. + */ + public List activeBackupSets() { + return this.activeBackupSets; + } + + /** + * Get the containerName property: Name of container created in the Azure Storage account where backups are copied + * to. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Get the errorPrefix property: prefix string to use for querying errors for this database. + * + * @return the errorPrefix value. + */ + public String errorPrefix() { + return this.errorPrefix; + } + + /** + * Get the isFullBackupRestored property: Whether full backup has been applied to the target database or not. + * + * @return the isFullBackupRestored value. + */ + public Boolean isFullBackupRestored() { + return this.isFullBackupRestored; + } + + /** + * Get the exceptionsAndWarnings property: Migration exceptions and warnings. + * + * @return the exceptionsAndWarnings value. + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (fullBackupSetInfo() != null) { + fullBackupSetInfo().validate(); + } + if (lastRestoredBackupSetInfo() != null) { + lastRestoredBackupSetInfo().validate(); + } + if (activeBackupSets() != null) { + activeBackupSets().forEach(e -> e.validate()); + } + if (exceptionsAndWarnings() != null) { + exceptionsAndWarnings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutputError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutputError.java new file mode 100644 index 000000000000..a239e5eaaba1 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutputError.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The MigrateSqlServerSqlMISyncTaskOutputError model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("ErrorOutput") +@Immutable +public final class MigrateSqlServerSqlMISyncTaskOutputError extends MigrateSqlServerSqlMISyncTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMISyncTaskOutputError.class); + + /* + * Migration error + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ReportableException error; + + /** + * Get the error property: Migration error. + * + * @return the error value. + */ + public ReportableException error() { + return this.error; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutputMigrationLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutputMigrationLevel.java new file mode 100644 index 000000000000..282c621db73c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskOutputMigrationLevel.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** The MigrateSqlServerSqlMISyncTaskOutputMigrationLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrationLevelOutput") +@Immutable +public final class MigrateSqlServerSqlMISyncTaskOutputMigrationLevel extends MigrateSqlServerSqlMISyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMISyncTaskOutputMigrationLevel.class); + + /* + * Count of databases + */ + @JsonProperty(value = "databaseCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer databaseCount; + + /* + * Current state of migration + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Source server name + */ + @JsonProperty(value = "sourceServerName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerName; + + /* + * Source server version + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /* + * Source server brand version + */ + @JsonProperty(value = "sourceServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerBrandVersion; + + /* + * Target server name + */ + @JsonProperty(value = "targetServerName", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerName; + + /* + * Target server version + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /* + * Target server brand version + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /* + * Number of database level errors + */ + @JsonProperty(value = "databaseErrorCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer databaseErrorCount; + + /** + * Get the databaseCount property: Count of databases. + * + * @return the databaseCount value. + */ + public Integer databaseCount() { + return this.databaseCount; + } + + /** + * Get the state property: Current state of migration. + * + * @return the state value. + */ + public MigrationState state() { + return this.state; + } + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the sourceServerName property: Source server name. + * + * @return the sourceServerName value. + */ + public String sourceServerName() { + return this.sourceServerName; + } + + /** + * Get the sourceServerVersion property: Source server version. + * + * @return the sourceServerVersion value. + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get the sourceServerBrandVersion property: Source server brand version. + * + * @return the sourceServerBrandVersion value. + */ + public String sourceServerBrandVersion() { + return this.sourceServerBrandVersion; + } + + /** + * Get the targetServerName property: Target server name. + * + * @return the targetServerName value. + */ + public String targetServerName() { + return this.targetServerName; + } + + /** + * Get the targetServerVersion property: Target server version. + * + * @return the targetServerVersion value. + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get the targetServerBrandVersion property: Target server brand version. + * + * @return the targetServerBrandVersion value. + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + + /** + * Get the databaseErrorCount property: Number of database level errors. + * + * @return the databaseErrorCount value. + */ + public Integer databaseErrorCount() { + return this.databaseErrorCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskProperties.java new file mode 100644 index 000000000000..96236ec60497 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMISyncTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for task that migrates SQL Server databases to Azure SQL Database Managed Instance sync scenario. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Migrate.SqlServer.AzureSqlDbMI.Sync.LRS") +@Fluent +public final class MigrateSqlServerSqlMISyncTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMISyncTaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private MigrateSqlServerSqlMISyncTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public MigrateSqlServerSqlMISyncTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the MigrateSqlServerSqlMISyncTaskProperties object itself. + */ + public MigrateSqlServerSqlMISyncTaskProperties withInput(MigrateSqlServerSqlMISyncTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public MigrateSqlServerSqlMISyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskInput.java new file mode 100644 index 000000000000..e7e1c4f01e45 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskInput.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.datamigration.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; + +/** Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance. */ +@Fluent +public final class MigrateSqlServerSqlMITaskInput extends SqlMigrationTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMITaskInput.class); + + /* + * Databases to migrate + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /* + * Logins to migrate. + */ + @JsonProperty(value = "selectedLogins") + private List selectedLogins; + + /* + * Agent Jobs to migrate. + */ + @JsonProperty(value = "selectedAgentJobs") + private List selectedAgentJobs; + + /* + * Backup file share information for all selected databases. + */ + @JsonProperty(value = "backupFileShare") + private FileShare backupFileShare; + + /* + * SAS URI of Azure Storage Account Container to be used for storing backup + * files. + */ + @JsonProperty(value = "backupBlobShare", required = true) + private BlobShare backupBlobShare; + + /* + * Backup Mode to specify whether to use existing backup or create new + * backup. If using existing backups, backup file paths are required to be + * provided in selectedDatabases. + */ + @JsonProperty(value = "backupMode") + private BackupMode backupMode; + + /* + * Azure Active Directory domain name in the format of 'contoso.com' for + * federated Azure AD or 'contoso.onmicrosoft.com' for managed domain, + * required if and only if Windows logins are selected + */ + @JsonProperty(value = "aadDomainName") + private String aadDomainName; + + /** + * Get the selectedDatabases property: Databases to migrate. + * + * @return the selectedDatabases value. + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set the selectedDatabases property: Databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set. + * @return the MigrateSqlServerSqlMITaskInput object itself. + */ + public MigrateSqlServerSqlMITaskInput withSelectedDatabases( + List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Get the selectedLogins property: Logins to migrate. + * + * @return the selectedLogins value. + */ + public List selectedLogins() { + return this.selectedLogins; + } + + /** + * Set the selectedLogins property: Logins to migrate. + * + * @param selectedLogins the selectedLogins value to set. + * @return the MigrateSqlServerSqlMITaskInput object itself. + */ + public MigrateSqlServerSqlMITaskInput withSelectedLogins(List selectedLogins) { + this.selectedLogins = selectedLogins; + return this; + } + + /** + * Get the selectedAgentJobs property: Agent Jobs to migrate. + * + * @return the selectedAgentJobs value. + */ + public List selectedAgentJobs() { + return this.selectedAgentJobs; + } + + /** + * Set the selectedAgentJobs property: Agent Jobs to migrate. + * + * @param selectedAgentJobs the selectedAgentJobs value to set. + * @return the MigrateSqlServerSqlMITaskInput object itself. + */ + public MigrateSqlServerSqlMITaskInput withSelectedAgentJobs(List selectedAgentJobs) { + this.selectedAgentJobs = selectedAgentJobs; + return this; + } + + /** + * Get the backupFileShare property: Backup file share information for all selected databases. + * + * @return the backupFileShare value. + */ + public FileShare backupFileShare() { + return this.backupFileShare; + } + + /** + * Set the backupFileShare property: Backup file share information for all selected databases. + * + * @param backupFileShare the backupFileShare value to set. + * @return the MigrateSqlServerSqlMITaskInput object itself. + */ + public MigrateSqlServerSqlMITaskInput withBackupFileShare(FileShare backupFileShare) { + this.backupFileShare = backupFileShare; + return this; + } + + /** + * Get the backupBlobShare property: SAS URI of Azure Storage Account Container to be used for storing backup files. + * + * @return the backupBlobShare value. + */ + public BlobShare backupBlobShare() { + return this.backupBlobShare; + } + + /** + * Set the backupBlobShare property: SAS URI of Azure Storage Account Container to be used for storing backup files. + * + * @param backupBlobShare the backupBlobShare value to set. + * @return the MigrateSqlServerSqlMITaskInput object itself. + */ + public MigrateSqlServerSqlMITaskInput withBackupBlobShare(BlobShare backupBlobShare) { + this.backupBlobShare = backupBlobShare; + return this; + } + + /** + * Get the backupMode property: Backup Mode to specify whether to use existing backup or create new backup. If using + * existing backups, backup file paths are required to be provided in selectedDatabases. + * + * @return the backupMode value. + */ + public BackupMode backupMode() { + return this.backupMode; + } + + /** + * Set the backupMode property: Backup Mode to specify whether to use existing backup or create new backup. If using + * existing backups, backup file paths are required to be provided in selectedDatabases. + * + * @param backupMode the backupMode value to set. + * @return the MigrateSqlServerSqlMITaskInput object itself. + */ + public MigrateSqlServerSqlMITaskInput withBackupMode(BackupMode backupMode) { + this.backupMode = backupMode; + return this; + } + + /** + * Get the aadDomainName property: Azure Active Directory domain name in the format of 'contoso.com' for federated + * Azure AD or 'contoso.onmicrosoft.com' for managed domain, required if and only if Windows logins are selected. + * + * @return the aadDomainName value. + */ + public String aadDomainName() { + return this.aadDomainName; + } + + /** + * Set the aadDomainName property: Azure Active Directory domain name in the format of 'contoso.com' for federated + * Azure AD or 'contoso.onmicrosoft.com' for managed domain, required if and only if Windows logins are selected. + * + * @param aadDomainName the aadDomainName value to set. + * @return the MigrateSqlServerSqlMITaskInput object itself. + */ + public MigrateSqlServerSqlMITaskInput withAadDomainName(String aadDomainName) { + this.aadDomainName = aadDomainName; + return this; + } + + /** {@inheritDoc} */ + @Override + public MigrateSqlServerSqlMITaskInput withSourceConnectionInfo(SqlConnectionInfo sourceConnectionInfo) { + super.withSourceConnectionInfo(sourceConnectionInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public MigrateSqlServerSqlMITaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + super.withTargetConnectionInfo(targetConnectionInfo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (selectedDatabases() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectedDatabases in model MigrateSqlServerSqlMITaskInput")); + } else { + selectedDatabases().forEach(e -> e.validate()); + } + if (backupFileShare() != null) { + backupFileShare().validate(); + } + if (backupBlobShare() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property backupBlobShare in model MigrateSqlServerSqlMITaskInput")); + } else { + backupBlobShare().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutput.java new file mode 100644 index 000000000000..c5197a96833c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutput.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.datamigration.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 com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Output for task that migrates SQL Server databases to Azure SQL Database Managed Instance. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "resultType", + defaultImpl = MigrateSqlServerSqlMITaskOutput.class) +@JsonTypeName("MigrateSqlServerSqlMITaskOutput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "MigrationLevelOutput", value = MigrateSqlServerSqlMITaskOutputMigrationLevel.class), + @JsonSubTypes.Type(name = "DatabaseLevelOutput", value = MigrateSqlServerSqlMITaskOutputDatabaseLevel.class), + @JsonSubTypes.Type(name = "AgentJobLevelOutput", value = MigrateSqlServerSqlMITaskOutputAgentJobLevel.class), + @JsonSubTypes.Type(name = "LoginLevelOutput", value = MigrateSqlServerSqlMITaskOutputLoginLevel.class), + @JsonSubTypes.Type(name = "ErrorOutput", value = MigrateSqlServerSqlMITaskOutputError.class) +}) +@Immutable +public class MigrateSqlServerSqlMITaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMITaskOutput.class); + + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputAgentJobLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputAgentJobLevel.java new file mode 100644 index 000000000000..e2a4edb1053a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputAgentJobLevel.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** The MigrateSqlServerSqlMITaskOutputAgentJobLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("AgentJobLevelOutput") +@Immutable +public final class MigrateSqlServerSqlMITaskOutputAgentJobLevel extends MigrateSqlServerSqlMITaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMITaskOutputAgentJobLevel.class); + + /* + * Agent Job name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The state of the original Agent Job. + */ + @JsonProperty(value = "isEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isEnabled; + + /* + * Current state of migration + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Migration progress message + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * Migration errors and warnings per job + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /** + * Get the name property: Agent Job name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isEnabled property: The state of the original Agent Job. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Get the state property: Current state of migration. + * + * @return the state value. + */ + public MigrationState state() { + return this.state; + } + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the message property: Migration progress message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the exceptionsAndWarnings property: Migration errors and warnings per job. + * + * @return the exceptionsAndWarnings value. + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (exceptionsAndWarnings() != null) { + exceptionsAndWarnings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputDatabaseLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputDatabaseLevel.java new file mode 100644 index 000000000000..bfd652a8df96 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputDatabaseLevel.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** The MigrateSqlServerSqlMITaskOutputDatabaseLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("DatabaseLevelOutput") +@Immutable +public final class MigrateSqlServerSqlMITaskOutputDatabaseLevel extends MigrateSqlServerSqlMITaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMITaskOutputDatabaseLevel.class); + + /* + * Name of the database + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /* + * Size of the database in megabytes + */ + @JsonProperty(value = "sizeMB", access = JsonProperty.Access.WRITE_ONLY) + private Double sizeMB; + + /* + * Current state of migration + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /* + * Current stage of migration + */ + @JsonProperty(value = "stage", access = JsonProperty.Access.WRITE_ONLY) + private DatabaseMigrationStage stage; + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Migration progress message + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * Migration exceptions and warnings + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /** + * Get the databaseName property: Name of the database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get the sizeMB property: Size of the database in megabytes. + * + * @return the sizeMB value. + */ + public Double sizeMB() { + return this.sizeMB; + } + + /** + * Get the state property: Current state of migration. + * + * @return the state value. + */ + public MigrationState state() { + return this.state; + } + + /** + * Get the stage property: Current stage of migration. + * + * @return the stage value. + */ + public DatabaseMigrationStage stage() { + return this.stage; + } + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the message property: Migration progress message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the exceptionsAndWarnings property: Migration exceptions and warnings. + * + * @return the exceptionsAndWarnings value. + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (exceptionsAndWarnings() != null) { + exceptionsAndWarnings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputError.java new file mode 100644 index 000000000000..eab59bdb35a4 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputError.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The MigrateSqlServerSqlMITaskOutputError model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("ErrorOutput") +@Immutable +public final class MigrateSqlServerSqlMITaskOutputError extends MigrateSqlServerSqlMITaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMITaskOutputError.class); + + /* + * Migration error + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ReportableException error; + + /** + * Get the error property: Migration error. + * + * @return the error value. + */ + public ReportableException error() { + return this.error; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputLoginLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputLoginLevel.java new file mode 100644 index 000000000000..ef4f55405c3b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputLoginLevel.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** The MigrateSqlServerSqlMITaskOutputLoginLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("LoginLevelOutput") +@Immutable +public final class MigrateSqlServerSqlMITaskOutputLoginLevel extends MigrateSqlServerSqlMITaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMITaskOutputLoginLevel.class); + + /* + * Login name. + */ + @JsonProperty(value = "loginName", access = JsonProperty.Access.WRITE_ONLY) + private String loginName; + + /* + * Current state of login + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /* + * Current stage of login + */ + @JsonProperty(value = "stage", access = JsonProperty.Access.WRITE_ONLY) + private LoginMigrationStage stage; + + /* + * Login migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Login migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Login migration progress message + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * Login migration errors and warnings per login + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /** + * Get the loginName property: Login name. + * + * @return the loginName value. + */ + public String loginName() { + return this.loginName; + } + + /** + * Get the state property: Current state of login. + * + * @return the state value. + */ + public MigrationState state() { + return this.state; + } + + /** + * Get the stage property: Current stage of login. + * + * @return the stage value. + */ + public LoginMigrationStage stage() { + return this.stage; + } + + /** + * Get the startedOn property: Login migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Login migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the message property: Login migration progress message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the exceptionsAndWarnings property: Login migration errors and warnings per login. + * + * @return the exceptionsAndWarnings value. + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (exceptionsAndWarnings() != null) { + exceptionsAndWarnings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputMigrationLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputMigrationLevel.java new file mode 100644 index 000000000000..34b77e48316c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskOutputMigrationLevel.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** The MigrateSqlServerSqlMITaskOutputMigrationLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrationLevelOutput") +@Immutable +public final class MigrateSqlServerSqlMITaskOutputMigrationLevel extends MigrateSqlServerSqlMITaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMITaskOutputMigrationLevel.class); + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Current status of migration + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private MigrationStatus status; + + /* + * Current state of migration + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /* + * Selected agent jobs as a map from name to id + */ + @JsonProperty(value = "agentJobs", access = JsonProperty.Access.WRITE_ONLY) + private String agentJobs; + + /* + * Selected logins as a map from name to id + */ + @JsonProperty(value = "logins", access = JsonProperty.Access.WRITE_ONLY) + private String logins; + + /* + * Migration progress message + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * Map of server role migration results. + */ + @JsonProperty(value = "serverRoleResults", access = JsonProperty.Access.WRITE_ONLY) + private String serverRoleResults; + + /* + * List of orphaned users. + */ + @JsonProperty(value = "orphanedUsersInfo", access = JsonProperty.Access.WRITE_ONLY) + private List orphanedUsersInfo; + + /* + * Selected databases as a map from database name to database id + */ + @JsonProperty(value = "databases", access = JsonProperty.Access.WRITE_ONLY) + private String databases; + + /* + * Source server version + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /* + * Source server brand version + */ + @JsonProperty(value = "sourceServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerBrandVersion; + + /* + * Target server version + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /* + * Target server brand version + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /* + * Migration exceptions and warnings. + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the status property: Current status of migration. + * + * @return the status value. + */ + public MigrationStatus status() { + return this.status; + } + + /** + * Get the state property: Current state of migration. + * + * @return the state value. + */ + public MigrationState state() { + return this.state; + } + + /** + * Get the agentJobs property: Selected agent jobs as a map from name to id. + * + * @return the agentJobs value. + */ + public String agentJobs() { + return this.agentJobs; + } + + /** + * Get the logins property: Selected logins as a map from name to id. + * + * @return the logins value. + */ + public String logins() { + return this.logins; + } + + /** + * Get the message property: Migration progress message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the serverRoleResults property: Map of server role migration results. + * + * @return the serverRoleResults value. + */ + public String serverRoleResults() { + return this.serverRoleResults; + } + + /** + * Get the orphanedUsersInfo property: List of orphaned users. + * + * @return the orphanedUsersInfo value. + */ + public List orphanedUsersInfo() { + return this.orphanedUsersInfo; + } + + /** + * Get the databases property: Selected databases as a map from database name to database id. + * + * @return the databases value. + */ + public String databases() { + return this.databases; + } + + /** + * Get the sourceServerVersion property: Source server version. + * + * @return the sourceServerVersion value. + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get the sourceServerBrandVersion property: Source server brand version. + * + * @return the sourceServerBrandVersion value. + */ + public String sourceServerBrandVersion() { + return this.sourceServerBrandVersion; + } + + /** + * Get the targetServerVersion property: Target server version. + * + * @return the targetServerVersion value. + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get the targetServerBrandVersion property: Target server brand version. + * + * @return the targetServerBrandVersion value. + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + + /** + * Get the exceptionsAndWarnings property: Migration exceptions and warnings. + * + * @return the exceptionsAndWarnings value. + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (orphanedUsersInfo() != null) { + orphanedUsersInfo().forEach(e -> e.validate()); + } + if (exceptionsAndWarnings() != null) { + exceptionsAndWarnings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskProperties.java new file mode 100644 index 000000000000..c89634d699ce --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSqlServerSqlMITaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for task that migrates SQL Server databases to Azure SQL Database Managed Instance. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Migrate.SqlServer.AzureSqlDbMI") +@Fluent +public final class MigrateSqlServerSqlMITaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSqlServerSqlMITaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private MigrateSqlServerSqlMITaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public MigrateSqlServerSqlMITaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the MigrateSqlServerSqlMITaskProperties object itself. + */ + public MigrateSqlServerSqlMITaskProperties withInput(MigrateSqlServerSqlMITaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public MigrateSqlServerSqlMITaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskInput.java new file mode 100644 index 000000000000..ce1e9fdba6c6 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskInput.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Input for task that migrates SSIS packages from SQL Server to Azure SQL Database Managed Instance. */ +@Fluent +public final class MigrateSsisTaskInput extends SqlMigrationTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSsisTaskInput.class); + + /* + * SSIS package migration information. + */ + @JsonProperty(value = "ssisMigrationInfo", required = true) + private SsisMigrationInfo ssisMigrationInfo; + + /** + * Get the ssisMigrationInfo property: SSIS package migration information. + * + * @return the ssisMigrationInfo value. + */ + public SsisMigrationInfo ssisMigrationInfo() { + return this.ssisMigrationInfo; + } + + /** + * Set the ssisMigrationInfo property: SSIS package migration information. + * + * @param ssisMigrationInfo the ssisMigrationInfo value to set. + * @return the MigrateSsisTaskInput object itself. + */ + public MigrateSsisTaskInput withSsisMigrationInfo(SsisMigrationInfo ssisMigrationInfo) { + this.ssisMigrationInfo = ssisMigrationInfo; + return this; + } + + /** {@inheritDoc} */ + @Override + public MigrateSsisTaskInput withSourceConnectionInfo(SqlConnectionInfo sourceConnectionInfo) { + super.withSourceConnectionInfo(sourceConnectionInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public MigrateSsisTaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + super.withTargetConnectionInfo(targetConnectionInfo); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (ssisMigrationInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ssisMigrationInfo in model MigrateSsisTaskInput")); + } else { + ssisMigrationInfo().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutput.java new file mode 100644 index 000000000000..a145ac3eaa48 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutput.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.datamigration.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 com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Output for task that migrates SSIS packages from SQL Server to Azure SQL Database Managed Instance. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "resultType", + defaultImpl = MigrateSsisTaskOutput.class) +@JsonTypeName("MigrateSsisTaskOutput") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "MigrationLevelOutput", value = MigrateSsisTaskOutputMigrationLevel.class), + @JsonSubTypes.Type(name = "SsisProjectLevelOutput", value = MigrateSsisTaskOutputProjectLevel.class) +}) +@Immutable +public class MigrateSsisTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSsisTaskOutput.class); + + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutputMigrationLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutputMigrationLevel.java new file mode 100644 index 000000000000..39587f5dca6a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutputMigrationLevel.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** The MigrateSsisTaskOutputMigrationLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("MigrationLevelOutput") +@Immutable +public final class MigrateSsisTaskOutputMigrationLevel extends MigrateSsisTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSsisTaskOutputMigrationLevel.class); + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Current status of migration + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private MigrationStatus status; + + /* + * Migration progress message + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * Source server version + */ + @JsonProperty(value = "sourceServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerVersion; + + /* + * Source server brand version + */ + @JsonProperty(value = "sourceServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String sourceServerBrandVersion; + + /* + * Target server version + */ + @JsonProperty(value = "targetServerVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerVersion; + + /* + * Target server brand version + */ + @JsonProperty(value = "targetServerBrandVersion", access = JsonProperty.Access.WRITE_ONLY) + private String targetServerBrandVersion; + + /* + * Migration exceptions and warnings. + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /* + * Stage of SSIS migration. + */ + @JsonProperty(value = "stage", access = JsonProperty.Access.WRITE_ONLY) + private SsisMigrationStage stage; + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the status property: Current status of migration. + * + * @return the status value. + */ + public MigrationStatus status() { + return this.status; + } + + /** + * Get the message property: Migration progress message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the sourceServerVersion property: Source server version. + * + * @return the sourceServerVersion value. + */ + public String sourceServerVersion() { + return this.sourceServerVersion; + } + + /** + * Get the sourceServerBrandVersion property: Source server brand version. + * + * @return the sourceServerBrandVersion value. + */ + public String sourceServerBrandVersion() { + return this.sourceServerBrandVersion; + } + + /** + * Get the targetServerVersion property: Target server version. + * + * @return the targetServerVersion value. + */ + public String targetServerVersion() { + return this.targetServerVersion; + } + + /** + * Get the targetServerBrandVersion property: Target server brand version. + * + * @return the targetServerBrandVersion value. + */ + public String targetServerBrandVersion() { + return this.targetServerBrandVersion; + } + + /** + * Get the exceptionsAndWarnings property: Migration exceptions and warnings. + * + * @return the exceptionsAndWarnings value. + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + + /** + * Get the stage property: Stage of SSIS migration. + * + * @return the stage value. + */ + public SsisMigrationStage stage() { + return this.stage; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (exceptionsAndWarnings() != null) { + exceptionsAndWarnings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutputProjectLevel.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutputProjectLevel.java new file mode 100644 index 000000000000..bdfe27311005 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskOutputProjectLevel.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** The MigrateSsisTaskOutputProjectLevel model. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("SsisProjectLevelOutput") +@Immutable +public final class MigrateSsisTaskOutputProjectLevel extends MigrateSsisTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSsisTaskOutputProjectLevel.class); + + /* + * Name of the folder + */ + @JsonProperty(value = "folderName", access = JsonProperty.Access.WRITE_ONLY) + private String folderName; + + /* + * Name of the project + */ + @JsonProperty(value = "projectName", access = JsonProperty.Access.WRITE_ONLY) + private String projectName; + + /* + * Current state of migration + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private MigrationState state; + + /* + * Stage of SSIS migration. + */ + @JsonProperty(value = "stage", access = JsonProperty.Access.WRITE_ONLY) + private SsisMigrationStage stage; + + /* + * Migration start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Migration end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Migration progress message + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * Migration exceptions and warnings + */ + @JsonProperty(value = "exceptionsAndWarnings", access = JsonProperty.Access.WRITE_ONLY) + private List exceptionsAndWarnings; + + /** + * Get the folderName property: Name of the folder. + * + * @return the folderName value. + */ + public String folderName() { + return this.folderName; + } + + /** + * Get the projectName property: Name of the project. + * + * @return the projectName value. + */ + public String projectName() { + return this.projectName; + } + + /** + * Get the state property: Current state of migration. + * + * @return the state value. + */ + public MigrationState state() { + return this.state; + } + + /** + * Get the stage property: Stage of SSIS migration. + * + * @return the stage value. + */ + public SsisMigrationStage stage() { + return this.stage; + } + + /** + * Get the startedOn property: Migration start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Migration end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the message property: Migration progress message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the exceptionsAndWarnings property: Migration exceptions and warnings. + * + * @return the exceptionsAndWarnings value. + */ + public List exceptionsAndWarnings() { + return this.exceptionsAndWarnings; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (exceptionsAndWarnings() != null) { + exceptionsAndWarnings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskProperties.java new file mode 100644 index 000000000000..70c91db41554 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSsisTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for task that migrates SSIS packages from SQL Server databases to Azure SQL Database Managed Instance. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Migrate.Ssis") +@Fluent +public final class MigrateSsisTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSsisTaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private MigrateSsisTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public MigrateSsisTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the MigrateSsisTaskProperties object itself. + */ + public MigrateSsisTaskProperties withInput(MigrateSsisTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public MigrateSsisTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSyncCompleteCommandInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSyncCompleteCommandInput.java new file mode 100644 index 000000000000..8afe850739ae --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSyncCompleteCommandInput.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Input for command that completes sync migration for a database. */ +@Fluent +public final class MigrateSyncCompleteCommandInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSyncCompleteCommandInput.class); + + /* + * Name of database + */ + @JsonProperty(value = "databaseName", required = true) + private String databaseName; + + /* + * Time stamp to complete + */ + @JsonProperty(value = "commitTimeStamp") + private OffsetDateTime commitTimestamp; + + /** + * Get the databaseName property: Name of database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: Name of database. + * + * @param databaseName the databaseName value to set. + * @return the MigrateSyncCompleteCommandInput object itself. + */ + public MigrateSyncCompleteCommandInput withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the commitTimestamp property: Time stamp to complete. + * + * @return the commitTimestamp value. + */ + public OffsetDateTime commitTimestamp() { + return this.commitTimestamp; + } + + /** + * Set the commitTimestamp property: Time stamp to complete. + * + * @param commitTimestamp the commitTimestamp value to set. + * @return the MigrateSyncCompleteCommandInput object itself. + */ + public MigrateSyncCompleteCommandInput withCommitTimestamp(OffsetDateTime commitTimestamp) { + this.commitTimestamp = commitTimestamp; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (databaseName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property databaseName in model MigrateSyncCompleteCommandInput")); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSyncCompleteCommandOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSyncCompleteCommandOutput.java new file mode 100644 index 000000000000..8a1a1fb5b767 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSyncCompleteCommandOutput.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Output for command that completes sync migration for a database. */ +@Immutable +public final class MigrateSyncCompleteCommandOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSyncCompleteCommandOutput.class); + + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * List of errors that happened during the command execution + */ + @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) + private List errors; + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the errors property: List of errors that happened during the command execution. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (errors() != null) { + errors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSyncCompleteCommandProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSyncCompleteCommandProperties.java new file mode 100644 index 000000000000..ddcce0912a60 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrateSyncCompleteCommandProperties.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.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Properties for the command that completes sync migration for a database. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "commandType") +@JsonTypeName("Migrate.Sync.Complete.Database") +@Fluent +public final class MigrateSyncCompleteCommandProperties extends CommandPropertiesInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrateSyncCompleteCommandProperties.class); + + /* + * Command input + */ + @JsonProperty(value = "input") + private MigrateSyncCompleteCommandInput input; + + /* + * Command output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private MigrateSyncCompleteCommandOutput output; + + /** + * Get the input property: Command input. + * + * @return the input value. + */ + public MigrateSyncCompleteCommandInput input() { + return this.input; + } + + /** + * Set the input property: Command input. + * + * @param input the input value to set. + * @return the MigrateSyncCompleteCommandProperties object itself. + */ + public MigrateSyncCompleteCommandProperties withInput(MigrateSyncCompleteCommandInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Command output. This is ignored if submitted. + * + * @return the output value. + */ + public MigrateSyncCompleteCommandOutput output() { + return this.output; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationEligibilityInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationEligibilityInfo.java new file mode 100644 index 000000000000..d9b8d4bf2f7c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationEligibilityInfo.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.datamigration.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; + +/** Information about migration eligibility of a server object. */ +@Immutable +public final class MigrationEligibilityInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrationEligibilityInfo.class); + + /* + * Whether object is eligible for migration or not. + */ + @JsonProperty(value = "isEligibleForMigration", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isEligibleForMigration; + + /* + * Information about eligibility failure for the server object. + */ + @JsonProperty(value = "validationMessages", access = JsonProperty.Access.WRITE_ONLY) + private List validationMessages; + + /** + * Get the isEligibleForMigration property: Whether object is eligible for migration or not. + * + * @return the isEligibleForMigration value. + */ + public Boolean isEligibleForMigration() { + return this.isEligibleForMigration; + } + + /** + * Get the validationMessages property: Information about eligibility failure for the server object. + * + * @return the validationMessages value. + */ + public List validationMessages() { + return this.validationMessages; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationReportResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationReportResult.java new file mode 100644 index 000000000000..d6f31bd5d904 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationReportResult.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.datamigration.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; + +/** Migration validation report result, contains the url for downloading the generated report. */ +@Fluent +public final class MigrationReportResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrationReportResult.class); + + /* + * Migration validation result identifier + */ + @JsonProperty(value = "id") + private String id; + + /* + * The url of the report. + */ + @JsonProperty(value = "reportUrl") + private String reportUrl; + + /** + * Get the id property: Migration validation result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Migration validation result identifier. + * + * @param id the id value to set. + * @return the MigrationReportResult object itself. + */ + public MigrationReportResult withId(String id) { + this.id = id; + return this; + } + + /** + * Get the reportUrl property: The url of the report. + * + * @return the reportUrl value. + */ + public String reportUrl() { + return this.reportUrl; + } + + /** + * Set the reportUrl property: The url of the report. + * + * @param reportUrl the reportUrl value to set. + * @return the MigrationReportResult object itself. + */ + public MigrationReportResult withReportUrl(String reportUrl) { + this.reportUrl = reportUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationState.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationState.java new file mode 100644 index 000000000000..4e83aaf816be --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationState.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MigrationState. */ +public final class MigrationState extends ExpandableStringEnum { + /** Static value None for MigrationState. */ + public static final MigrationState NONE = fromString("None"); + + /** Static value InProgress for MigrationState. */ + public static final MigrationState IN_PROGRESS = fromString("InProgress"); + + /** Static value Failed for MigrationState. */ + public static final MigrationState FAILED = fromString("Failed"); + + /** Static value Warning for MigrationState. */ + public static final MigrationState WARNING = fromString("Warning"); + + /** Static value Completed for MigrationState. */ + public static final MigrationState COMPLETED = fromString("Completed"); + + /** Static value Skipped for MigrationState. */ + public static final MigrationState SKIPPED = fromString("Skipped"); + + /** Static value Stopped for MigrationState. */ + public static final MigrationState STOPPED = fromString("Stopped"); + + /** + * Creates or finds a MigrationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding MigrationState. + */ + @JsonCreator + public static MigrationState fromString(String name) { + return fromString(name, MigrationState.class); + } + + /** @return known MigrationState values. */ + public static Collection values() { + return values(MigrationState.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationStatus.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationStatus.java new file mode 100644 index 000000000000..48af828f29e6 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationStatus.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MigrationStatus. */ +public final class MigrationStatus extends ExpandableStringEnum { + /** Static value Default for MigrationStatus. */ + public static final MigrationStatus DEFAULT = fromString("Default"); + + /** Static value Connecting for MigrationStatus. */ + public static final MigrationStatus CONNECTING = fromString("Connecting"); + + /** Static value SourceAndTargetSelected for MigrationStatus. */ + public static final MigrationStatus SOURCE_AND_TARGET_SELECTED = fromString("SourceAndTargetSelected"); + + /** Static value SelectLogins for MigrationStatus. */ + public static final MigrationStatus SELECT_LOGINS = fromString("SelectLogins"); + + /** Static value Configured for MigrationStatus. */ + public static final MigrationStatus CONFIGURED = fromString("Configured"); + + /** Static value Running for MigrationStatus. */ + public static final MigrationStatus RUNNING = fromString("Running"); + + /** Static value Error for MigrationStatus. */ + public static final MigrationStatus ERROR = fromString("Error"); + + /** Static value Stopped for MigrationStatus. */ + public static final MigrationStatus STOPPED = fromString("Stopped"); + + /** Static value Completed for MigrationStatus. */ + public static final MigrationStatus COMPLETED = fromString("Completed"); + + /** Static value CompletedWithWarnings for MigrationStatus. */ + public static final MigrationStatus COMPLETED_WITH_WARNINGS = fromString("CompletedWithWarnings"); + + /** + * Creates or finds a MigrationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding MigrationStatus. + */ + @JsonCreator + public static MigrationStatus fromString(String name) { + return fromString(name, MigrationStatus.class); + } + + /** @return known MigrationStatus values. */ + public static Collection values() { + return values(MigrationStatus.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationTableMetadata.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationTableMetadata.java new file mode 100644 index 000000000000..a3741dd90bf5 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationTableMetadata.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.datamigration.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; + +/** Metadata for tables selected in migration project. */ +@Immutable +public final class MigrationTableMetadata { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrationTableMetadata.class); + + /* + * Source table name + */ + @JsonProperty(value = "sourceTableName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceTableName; + + /* + * Target table name + */ + @JsonProperty(value = "targetTableName", access = JsonProperty.Access.WRITE_ONLY) + private String targetTableName; + + /** + * Get the sourceTableName property: Source table name. + * + * @return the sourceTableName value. + */ + public String sourceTableName() { + return this.sourceTableName; + } + + /** + * Get the targetTableName property: Target table name. + * + * @return the targetTableName value. + */ + public String targetTableName() { + return this.targetTableName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationDatabaseSummaryResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationDatabaseSummaryResult.java new file mode 100644 index 000000000000..403d75ac6609 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationDatabaseSummaryResult.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Migration Validation Database level summary result. */ +@Immutable +public final class MigrationValidationDatabaseSummaryResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrationValidationDatabaseSummaryResult.class); + + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Migration Identifier + */ + @JsonProperty(value = "migrationId", access = JsonProperty.Access.WRITE_ONLY) + private String migrationId; + + /* + * Name of the source database + */ + @JsonProperty(value = "sourceDatabaseName", access = JsonProperty.Access.WRITE_ONLY) + private String sourceDatabaseName; + + /* + * Name of the target database + */ + @JsonProperty(value = "targetDatabaseName", access = JsonProperty.Access.WRITE_ONLY) + private String targetDatabaseName; + + /* + * Validation start time + */ + @JsonProperty(value = "startedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedOn; + + /* + * Validation end time + */ + @JsonProperty(value = "endedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endedOn; + + /* + * Current status of validation at the database level + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ValidationStatus status; + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the migrationId property: Migration Identifier. + * + * @return the migrationId value. + */ + public String migrationId() { + return this.migrationId; + } + + /** + * Get the sourceDatabaseName property: Name of the source database. + * + * @return the sourceDatabaseName value. + */ + public String sourceDatabaseName() { + return this.sourceDatabaseName; + } + + /** + * Get the targetDatabaseName property: Name of the target database. + * + * @return the targetDatabaseName value. + */ + public String targetDatabaseName() { + return this.targetDatabaseName; + } + + /** + * Get the startedOn property: Validation start time. + * + * @return the startedOn value. + */ + public OffsetDateTime startedOn() { + return this.startedOn; + } + + /** + * Get the endedOn property: Validation end time. + * + * @return the endedOn value. + */ + public OffsetDateTime endedOn() { + return this.endedOn; + } + + /** + * Get the status property: Current status of validation at the database level. + * + * @return the status value. + */ + public ValidationStatus status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationOptions.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationOptions.java new file mode 100644 index 000000000000..17577d342cf2 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationOptions.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.datamigration.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; + +/** Types of validations to run after the migration. */ +@Fluent +public final class MigrationValidationOptions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrationValidationOptions.class); + + /* + * Allows to compare the schema information between source and target. + */ + @JsonProperty(value = "enableSchemaValidation") + private Boolean enableSchemaValidation; + + /* + * Allows to perform a checksum based data integrity validation between + * source and target for the selected database / tables . + */ + @JsonProperty(value = "enableDataIntegrityValidation") + private Boolean enableDataIntegrityValidation; + + /* + * Allows to perform a quick and intelligent query analysis by retrieving + * queries from the source database and executes them in the target. The + * result will have execution statistics for executions in source and + * target databases for the extracted queries. + */ + @JsonProperty(value = "enableQueryAnalysisValidation") + private Boolean enableQueryAnalysisValidation; + + /** + * Get the enableSchemaValidation property: Allows to compare the schema information between source and target. + * + * @return the enableSchemaValidation value. + */ + public Boolean enableSchemaValidation() { + return this.enableSchemaValidation; + } + + /** + * Set the enableSchemaValidation property: Allows to compare the schema information between source and target. + * + * @param enableSchemaValidation the enableSchemaValidation value to set. + * @return the MigrationValidationOptions object itself. + */ + public MigrationValidationOptions withEnableSchemaValidation(Boolean enableSchemaValidation) { + this.enableSchemaValidation = enableSchemaValidation; + return this; + } + + /** + * Get the enableDataIntegrityValidation property: Allows to perform a checksum based data integrity validation + * between source and target for the selected database / tables . + * + * @return the enableDataIntegrityValidation value. + */ + public Boolean enableDataIntegrityValidation() { + return this.enableDataIntegrityValidation; + } + + /** + * Set the enableDataIntegrityValidation property: Allows to perform a checksum based data integrity validation + * between source and target for the selected database / tables . + * + * @param enableDataIntegrityValidation the enableDataIntegrityValidation value to set. + * @return the MigrationValidationOptions object itself. + */ + public MigrationValidationOptions withEnableDataIntegrityValidation(Boolean enableDataIntegrityValidation) { + this.enableDataIntegrityValidation = enableDataIntegrityValidation; + return this; + } + + /** + * Get the enableQueryAnalysisValidation property: Allows to perform a quick and intelligent query analysis by + * retrieving queries from the source database and executes them in the target. The result will have execution + * statistics for executions in source and target databases for the extracted queries. + * + * @return the enableQueryAnalysisValidation value. + */ + public Boolean enableQueryAnalysisValidation() { + return this.enableQueryAnalysisValidation; + } + + /** + * Set the enableQueryAnalysisValidation property: Allows to perform a quick and intelligent query analysis by + * retrieving queries from the source database and executes them in the target. The result will have execution + * statistics for executions in source and target databases for the extracted queries. + * + * @param enableQueryAnalysisValidation the enableQueryAnalysisValidation value to set. + * @return the MigrationValidationOptions object itself. + */ + public MigrationValidationOptions withEnableQueryAnalysisValidation(Boolean enableQueryAnalysisValidation) { + this.enableQueryAnalysisValidation = enableQueryAnalysisValidation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationResult.java new file mode 100644 index 000000000000..afcc4542a581 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MigrationValidationResult.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Migration Validation Result. */ +@Fluent +public final class MigrationValidationResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MigrationValidationResult.class); + + /* + * Migration validation result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Migration Identifier + */ + @JsonProperty(value = "migrationId", access = JsonProperty.Access.WRITE_ONLY) + private String migrationId; + + /* + * Validation summary results for each database + */ + @JsonProperty(value = "summaryResults") + private Map summaryResults; + + /* + * Current status of validation at the migration level. Status from the + * database validation result status will be aggregated here. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ValidationStatus status; + + /** + * Get the id property: Migration validation result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the migrationId property: Migration Identifier. + * + * @return the migrationId value. + */ + public String migrationId() { + return this.migrationId; + } + + /** + * Get the summaryResults property: Validation summary results for each database. + * + * @return the summaryResults value. + */ + public Map summaryResults() { + return this.summaryResults; + } + + /** + * Set the summaryResults property: Validation summary results for each database. + * + * @param summaryResults the summaryResults value to set. + * @return the MigrationValidationResult object itself. + */ + public MigrationValidationResult withSummaryResults( + Map summaryResults) { + this.summaryResults = summaryResults; + return this; + } + + /** + * Get the status property: Current status of validation at the migration level. Status from the database validation + * result status will be aggregated here. + * + * @return the status value. + */ + public ValidationStatus status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (summaryResults() != null) { + summaryResults() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCancelCommand.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCancelCommand.java new file mode 100644 index 000000000000..6574a574c840 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCancelCommand.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.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Properties for the command that cancels a migration in whole or in part. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "commandType") +@JsonTypeName("cancel") +@Fluent +public final class MongoDbCancelCommand extends CommandPropertiesInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbCancelCommand.class); + + /* + * Command input + */ + @JsonProperty(value = "input") + private MongoDbCommandInput input; + + /** + * Get the input property: Command input. + * + * @return the input value. + */ + public MongoDbCommandInput input() { + return this.input; + } + + /** + * Set the input property: Command input. + * + * @param input the input value to set. + * @return the MongoDbCancelCommand object itself. + */ + public MongoDbCancelCommand withInput(MongoDbCommandInput input) { + this.input = input; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbClusterInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbClusterInfo.java new file mode 100644 index 000000000000..21d547022cef --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbClusterInfo.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.datamigration.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; + +/** Describes a MongoDB data source. */ +@Fluent +public final class MongoDbClusterInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbClusterInfo.class); + + /* + * A list of non-system databases in the cluster + */ + @JsonProperty(value = "databases", required = true) + private List databases; + + /* + * Whether the cluster supports sharded collections + */ + @JsonProperty(value = "supportsSharding", required = true) + private boolean supportsSharding; + + /* + * The type of data source + */ + @JsonProperty(value = "type", required = true) + private MongoDbClusterType type; + + /* + * The version of the data source in the form x.y.z (e.g. 3.6.7). Not used + * if Type is BlobContainer. + */ + @JsonProperty(value = "version", required = true) + private String version; + + /** + * Get the databases property: A list of non-system databases in the cluster. + * + * @return the databases value. + */ + public List databases() { + return this.databases; + } + + /** + * Set the databases property: A list of non-system databases in the cluster. + * + * @param databases the databases value to set. + * @return the MongoDbClusterInfo object itself. + */ + public MongoDbClusterInfo withDatabases(List databases) { + this.databases = databases; + return this; + } + + /** + * Get the supportsSharding property: Whether the cluster supports sharded collections. + * + * @return the supportsSharding value. + */ + public boolean supportsSharding() { + return this.supportsSharding; + } + + /** + * Set the supportsSharding property: Whether the cluster supports sharded collections. + * + * @param supportsSharding the supportsSharding value to set. + * @return the MongoDbClusterInfo object itself. + */ + public MongoDbClusterInfo withSupportsSharding(boolean supportsSharding) { + this.supportsSharding = supportsSharding; + return this; + } + + /** + * Get the type property: The type of data source. + * + * @return the type value. + */ + public MongoDbClusterType type() { + return this.type; + } + + /** + * Set the type property: The type of data source. + * + * @param type the type value to set. + * @return the MongoDbClusterInfo object itself. + */ + public MongoDbClusterInfo withType(MongoDbClusterType type) { + this.type = type; + return this; + } + + /** + * Get the version property: The version of the data source in the form x.y.z (e.g. 3.6.7). Not used if Type is + * BlobContainer. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version of the data source in the form x.y.z (e.g. 3.6.7). Not used if Type is + * BlobContainer. + * + * @param version the version value to set. + * @return the MongoDbClusterInfo object itself. + */ + public MongoDbClusterInfo withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (databases() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property databases in model MongoDbClusterInfo")); + } else { + databases().forEach(e -> e.validate()); + } + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model MongoDbClusterInfo")); + } + if (version() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property version in model MongoDbClusterInfo")); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbClusterType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbClusterType.java new file mode 100644 index 000000000000..70347d9a2a67 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbClusterType.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MongoDbClusterType. */ +public final class MongoDbClusterType extends ExpandableStringEnum { + /** Static value BlobContainer for MongoDbClusterType. */ + public static final MongoDbClusterType BLOB_CONTAINER = fromString("BlobContainer"); + + /** Static value CosmosDb for MongoDbClusterType. */ + public static final MongoDbClusterType COSMOS_DB = fromString("CosmosDb"); + + /** Static value MongoDb for MongoDbClusterType. */ + public static final MongoDbClusterType MONGO_DB = fromString("MongoDb"); + + /** + * Creates or finds a MongoDbClusterType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MongoDbClusterType. + */ + @JsonCreator + public static MongoDbClusterType fromString(String name) { + return fromString(name, MongoDbClusterType.class); + } + + /** @return known MongoDbClusterType values. */ + public static Collection values() { + return values(MongoDbClusterType.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionInfo.java new file mode 100644 index 000000000000..861c5667a4c1 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionInfo.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Describes a supported collection within a MongoDB database. */ +@Fluent +public final class MongoDbCollectionInfo extends MongoDbObjectInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbCollectionInfo.class); + + /* + * The name of the database containing the collection + */ + @JsonProperty(value = "databaseName", required = true) + private String databaseName; + + /* + * Whether the collection is a capped collection (i.e. whether it has a + * fixed size and acts like a circular buffer) + */ + @JsonProperty(value = "isCapped", required = true) + private boolean isCapped; + + /* + * Whether the collection is system collection + */ + @JsonProperty(value = "isSystemCollection", required = true) + private boolean isSystemCollection; + + /* + * Whether the collection is a view of another collection + */ + @JsonProperty(value = "isView", required = true) + private boolean isView; + + /* + * The shard key on the collection, or null if the collection is not + * sharded + */ + @JsonProperty(value = "shardKey") + private MongoDbShardKeyInfo shardKey; + + /* + * Whether the database has sharding enabled. Note that the migration task + * will enable sharding on the target if necessary. + */ + @JsonProperty(value = "supportsSharding", required = true) + private boolean supportsSharding; + + /* + * The name of the collection that this is a view of, if IsView is true + */ + @JsonProperty(value = "viewOf") + private String viewOf; + + /** + * Get the databaseName property: The name of the database containing the collection. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: The name of the database containing the collection. + * + * @param databaseName the databaseName value to set. + * @return the MongoDbCollectionInfo object itself. + */ + public MongoDbCollectionInfo withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the isCapped property: Whether the collection is a capped collection (i.e. whether it has a fixed size and + * acts like a circular buffer). + * + * @return the isCapped value. + */ + public boolean isCapped() { + return this.isCapped; + } + + /** + * Set the isCapped property: Whether the collection is a capped collection (i.e. whether it has a fixed size and + * acts like a circular buffer). + * + * @param isCapped the isCapped value to set. + * @return the MongoDbCollectionInfo object itself. + */ + public MongoDbCollectionInfo withIsCapped(boolean isCapped) { + this.isCapped = isCapped; + return this; + } + + /** + * Get the isSystemCollection property: Whether the collection is system collection. + * + * @return the isSystemCollection value. + */ + public boolean isSystemCollection() { + return this.isSystemCollection; + } + + /** + * Set the isSystemCollection property: Whether the collection is system collection. + * + * @param isSystemCollection the isSystemCollection value to set. + * @return the MongoDbCollectionInfo object itself. + */ + public MongoDbCollectionInfo withIsSystemCollection(boolean isSystemCollection) { + this.isSystemCollection = isSystemCollection; + return this; + } + + /** + * Get the isView property: Whether the collection is a view of another collection. + * + * @return the isView value. + */ + public boolean isView() { + return this.isView; + } + + /** + * Set the isView property: Whether the collection is a view of another collection. + * + * @param isView the isView value to set. + * @return the MongoDbCollectionInfo object itself. + */ + public MongoDbCollectionInfo withIsView(boolean isView) { + this.isView = isView; + return this; + } + + /** + * Get the shardKey property: The shard key on the collection, or null if the collection is not sharded. + * + * @return the shardKey value. + */ + public MongoDbShardKeyInfo shardKey() { + return this.shardKey; + } + + /** + * Set the shardKey property: The shard key on the collection, or null if the collection is not sharded. + * + * @param shardKey the shardKey value to set. + * @return the MongoDbCollectionInfo object itself. + */ + public MongoDbCollectionInfo withShardKey(MongoDbShardKeyInfo shardKey) { + this.shardKey = shardKey; + return this; + } + + /** + * Get the supportsSharding property: Whether the database has sharding enabled. Note that the migration task will + * enable sharding on the target if necessary. + * + * @return the supportsSharding value. + */ + public boolean supportsSharding() { + return this.supportsSharding; + } + + /** + * Set the supportsSharding property: Whether the database has sharding enabled. Note that the migration task will + * enable sharding on the target if necessary. + * + * @param supportsSharding the supportsSharding value to set. + * @return the MongoDbCollectionInfo object itself. + */ + public MongoDbCollectionInfo withSupportsSharding(boolean supportsSharding) { + this.supportsSharding = supportsSharding; + return this; + } + + /** + * Get the viewOf property: The name of the collection that this is a view of, if IsView is true. + * + * @return the viewOf value. + */ + public String viewOf() { + return this.viewOf; + } + + /** + * Set the viewOf property: The name of the collection that this is a view of, if IsView is true. + * + * @param viewOf the viewOf value to set. + * @return the MongoDbCollectionInfo object itself. + */ + public MongoDbCollectionInfo withViewOf(String viewOf) { + this.viewOf = viewOf; + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionInfo withAverageDocumentSize(long averageDocumentSize) { + super.withAverageDocumentSize(averageDocumentSize); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionInfo withDataSize(long dataSize) { + super.withDataSize(dataSize); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionInfo withDocumentCount(long documentCount) { + super.withDocumentCount(documentCount); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionInfo withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionInfo withQualifiedName(String qualifiedName) { + super.withQualifiedName(qualifiedName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (databaseName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property databaseName in model MongoDbCollectionInfo")); + } + if (shardKey() != null) { + shardKey().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionProgress.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionProgress.java new file mode 100644 index 000000000000..73ffdf3cf8ad --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionProgress.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.datamigration.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.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Describes the progress of a collection. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("Collection") +@Immutable +public final class MongoDbCollectionProgress extends MongoDbProgress { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbCollectionProgress.class); + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionProgress withBytesCopied(long bytesCopied) { + super.withBytesCopied(bytesCopied); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionProgress withDocumentsCopied(long documentsCopied) { + super.withDocumentsCopied(documentsCopied); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionProgress withElapsedTime(String elapsedTime) { + super.withElapsedTime(elapsedTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionProgress withErrors(Map errors) { + super.withErrors(errors); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionProgress withEventsPending(long eventsPending) { + super.withEventsPending(eventsPending); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionProgress withEventsReplayed(long eventsReplayed) { + super.withEventsReplayed(eventsReplayed); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionProgress withLastEventTime(OffsetDateTime lastEventTime) { + super.withLastEventTime(lastEventTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionProgress withLastReplayTime(OffsetDateTime lastReplayTime) { + super.withLastReplayTime(lastReplayTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionProgress withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionProgress withQualifiedName(String qualifiedName) { + super.withQualifiedName(qualifiedName); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionProgress withState(MongoDbMigrationState state) { + super.withState(state); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionProgress withTotalBytes(long totalBytes) { + super.withTotalBytes(totalBytes); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbCollectionProgress withTotalDocuments(long totalDocuments) { + super.withTotalDocuments(totalDocuments); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionSettings.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionSettings.java new file mode 100644 index 000000000000..c64cd7c6fa85 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCollectionSettings.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Describes how an individual MongoDB collection should be migrated. */ +@Fluent +public final class MongoDbCollectionSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbCollectionSettings.class); + + /* + * Whether the migrator is allowed to drop the target collection in the + * course of performing a migration. The default is true. + */ + @JsonProperty(value = "canDelete") + private Boolean canDelete; + + /* + * Describes a MongoDB shard key + */ + @JsonProperty(value = "shardKey") + private MongoDbShardKeySetting shardKey; + + /* + * The RUs that should be configured on a CosmosDB target, or null to use + * the default. This has no effect on non-CosmosDB targets. + */ + @JsonProperty(value = "targetRUs") + private Integer targetRUs; + + /** + * Get the canDelete property: Whether the migrator is allowed to drop the target collection in the course of + * performing a migration. The default is true. + * + * @return the canDelete value. + */ + public Boolean canDelete() { + return this.canDelete; + } + + /** + * Set the canDelete property: Whether the migrator is allowed to drop the target collection in the course of + * performing a migration. The default is true. + * + * @param canDelete the canDelete value to set. + * @return the MongoDbCollectionSettings object itself. + */ + public MongoDbCollectionSettings withCanDelete(Boolean canDelete) { + this.canDelete = canDelete; + return this; + } + + /** + * Get the shardKey property: Describes a MongoDB shard key. + * + * @return the shardKey value. + */ + public MongoDbShardKeySetting shardKey() { + return this.shardKey; + } + + /** + * Set the shardKey property: Describes a MongoDB shard key. + * + * @param shardKey the shardKey value to set. + * @return the MongoDbCollectionSettings object itself. + */ + public MongoDbCollectionSettings withShardKey(MongoDbShardKeySetting shardKey) { + this.shardKey = shardKey; + return this; + } + + /** + * Get the targetRUs property: The RUs that should be configured on a CosmosDB target, or null to use the default. + * This has no effect on non-CosmosDB targets. + * + * @return the targetRUs value. + */ + public Integer targetRUs() { + return this.targetRUs; + } + + /** + * Set the targetRUs property: The RUs that should be configured on a CosmosDB target, or null to use the default. + * This has no effect on non-CosmosDB targets. + * + * @param targetRUs the targetRUs value to set. + * @return the MongoDbCollectionSettings object itself. + */ + public MongoDbCollectionSettings withTargetRUs(Integer targetRUs) { + this.targetRUs = targetRUs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (shardKey() != null) { + shardKey().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCommandInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCommandInput.java new file mode 100644 index 000000000000..6dd7947985bd --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbCommandInput.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.datamigration.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; + +/** Describes the input to the 'cancel' and 'restart' MongoDB migration commands. */ +@Fluent +public class MongoDbCommandInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbCommandInput.class); + + /* + * The qualified name of a database or collection to act upon, or null to + * act upon the entire migration + */ + @JsonProperty(value = "objectName") + private String objectName; + + /** + * Get the objectName property: The qualified name of a database or collection to act upon, or null to act upon the + * entire migration. + * + * @return the objectName value. + */ + public String objectName() { + return this.objectName; + } + + /** + * Set the objectName property: The qualified name of a database or collection to act upon, or null to act upon the + * entire migration. + * + * @param objectName the objectName value to set. + * @return the MongoDbCommandInput object itself. + */ + public MongoDbCommandInput withObjectName(String objectName) { + this.objectName = objectName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbConnectionInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbConnectionInfo.java new file mode 100644 index 000000000000..cefdf49bcbce --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbConnectionInfo.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Describes a connection to a MongoDB data source. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("MongoDbConnectionInfo") +@Fluent +public final class MongoDbConnectionInfo extends ConnectionInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbConnectionInfo.class); + + /* + * A MongoDB connection string or blob container URL. The user name and + * password can be specified here or in the userName and password + * properties + */ + @JsonProperty(value = "connectionString", required = true) + private String connectionString; + + /** + * Get the connectionString property: A MongoDB connection string or blob container URL. The user name and password + * can be specified here or in the userName and password properties. + * + * @return the connectionString value. + */ + public String connectionString() { + return this.connectionString; + } + + /** + * Set the connectionString property: A MongoDB connection string or blob container URL. The user name and password + * can be specified here or in the userName and password properties. + * + * @param connectionString the connectionString value to set. + * @return the MongoDbConnectionInfo object itself. + */ + public MongoDbConnectionInfo withConnectionString(String connectionString) { + this.connectionString = connectionString; + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbConnectionInfo withUsername(String username) { + super.withUsername(username); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbConnectionInfo withPassword(String password) { + super.withPassword(password); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (connectionString() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property connectionString in model MongoDbConnectionInfo")); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseInfo.java new file mode 100644 index 000000000000..ad76b5ba109e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseInfo.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Describes a database within a MongoDB data source. */ +@Fluent +public final class MongoDbDatabaseInfo extends MongoDbObjectInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbDatabaseInfo.class); + + /* + * A list of supported collections in a MongoDB database + */ + @JsonProperty(value = "collections", required = true) + private List collections; + + /* + * Whether the database has sharding enabled. Note that the migration task + * will enable sharding on the target if necessary. + */ + @JsonProperty(value = "supportsSharding", required = true) + private boolean supportsSharding; + + /** + * Get the collections property: A list of supported collections in a MongoDB database. + * + * @return the collections value. + */ + public List collections() { + return this.collections; + } + + /** + * Set the collections property: A list of supported collections in a MongoDB database. + * + * @param collections the collections value to set. + * @return the MongoDbDatabaseInfo object itself. + */ + public MongoDbDatabaseInfo withCollections(List collections) { + this.collections = collections; + return this; + } + + /** + * Get the supportsSharding property: Whether the database has sharding enabled. Note that the migration task will + * enable sharding on the target if necessary. + * + * @return the supportsSharding value. + */ + public boolean supportsSharding() { + return this.supportsSharding; + } + + /** + * Set the supportsSharding property: Whether the database has sharding enabled. Note that the migration task will + * enable sharding on the target if necessary. + * + * @param supportsSharding the supportsSharding value to set. + * @return the MongoDbDatabaseInfo object itself. + */ + public MongoDbDatabaseInfo withSupportsSharding(boolean supportsSharding) { + this.supportsSharding = supportsSharding; + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseInfo withAverageDocumentSize(long averageDocumentSize) { + super.withAverageDocumentSize(averageDocumentSize); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseInfo withDataSize(long dataSize) { + super.withDataSize(dataSize); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseInfo withDocumentCount(long documentCount) { + super.withDocumentCount(documentCount); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseInfo withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseInfo withQualifiedName(String qualifiedName) { + super.withQualifiedName(qualifiedName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (collections() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property collections in model MongoDbDatabaseInfo")); + } else { + collections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseProgress.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseProgress.java new file mode 100644 index 000000000000..be287a6fbd86 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseProgress.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Describes the progress of a database. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("Database") +@Fluent +public final class MongoDbDatabaseProgress extends MongoDbProgress { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbDatabaseProgress.class); + + /* + * The progress of the collections in the database. The keys are the + * unqualified names of the collections + */ + @JsonProperty(value = "collections") + private Map collections; + + /** + * Get the collections property: The progress of the collections in the database. The keys are the unqualified names + * of the collections. + * + * @return the collections value. + */ + public Map collections() { + return this.collections; + } + + /** + * Set the collections property: The progress of the collections in the database. The keys are the unqualified names + * of the collections. + * + * @param collections the collections value to set. + * @return the MongoDbDatabaseProgress object itself. + */ + public MongoDbDatabaseProgress withCollections(Map collections) { + this.collections = collections; + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseProgress withBytesCopied(long bytesCopied) { + super.withBytesCopied(bytesCopied); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseProgress withDocumentsCopied(long documentsCopied) { + super.withDocumentsCopied(documentsCopied); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseProgress withElapsedTime(String elapsedTime) { + super.withElapsedTime(elapsedTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseProgress withErrors(Map errors) { + super.withErrors(errors); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseProgress withEventsPending(long eventsPending) { + super.withEventsPending(eventsPending); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseProgress withEventsReplayed(long eventsReplayed) { + super.withEventsReplayed(eventsReplayed); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseProgress withLastEventTime(OffsetDateTime lastEventTime) { + super.withLastEventTime(lastEventTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseProgress withLastReplayTime(OffsetDateTime lastReplayTime) { + super.withLastReplayTime(lastReplayTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseProgress withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseProgress withQualifiedName(String qualifiedName) { + super.withQualifiedName(qualifiedName); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseProgress withState(MongoDbMigrationState state) { + super.withState(state); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseProgress withTotalBytes(long totalBytes) { + super.withTotalBytes(totalBytes); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbDatabaseProgress withTotalDocuments(long totalDocuments) { + super.withTotalDocuments(totalDocuments); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (collections() != null) { + collections() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseSettings.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseSettings.java new file mode 100644 index 000000000000..6f4e8cc22200 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbDatabaseSettings.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.datamigration.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; + +/** Describes how an individual MongoDB database should be migrated. */ +@Fluent +public final class MongoDbDatabaseSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbDatabaseSettings.class); + + /* + * The collections on the source database to migrate to the target. The + * keys are the unqualified names of the collections. + */ + @JsonProperty(value = "collections", required = true) + private Map collections; + + /* + * The RUs that should be configured on a CosmosDB target, or null to use + * the default, or 0 if throughput should not be provisioned for the + * database. This has no effect on non-CosmosDB targets. + */ + @JsonProperty(value = "targetRUs") + private Integer targetRUs; + + /** + * Get the collections property: The collections on the source database to migrate to the target. The keys are the + * unqualified names of the collections. + * + * @return the collections value. + */ + public Map collections() { + return this.collections; + } + + /** + * Set the collections property: The collections on the source database to migrate to the target. The keys are the + * unqualified names of the collections. + * + * @param collections the collections value to set. + * @return the MongoDbDatabaseSettings object itself. + */ + public MongoDbDatabaseSettings withCollections(Map collections) { + this.collections = collections; + return this; + } + + /** + * Get the targetRUs property: The RUs that should be configured on a CosmosDB target, or null to use the default, + * or 0 if throughput should not be provisioned for the database. This has no effect on non-CosmosDB targets. + * + * @return the targetRUs value. + */ + public Integer targetRUs() { + return this.targetRUs; + } + + /** + * Set the targetRUs property: The RUs that should be configured on a CosmosDB target, or null to use the default, + * or 0 if throughput should not be provisioned for the database. This has no effect on non-CosmosDB targets. + * + * @param targetRUs the targetRUs value to set. + * @return the MongoDbDatabaseSettings object itself. + */ + public MongoDbDatabaseSettings withTargetRUs(Integer targetRUs) { + this.targetRUs = targetRUs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (collections() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property collections in model MongoDbDatabaseSettings")); + } else { + collections() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbError.java new file mode 100644 index 000000000000..d2e66a326bc4 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbError.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Describes an error or warning that occurred during a MongoDB migration. */ +@Fluent +public final class MongoDbError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbError.class); + + /* + * The non-localized, machine-readable code that describes the error or + * warning + */ + @JsonProperty(value = "code") + private String code; + + /* + * The number of times the error or warning has occurred + */ + @JsonProperty(value = "count") + private Integer count; + + /* + * The localized, human-readable message that describes the error or + * warning + */ + @JsonProperty(value = "message") + private String message; + + /* + * The type of error or warning + */ + @JsonProperty(value = "type") + private MongoDbErrorType type; + + /** + * Get the code property: The non-localized, machine-readable code that describes the error or warning. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: The non-localized, machine-readable code that describes the error or warning. + * + * @param code the code value to set. + * @return the MongoDbError object itself. + */ + public MongoDbError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the count property: The number of times the error or warning has occurred. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Set the count property: The number of times the error or warning has occurred. + * + * @param count the count value to set. + * @return the MongoDbError object itself. + */ + public MongoDbError withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the message property: The localized, human-readable message that describes the error or warning. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The localized, human-readable message that describes the error or warning. + * + * @param message the message value to set. + * @return the MongoDbError object itself. + */ + public MongoDbError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the type property: The type of error or warning. + * + * @return the type value. + */ + public MongoDbErrorType type() { + return this.type; + } + + /** + * Set the type property: The type of error or warning. + * + * @param type the type value to set. + * @return the MongoDbError object itself. + */ + public MongoDbError withType(MongoDbErrorType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbErrorType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbErrorType.java new file mode 100644 index 000000000000..9d0c7baaff66 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbErrorType.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MongoDbErrorType. */ +public final class MongoDbErrorType extends ExpandableStringEnum { + /** Static value Error for MongoDbErrorType. */ + public static final MongoDbErrorType ERROR = fromString("Error"); + + /** Static value ValidationError for MongoDbErrorType. */ + public static final MongoDbErrorType VALIDATION_ERROR = fromString("ValidationError"); + + /** Static value Warning for MongoDbErrorType. */ + public static final MongoDbErrorType WARNING = fromString("Warning"); + + /** + * Creates or finds a MongoDbErrorType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MongoDbErrorType. + */ + @JsonCreator + public static MongoDbErrorType fromString(String name) { + return fromString(name, MongoDbErrorType.class); + } + + /** @return known MongoDbErrorType values. */ + public static Collection values() { + return values(MongoDbErrorType.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbFinishCommand.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbFinishCommand.java new file mode 100644 index 000000000000..55c0e153f0ca --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbFinishCommand.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.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Properties for the command that finishes a migration in whole or in part. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "commandType") +@JsonTypeName("finish") +@Fluent +public final class MongoDbFinishCommand extends CommandPropertiesInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbFinishCommand.class); + + /* + * Command input + */ + @JsonProperty(value = "input") + private MongoDbFinishCommandInput input; + + /** + * Get the input property: Command input. + * + * @return the input value. + */ + public MongoDbFinishCommandInput input() { + return this.input; + } + + /** + * Set the input property: Command input. + * + * @param input the input value to set. + * @return the MongoDbFinishCommand object itself. + */ + public MongoDbFinishCommand withInput(MongoDbFinishCommandInput input) { + this.input = input; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbFinishCommandInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbFinishCommandInput.java new file mode 100644 index 000000000000..87821778208b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbFinishCommandInput.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Describes the input to the 'finish' MongoDB migration command. */ +@Fluent +public final class MongoDbFinishCommandInput extends MongoDbCommandInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbFinishCommandInput.class); + + /* + * If true, replication for the affected objects will be stopped + * immediately. If false, the migrator will finish replaying queued events + * before finishing the replication. + */ + @JsonProperty(value = "immediate", required = true) + private boolean immediate; + + /** + * Get the immediate property: If true, replication for the affected objects will be stopped immediately. If false, + * the migrator will finish replaying queued events before finishing the replication. + * + * @return the immediate value. + */ + public boolean immediate() { + return this.immediate; + } + + /** + * Set the immediate property: If true, replication for the affected objects will be stopped immediately. If false, + * the migrator will finish replaying queued events before finishing the replication. + * + * @param immediate the immediate value to set. + * @return the MongoDbFinishCommandInput object itself. + */ + public MongoDbFinishCommandInput withImmediate(boolean immediate) { + this.immediate = immediate; + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbFinishCommandInput withObjectName(String objectName) { + super.withObjectName(objectName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationProgress.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationProgress.java new file mode 100644 index 000000000000..f8ff1cd55c17 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationProgress.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Describes the progress of the overall migration. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType") +@JsonTypeName("Migration") +@Fluent +public final class MongoDbMigrationProgress extends MongoDbProgress { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbMigrationProgress.class); + + /* + * The progress of the databases in the migration. The keys are the names + * of the databases + */ + @JsonProperty(value = "databases") + private Map databases; + + /** + * Get the databases property: The progress of the databases in the migration. The keys are the names of the + * databases. + * + * @return the databases value. + */ + public Map databases() { + return this.databases; + } + + /** + * Set the databases property: The progress of the databases in the migration. The keys are the names of the + * databases. + * + * @param databases the databases value to set. + * @return the MongoDbMigrationProgress object itself. + */ + public MongoDbMigrationProgress withDatabases(Map databases) { + this.databases = databases; + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbMigrationProgress withBytesCopied(long bytesCopied) { + super.withBytesCopied(bytesCopied); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbMigrationProgress withDocumentsCopied(long documentsCopied) { + super.withDocumentsCopied(documentsCopied); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbMigrationProgress withElapsedTime(String elapsedTime) { + super.withElapsedTime(elapsedTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbMigrationProgress withErrors(Map errors) { + super.withErrors(errors); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbMigrationProgress withEventsPending(long eventsPending) { + super.withEventsPending(eventsPending); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbMigrationProgress withEventsReplayed(long eventsReplayed) { + super.withEventsReplayed(eventsReplayed); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbMigrationProgress withLastEventTime(OffsetDateTime lastEventTime) { + super.withLastEventTime(lastEventTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbMigrationProgress withLastReplayTime(OffsetDateTime lastReplayTime) { + super.withLastReplayTime(lastReplayTime); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbMigrationProgress withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbMigrationProgress withQualifiedName(String qualifiedName) { + super.withQualifiedName(qualifiedName); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbMigrationProgress withState(MongoDbMigrationState state) { + super.withState(state); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbMigrationProgress withTotalBytes(long totalBytes) { + super.withTotalBytes(totalBytes); + return this; + } + + /** {@inheritDoc} */ + @Override + public MongoDbMigrationProgress withTotalDocuments(long totalDocuments) { + super.withTotalDocuments(totalDocuments); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (databases() != null) { + databases() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationSettings.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationSettings.java new file mode 100644 index 000000000000..f90d1533bd40 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationSettings.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Describes how a MongoDB data migration should be performed. */ +@Fluent +public final class MongoDbMigrationSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbMigrationSettings.class); + + /* + * The RU limit on a CosmosDB target that collections will be temporarily + * increased to (if lower) during the initial copy of a migration, from + * 10,000 to 1,000,000, or 0 to use the default boost (which is generally + * the maximum), or null to not boost the RUs. This setting has no effect + * on non-CosmosDB targets. + */ + @JsonProperty(value = "boostRUs") + private Integer boostRUs; + + /* + * The databases on the source cluster to migrate to the target. The keys + * are the names of the databases. + */ + @JsonProperty(value = "databases", required = true) + private Map databases; + + /* + * Describes how changes will be replicated from the source to the target. + * The default is OneTime. + */ + @JsonProperty(value = "replication") + private MongoDbReplication replication; + + /* + * Settings used to connect to the source cluster + */ + @JsonProperty(value = "source", required = true) + private MongoDbConnectionInfo source; + + /* + * Settings used to connect to the target cluster + */ + @JsonProperty(value = "target", required = true) + private MongoDbConnectionInfo target; + + /* + * Settings used to limit the resource usage of the migration + */ + @JsonProperty(value = "throttling") + private MongoDbThrottlingSettings throttling; + + /** + * Get the boostRUs property: The RU limit on a CosmosDB target that collections will be temporarily increased to + * (if lower) during the initial copy of a migration, from 10,000 to 1,000,000, or 0 to use the default boost (which + * is generally the maximum), or null to not boost the RUs. This setting has no effect on non-CosmosDB targets. + * + * @return the boostRUs value. + */ + public Integer boostRUs() { + return this.boostRUs; + } + + /** + * Set the boostRUs property: The RU limit on a CosmosDB target that collections will be temporarily increased to + * (if lower) during the initial copy of a migration, from 10,000 to 1,000,000, or 0 to use the default boost (which + * is generally the maximum), or null to not boost the RUs. This setting has no effect on non-CosmosDB targets. + * + * @param boostRUs the boostRUs value to set. + * @return the MongoDbMigrationSettings object itself. + */ + public MongoDbMigrationSettings withBoostRUs(Integer boostRUs) { + this.boostRUs = boostRUs; + return this; + } + + /** + * Get the databases property: The databases on the source cluster to migrate to the target. The keys are the names + * of the databases. + * + * @return the databases value. + */ + public Map databases() { + return this.databases; + } + + /** + * Set the databases property: The databases on the source cluster to migrate to the target. The keys are the names + * of the databases. + * + * @param databases the databases value to set. + * @return the MongoDbMigrationSettings object itself. + */ + public MongoDbMigrationSettings withDatabases(Map databases) { + this.databases = databases; + return this; + } + + /** + * Get the replication property: Describes how changes will be replicated from the source to the target. The default + * is OneTime. + * + * @return the replication value. + */ + public MongoDbReplication replication() { + return this.replication; + } + + /** + * Set the replication property: Describes how changes will be replicated from the source to the target. The default + * is OneTime. + * + * @param replication the replication value to set. + * @return the MongoDbMigrationSettings object itself. + */ + public MongoDbMigrationSettings withReplication(MongoDbReplication replication) { + this.replication = replication; + return this; + } + + /** + * Get the source property: Settings used to connect to the source cluster. + * + * @return the source value. + */ + public MongoDbConnectionInfo source() { + return this.source; + } + + /** + * Set the source property: Settings used to connect to the source cluster. + * + * @param source the source value to set. + * @return the MongoDbMigrationSettings object itself. + */ + public MongoDbMigrationSettings withSource(MongoDbConnectionInfo source) { + this.source = source; + return this; + } + + /** + * Get the target property: Settings used to connect to the target cluster. + * + * @return the target value. + */ + public MongoDbConnectionInfo target() { + return this.target; + } + + /** + * Set the target property: Settings used to connect to the target cluster. + * + * @param target the target value to set. + * @return the MongoDbMigrationSettings object itself. + */ + public MongoDbMigrationSettings withTarget(MongoDbConnectionInfo target) { + this.target = target; + return this; + } + + /** + * Get the throttling property: Settings used to limit the resource usage of the migration. + * + * @return the throttling value. + */ + public MongoDbThrottlingSettings throttling() { + return this.throttling; + } + + /** + * Set the throttling property: Settings used to limit the resource usage of the migration. + * + * @param throttling the throttling value to set. + * @return the MongoDbMigrationSettings object itself. + */ + public MongoDbMigrationSettings withThrottling(MongoDbThrottlingSettings throttling) { + this.throttling = throttling; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (databases() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property databases in model MongoDbMigrationSettings")); + } else { + databases() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (source() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property source in model MongoDbMigrationSettings")); + } else { + source().validate(); + } + if (target() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property target in model MongoDbMigrationSettings")); + } else { + target().validate(); + } + if (throttling() != null) { + throttling().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationState.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationState.java new file mode 100644 index 000000000000..db783f21647a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbMigrationState.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MongoDbMigrationState. */ +public final class MongoDbMigrationState extends ExpandableStringEnum { + /** Static value NotStarted for MongoDbMigrationState. */ + public static final MongoDbMigrationState NOT_STARTED = fromString("NotStarted"); + + /** Static value ValidatingInput for MongoDbMigrationState. */ + public static final MongoDbMigrationState VALIDATING_INPUT = fromString("ValidatingInput"); + + /** Static value Initializing for MongoDbMigrationState. */ + public static final MongoDbMigrationState INITIALIZING = fromString("Initializing"); + + /** Static value Restarting for MongoDbMigrationState. */ + public static final MongoDbMigrationState RESTARTING = fromString("Restarting"); + + /** Static value Copying for MongoDbMigrationState. */ + public static final MongoDbMigrationState COPYING = fromString("Copying"); + + /** Static value InitialReplay for MongoDbMigrationState. */ + public static final MongoDbMigrationState INITIAL_REPLAY = fromString("InitialReplay"); + + /** Static value Replaying for MongoDbMigrationState. */ + public static final MongoDbMigrationState REPLAYING = fromString("Replaying"); + + /** Static value Finalizing for MongoDbMigrationState. */ + public static final MongoDbMigrationState FINALIZING = fromString("Finalizing"); + + /** Static value Complete for MongoDbMigrationState. */ + public static final MongoDbMigrationState COMPLETE = fromString("Complete"); + + /** Static value Canceled for MongoDbMigrationState. */ + public static final MongoDbMigrationState CANCELED = fromString("Canceled"); + + /** Static value Failed for MongoDbMigrationState. */ + public static final MongoDbMigrationState FAILED = fromString("Failed"); + + /** + * Creates or finds a MongoDbMigrationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding MongoDbMigrationState. + */ + @JsonCreator + public static MongoDbMigrationState fromString(String name) { + return fromString(name, MongoDbMigrationState.class); + } + + /** @return known MongoDbMigrationState values. */ + public static Collection values() { + return values(MongoDbMigrationState.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbObjectInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbObjectInfo.java new file mode 100644 index 000000000000..74df859fb2e1 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbObjectInfo.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.datamigration.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; + +/** Describes a database or collection within a MongoDB data source. */ +@Fluent +public class MongoDbObjectInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbObjectInfo.class); + + /* + * The average document size, or -1 if the average size is unknown + */ + @JsonProperty(value = "averageDocumentSize", required = true) + private long averageDocumentSize; + + /* + * The estimated total data size, in bytes, or -1 if the size is unknown. + */ + @JsonProperty(value = "dataSize", required = true) + private long dataSize; + + /* + * The estimated total number of documents, or -1 if the document count is + * unknown + */ + @JsonProperty(value = "documentCount", required = true) + private long documentCount; + + /* + * The unqualified name of the database or collection + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The qualified name of the database or collection. For a collection, this + * is the database-qualified name. + */ + @JsonProperty(value = "qualifiedName", required = true) + private String qualifiedName; + + /** + * Get the averageDocumentSize property: The average document size, or -1 if the average size is unknown. + * + * @return the averageDocumentSize value. + */ + public long averageDocumentSize() { + return this.averageDocumentSize; + } + + /** + * Set the averageDocumentSize property: The average document size, or -1 if the average size is unknown. + * + * @param averageDocumentSize the averageDocumentSize value to set. + * @return the MongoDbObjectInfo object itself. + */ + public MongoDbObjectInfo withAverageDocumentSize(long averageDocumentSize) { + this.averageDocumentSize = averageDocumentSize; + return this; + } + + /** + * Get the dataSize property: The estimated total data size, in bytes, or -1 if the size is unknown. + * + * @return the dataSize value. + */ + public long dataSize() { + return this.dataSize; + } + + /** + * Set the dataSize property: The estimated total data size, in bytes, or -1 if the size is unknown. + * + * @param dataSize the dataSize value to set. + * @return the MongoDbObjectInfo object itself. + */ + public MongoDbObjectInfo withDataSize(long dataSize) { + this.dataSize = dataSize; + return this; + } + + /** + * Get the documentCount property: The estimated total number of documents, or -1 if the document count is unknown. + * + * @return the documentCount value. + */ + public long documentCount() { + return this.documentCount; + } + + /** + * Set the documentCount property: The estimated total number of documents, or -1 if the document count is unknown. + * + * @param documentCount the documentCount value to set. + * @return the MongoDbObjectInfo object itself. + */ + public MongoDbObjectInfo withDocumentCount(long documentCount) { + this.documentCount = documentCount; + return this; + } + + /** + * Get the name property: The unqualified name of the database or collection. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The unqualified name of the database or collection. + * + * @param name the name value to set. + * @return the MongoDbObjectInfo object itself. + */ + public MongoDbObjectInfo withName(String name) { + this.name = name; + return this; + } + + /** + * Get the qualifiedName property: The qualified name of the database or collection. For a collection, this is the + * database-qualified name. + * + * @return the qualifiedName value. + */ + public String qualifiedName() { + return this.qualifiedName; + } + + /** + * Set the qualifiedName property: The qualified name of the database or collection. For a collection, this is the + * database-qualified name. + * + * @param qualifiedName the qualifiedName value to set. + * @return the MongoDbObjectInfo object itself. + */ + public MongoDbObjectInfo withQualifiedName(String qualifiedName) { + this.qualifiedName = qualifiedName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model MongoDbObjectInfo")); + } + if (qualifiedName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property qualifiedName in model MongoDbObjectInfo")); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbProgress.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbProgress.java new file mode 100644 index 000000000000..4984f75e0028 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbProgress.java @@ -0,0 +1,426 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Base class for MongoDB migration outputs. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "resultType", + defaultImpl = MongoDbProgress.class) +@JsonTypeName("MongoDbProgress") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Collection", value = MongoDbCollectionProgress.class), + @JsonSubTypes.Type(name = "Database", value = MongoDbDatabaseProgress.class), + @JsonSubTypes.Type(name = "Migration", value = MongoDbMigrationProgress.class) +}) +@Fluent +public class MongoDbProgress { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbProgress.class); + + /* + * The number of document bytes copied during the Copying stage + */ + @JsonProperty(value = "bytesCopied", required = true) + private long bytesCopied; + + /* + * The number of documents copied during the Copying stage + */ + @JsonProperty(value = "documentsCopied", required = true) + private long documentsCopied; + + /* + * The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan + * format) + */ + @JsonProperty(value = "elapsedTime", required = true) + private String elapsedTime; + + /* + * The errors and warnings that have occurred for the current object. The + * keys are the error codes. + */ + @JsonProperty(value = "errors", required = true) + private Map errors; + + /* + * The number of oplog events awaiting replay + */ + @JsonProperty(value = "eventsPending", required = true) + private long eventsPending; + + /* + * The number of oplog events replayed so far + */ + @JsonProperty(value = "eventsReplayed", required = true) + private long eventsReplayed; + + /* + * The timestamp of the last oplog event received, or null if no oplog + * event has been received yet + */ + @JsonProperty(value = "lastEventTime") + private OffsetDateTime lastEventTime; + + /* + * The timestamp of the last oplog event replayed, or null if no oplog + * event has been replayed yet + */ + @JsonProperty(value = "lastReplayTime") + private OffsetDateTime lastReplayTime; + + /* + * The name of the progress object. For a collection, this is the + * unqualified collection name. For a database, this is the database name. + * For the overall migration, this is null. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The qualified name of the progress object. For a collection, this is the + * database-qualified name. For a database, this is the database name. For + * the overall migration, this is null. + */ + @JsonProperty(value = "qualifiedName") + private String qualifiedName; + + /* + * The state property. + */ + @JsonProperty(value = "state", required = true) + private MongoDbMigrationState state; + + /* + * The total number of document bytes on the source at the beginning of the + * Copying stage, or -1 if the total size was unknown + */ + @JsonProperty(value = "totalBytes", required = true) + private long totalBytes; + + /* + * The total number of documents on the source at the beginning of the + * Copying stage, or -1 if the total count was unknown + */ + @JsonProperty(value = "totalDocuments", required = true) + private long totalDocuments; + + /** + * Get the bytesCopied property: The number of document bytes copied during the Copying stage. + * + * @return the bytesCopied value. + */ + public long bytesCopied() { + return this.bytesCopied; + } + + /** + * Set the bytesCopied property: The number of document bytes copied during the Copying stage. + * + * @param bytesCopied the bytesCopied value to set. + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withBytesCopied(long bytesCopied) { + this.bytesCopied = bytesCopied; + return this; + } + + /** + * Get the documentsCopied property: The number of documents copied during the Copying stage. + * + * @return the documentsCopied value. + */ + public long documentsCopied() { + return this.documentsCopied; + } + + /** + * Set the documentsCopied property: The number of documents copied during the Copying stage. + * + * @param documentsCopied the documentsCopied value to set. + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withDocumentsCopied(long documentsCopied) { + this.documentsCopied = documentsCopied; + return this; + } + + /** + * Get the elapsedTime property: The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format). + * + * @return the elapsedTime value. + */ + public String elapsedTime() { + return this.elapsedTime; + } + + /** + * Set the elapsedTime property: The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format). + * + * @param elapsedTime the elapsedTime value to set. + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withElapsedTime(String elapsedTime) { + this.elapsedTime = elapsedTime; + return this; + } + + /** + * Get the errors property: The errors and warnings that have occurred for the current object. The keys are the + * error codes. + * + * @return the errors value. + */ + public Map errors() { + return this.errors; + } + + /** + * Set the errors property: The errors and warnings that have occurred for the current object. The keys are the + * error codes. + * + * @param errors the errors value to set. + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withErrors(Map errors) { + this.errors = errors; + return this; + } + + /** + * Get the eventsPending property: The number of oplog events awaiting replay. + * + * @return the eventsPending value. + */ + public long eventsPending() { + return this.eventsPending; + } + + /** + * Set the eventsPending property: The number of oplog events awaiting replay. + * + * @param eventsPending the eventsPending value to set. + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withEventsPending(long eventsPending) { + this.eventsPending = eventsPending; + return this; + } + + /** + * Get the eventsReplayed property: The number of oplog events replayed so far. + * + * @return the eventsReplayed value. + */ + public long eventsReplayed() { + return this.eventsReplayed; + } + + /** + * Set the eventsReplayed property: The number of oplog events replayed so far. + * + * @param eventsReplayed the eventsReplayed value to set. + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withEventsReplayed(long eventsReplayed) { + this.eventsReplayed = eventsReplayed; + return this; + } + + /** + * Get the lastEventTime property: The timestamp of the last oplog event received, or null if no oplog event has + * been received yet. + * + * @return the lastEventTime value. + */ + public OffsetDateTime lastEventTime() { + return this.lastEventTime; + } + + /** + * Set the lastEventTime property: The timestamp of the last oplog event received, or null if no oplog event has + * been received yet. + * + * @param lastEventTime the lastEventTime value to set. + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withLastEventTime(OffsetDateTime lastEventTime) { + this.lastEventTime = lastEventTime; + return this; + } + + /** + * Get the lastReplayTime property: The timestamp of the last oplog event replayed, or null if no oplog event has + * been replayed yet. + * + * @return the lastReplayTime value. + */ + public OffsetDateTime lastReplayTime() { + return this.lastReplayTime; + } + + /** + * Set the lastReplayTime property: The timestamp of the last oplog event replayed, or null if no oplog event has + * been replayed yet. + * + * @param lastReplayTime the lastReplayTime value to set. + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withLastReplayTime(OffsetDateTime lastReplayTime) { + this.lastReplayTime = lastReplayTime; + return this; + } + + /** + * Get the name property: The name of the progress object. For a collection, this is the unqualified collection + * name. For a database, this is the database name. For the overall migration, this is null. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the progress object. For a collection, this is the unqualified collection + * name. For a database, this is the database name. For the overall migration, this is null. + * + * @param name the name value to set. + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withName(String name) { + this.name = name; + return this; + } + + /** + * Get the qualifiedName property: The qualified name of the progress object. For a collection, this is the + * database-qualified name. For a database, this is the database name. For the overall migration, this is null. + * + * @return the qualifiedName value. + */ + public String qualifiedName() { + return this.qualifiedName; + } + + /** + * Set the qualifiedName property: The qualified name of the progress object. For a collection, this is the + * database-qualified name. For a database, this is the database name. For the overall migration, this is null. + * + * @param qualifiedName the qualifiedName value to set. + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withQualifiedName(String qualifiedName) { + this.qualifiedName = qualifiedName; + return this; + } + + /** + * Get the state property: The state property. + * + * @return the state value. + */ + public MongoDbMigrationState state() { + return this.state; + } + + /** + * Set the state property: The state property. + * + * @param state the state value to set. + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withState(MongoDbMigrationState state) { + this.state = state; + return this; + } + + /** + * Get the totalBytes property: The total number of document bytes on the source at the beginning of the Copying + * stage, or -1 if the total size was unknown. + * + * @return the totalBytes value. + */ + public long totalBytes() { + return this.totalBytes; + } + + /** + * Set the totalBytes property: The total number of document bytes on the source at the beginning of the Copying + * stage, or -1 if the total size was unknown. + * + * @param totalBytes the totalBytes value to set. + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withTotalBytes(long totalBytes) { + this.totalBytes = totalBytes; + return this; + } + + /** + * Get the totalDocuments property: The total number of documents on the source at the beginning of the Copying + * stage, or -1 if the total count was unknown. + * + * @return the totalDocuments value. + */ + public long totalDocuments() { + return this.totalDocuments; + } + + /** + * Set the totalDocuments property: The total number of documents on the source at the beginning of the Copying + * stage, or -1 if the total count was unknown. + * + * @param totalDocuments the totalDocuments value to set. + * @return the MongoDbProgress object itself. + */ + public MongoDbProgress withTotalDocuments(long totalDocuments) { + this.totalDocuments = totalDocuments; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (elapsedTime() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property elapsedTime in model MongoDbProgress")); + } + if (errors() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property errors in model MongoDbProgress")); + } else { + errors() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (state() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property state in model MongoDbProgress")); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbProgressResultType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbProgressResultType.java new file mode 100644 index 000000000000..c2b4d188d7dc --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbProgressResultType.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MongoDbProgressResultType. */ +public final class MongoDbProgressResultType extends ExpandableStringEnum { + /** Static value Migration for MongoDbProgressResultType. */ + public static final MongoDbProgressResultType MIGRATION = fromString("Migration"); + + /** Static value Database for MongoDbProgressResultType. */ + public static final MongoDbProgressResultType DATABASE = fromString("Database"); + + /** Static value Collection for MongoDbProgressResultType. */ + public static final MongoDbProgressResultType COLLECTION = fromString("Collection"); + + /** + * Creates or finds a MongoDbProgressResultType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MongoDbProgressResultType. + */ + @JsonCreator + public static MongoDbProgressResultType fromString(String name) { + return fromString(name, MongoDbProgressResultType.class); + } + + /** @return known MongoDbProgressResultType values. */ + public static Collection values() { + return values(MongoDbProgressResultType.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbReplication.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbReplication.java new file mode 100644 index 000000000000..4fcd63d10475 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbReplication.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MongoDbReplication. */ +public final class MongoDbReplication extends ExpandableStringEnum { + /** Static value Disabled for MongoDbReplication. */ + public static final MongoDbReplication DISABLED = fromString("Disabled"); + + /** Static value OneTime for MongoDbReplication. */ + public static final MongoDbReplication ONE_TIME = fromString("OneTime"); + + /** Static value Continuous for MongoDbReplication. */ + public static final MongoDbReplication CONTINUOUS = fromString("Continuous"); + + /** + * Creates or finds a MongoDbReplication from its string representation. + * + * @param name a name to look for. + * @return the corresponding MongoDbReplication. + */ + @JsonCreator + public static MongoDbReplication fromString(String name) { + return fromString(name, MongoDbReplication.class); + } + + /** @return known MongoDbReplication values. */ + public static Collection values() { + return values(MongoDbReplication.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbRestartCommand.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbRestartCommand.java new file mode 100644 index 000000000000..bafda0798e52 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbRestartCommand.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.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Properties for the command that restarts a migration in whole or in part. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "commandType") +@JsonTypeName("restart") +@Fluent +public final class MongoDbRestartCommand extends CommandPropertiesInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbRestartCommand.class); + + /* + * Command input + */ + @JsonProperty(value = "input") + private MongoDbCommandInput input; + + /** + * Get the input property: Command input. + * + * @return the input value. + */ + public MongoDbCommandInput input() { + return this.input; + } + + /** + * Set the input property: Command input. + * + * @param input the input value to set. + * @return the MongoDbRestartCommand object itself. + */ + public MongoDbRestartCommand withInput(MongoDbCommandInput input) { + this.input = input; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyField.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyField.java new file mode 100644 index 000000000000..5f8c6333db70 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyField.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.datamigration.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; + +/** Describes a field reference within a MongoDB shard key. */ +@Fluent +public final class MongoDbShardKeyField { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbShardKeyField.class); + + /* + * The name of the field + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The field ordering + */ + @JsonProperty(value = "order", required = true) + private MongoDbShardKeyOrder order; + + /** + * Get the name property: The name of the field. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the field. + * + * @param name the name value to set. + * @return the MongoDbShardKeyField object itself. + */ + public MongoDbShardKeyField withName(String name) { + this.name = name; + return this; + } + + /** + * Get the order property: The field ordering. + * + * @return the order value. + */ + public MongoDbShardKeyOrder order() { + return this.order; + } + + /** + * Set the order property: The field ordering. + * + * @param order the order value to set. + * @return the MongoDbShardKeyField object itself. + */ + public MongoDbShardKeyField withOrder(MongoDbShardKeyOrder order) { + this.order = order; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model MongoDbShardKeyField")); + } + if (order() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property order in model MongoDbShardKeyField")); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyInfo.java new file mode 100644 index 000000000000..ddb20e87f701 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyInfo.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.datamigration.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; + +/** Describes a MongoDB shard key. */ +@Fluent +public final class MongoDbShardKeyInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbShardKeyInfo.class); + + /* + * The fields within the shard key + */ + @JsonProperty(value = "fields", required = true) + private List fields; + + /* + * Whether the shard key is unique + */ + @JsonProperty(value = "isUnique", required = true) + private boolean isUnique; + + /** + * Get the fields property: The fields within the shard key. + * + * @return the fields value. + */ + public List fields() { + return this.fields; + } + + /** + * Set the fields property: The fields within the shard key. + * + * @param fields the fields value to set. + * @return the MongoDbShardKeyInfo object itself. + */ + public MongoDbShardKeyInfo withFields(List fields) { + this.fields = fields; + return this; + } + + /** + * Get the isUnique property: Whether the shard key is unique. + * + * @return the isUnique value. + */ + public boolean isUnique() { + return this.isUnique; + } + + /** + * Set the isUnique property: Whether the shard key is unique. + * + * @param isUnique the isUnique value to set. + * @return the MongoDbShardKeyInfo object itself. + */ + public MongoDbShardKeyInfo withIsUnique(boolean isUnique) { + this.isUnique = isUnique; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (fields() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property fields in model MongoDbShardKeyInfo")); + } else { + fields().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyOrder.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyOrder.java new file mode 100644 index 000000000000..7910d7390f7b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeyOrder.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MongoDbShardKeyOrder. */ +public final class MongoDbShardKeyOrder extends ExpandableStringEnum { + /** Static value Forward for MongoDbShardKeyOrder. */ + public static final MongoDbShardKeyOrder FORWARD = fromString("Forward"); + + /** Static value Reverse for MongoDbShardKeyOrder. */ + public static final MongoDbShardKeyOrder REVERSE = fromString("Reverse"); + + /** Static value Hashed for MongoDbShardKeyOrder. */ + public static final MongoDbShardKeyOrder HASHED = fromString("Hashed"); + + /** + * Creates or finds a MongoDbShardKeyOrder from its string representation. + * + * @param name a name to look for. + * @return the corresponding MongoDbShardKeyOrder. + */ + @JsonCreator + public static MongoDbShardKeyOrder fromString(String name) { + return fromString(name, MongoDbShardKeyOrder.class); + } + + /** @return known MongoDbShardKeyOrder values. */ + public static Collection values() { + return values(MongoDbShardKeyOrder.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeySetting.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeySetting.java new file mode 100644 index 000000000000..68a7af1a2ff4 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbShardKeySetting.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.datamigration.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; + +/** Describes a MongoDB shard key. */ +@Fluent +public final class MongoDbShardKeySetting { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbShardKeySetting.class); + + /* + * The fields within the shard key + */ + @JsonProperty(value = "fields", required = true) + private List fields; + + /* + * Whether the shard key is unique + */ + @JsonProperty(value = "isUnique", required = true) + private boolean isUnique; + + /** + * Get the fields property: The fields within the shard key. + * + * @return the fields value. + */ + public List fields() { + return this.fields; + } + + /** + * Set the fields property: The fields within the shard key. + * + * @param fields the fields value to set. + * @return the MongoDbShardKeySetting object itself. + */ + public MongoDbShardKeySetting withFields(List fields) { + this.fields = fields; + return this; + } + + /** + * Get the isUnique property: Whether the shard key is unique. + * + * @return the isUnique value. + */ + public boolean isUnique() { + return this.isUnique; + } + + /** + * Set the isUnique property: Whether the shard key is unique. + * + * @param isUnique the isUnique value to set. + * @return the MongoDbShardKeySetting object itself. + */ + public MongoDbShardKeySetting withIsUnique(boolean isUnique) { + this.isUnique = isUnique; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (fields() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property fields in model MongoDbShardKeySetting")); + } else { + fields().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbThrottlingSettings.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbThrottlingSettings.java new file mode 100644 index 000000000000..73fa1cd2295f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MongoDbThrottlingSettings.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 resource limits for the migration. */ +@Fluent +public final class MongoDbThrottlingSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MongoDbThrottlingSettings.class); + + /* + * The percentage of CPU time that the migrator will try to avoid using, + * from 0 to 100 + */ + @JsonProperty(value = "minFreeCpu") + private Integer minFreeCpu; + + /* + * The number of megabytes of RAM that the migrator will try to avoid using + */ + @JsonProperty(value = "minFreeMemoryMb") + private Integer minFreeMemoryMb; + + /* + * The maximum number of work items (e.g. collection copies) that will be + * processed in parallel + */ + @JsonProperty(value = "maxParallelism") + private Integer maxParallelism; + + /** + * Get the minFreeCpu property: The percentage of CPU time that the migrator will try to avoid using, from 0 to 100. + * + * @return the minFreeCpu value. + */ + public Integer minFreeCpu() { + return this.minFreeCpu; + } + + /** + * Set the minFreeCpu property: The percentage of CPU time that the migrator will try to avoid using, from 0 to 100. + * + * @param minFreeCpu the minFreeCpu value to set. + * @return the MongoDbThrottlingSettings object itself. + */ + public MongoDbThrottlingSettings withMinFreeCpu(Integer minFreeCpu) { + this.minFreeCpu = minFreeCpu; + return this; + } + + /** + * Get the minFreeMemoryMb property: The number of megabytes of RAM that the migrator will try to avoid using. + * + * @return the minFreeMemoryMb value. + */ + public Integer minFreeMemoryMb() { + return this.minFreeMemoryMb; + } + + /** + * Set the minFreeMemoryMb property: The number of megabytes of RAM that the migrator will try to avoid using. + * + * @param minFreeMemoryMb the minFreeMemoryMb value to set. + * @return the MongoDbThrottlingSettings object itself. + */ + public MongoDbThrottlingSettings withMinFreeMemoryMb(Integer minFreeMemoryMb) { + this.minFreeMemoryMb = minFreeMemoryMb; + return this; + } + + /** + * Get the maxParallelism property: The maximum number of work items (e.g. collection copies) that will be processed + * in parallel. + * + * @return the maxParallelism value. + */ + public Integer maxParallelism() { + return this.maxParallelism; + } + + /** + * Set the maxParallelism property: The maximum number of work items (e.g. collection copies) that will be processed + * in parallel. + * + * @param maxParallelism the maxParallelism value to set. + * @return the MongoDbThrottlingSettings object itself. + */ + public MongoDbThrottlingSettings withMaxParallelism(Integer maxParallelism) { + this.maxParallelism = maxParallelism; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MySqlConnectionInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MySqlConnectionInfo.java new file mode 100644 index 000000000000..518b33307b0b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MySqlConnectionInfo.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Information for connecting to MySQL server. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("MySqlConnectionInfo") +@Fluent +public final class MySqlConnectionInfo extends ConnectionInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MySqlConnectionInfo.class); + + /* + * Name of the server + */ + @JsonProperty(value = "serverName", required = true) + private String serverName; + + /* + * Port for Server + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * Get the serverName property: Name of the server. + * + * @return the serverName value. + */ + public String serverName() { + return this.serverName; + } + + /** + * Set the serverName property: Name of the server. + * + * @param serverName the serverName value to set. + * @return the MySqlConnectionInfo object itself. + */ + public MySqlConnectionInfo withServerName(String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Get the port property: Port for Server. + * + * @return the port value. + */ + public int port() { + return this.port; + } + + /** + * Set the port property: Port for Server. + * + * @param port the port value to set. + * @return the MySqlConnectionInfo object itself. + */ + public MySqlConnectionInfo withPort(int port) { + this.port = port; + return this; + } + + /** {@inheritDoc} */ + @Override + public MySqlConnectionInfo withUsername(String username) { + super.withUsername(username); + return this; + } + + /** {@inheritDoc} */ + @Override + public MySqlConnectionInfo withPassword(String password) { + super.withPassword(password); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (serverName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property serverName in model MySqlConnectionInfo")); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MySqlTargetPlatformType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MySqlTargetPlatformType.java new file mode 100644 index 000000000000..aaa2c44e2abe --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/MySqlTargetPlatformType.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MySqlTargetPlatformType. */ +public final class MySqlTargetPlatformType extends ExpandableStringEnum { + /** Static value SqlServer for MySqlTargetPlatformType. */ + public static final MySqlTargetPlatformType SQL_SERVER = fromString("SqlServer"); + + /** Static value AzureDbForMySQL for MySqlTargetPlatformType. */ + public static final MySqlTargetPlatformType AZURE_DB_FOR_MY_SQL = fromString("AzureDbForMySQL"); + + /** + * Creates or finds a MySqlTargetPlatformType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MySqlTargetPlatformType. + */ + @JsonCreator + public static MySqlTargetPlatformType fromString(String name) { + return fromString(name, MySqlTargetPlatformType.class); + } + + /** @return known MySqlTargetPlatformType values. */ + public static Collection values() { + return values(MySqlTargetPlatformType.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NameAvailabilityRequest.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NameAvailabilityRequest.java new file mode 100644 index 000000000000..55bf91ac9921 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NameAvailabilityRequest.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.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A resource type and proposed name. */ +@Fluent +public final class NameAvailabilityRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NameAvailabilityRequest.class); + + /* + * The proposed resource name + */ + @JsonProperty(value = "name") + private String name; + + /* + * The resource type chain (e.g. virtualMachines/extensions) + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the name property: The proposed resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The proposed resource name. + * + * @param name the name value to set. + * @return the NameAvailabilityRequest object itself. + */ + public NameAvailabilityRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The resource type chain (e.g. virtualMachines/extensions). + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The resource type chain (e.g. virtualMachines/extensions). + * + * @param type the type value to set. + * @return the NameAvailabilityRequest object itself. + */ + public NameAvailabilityRequest withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NameAvailabilityResponse.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NameAvailabilityResponse.java new file mode 100644 index 000000000000..8479a9f754c0 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NameAvailabilityResponse.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.datamigration.models; + +import com.azure.resourcemanager.datamigration.fluent.models.NameAvailabilityResponseInner; + +/** An immutable client-side representation of NameAvailabilityResponse. */ +public interface NameAvailabilityResponse { + /** + * Gets the nameAvailable property: If true, the name is valid and available. If false, 'reason' describes why not. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the reason property: The reason why the name is not available, if nameAvailable is false. + * + * @return the reason value. + */ + NameCheckFailureReason reason(); + + /** + * Gets the message property: The localized reason why the name is not available, if nameAvailable is false. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.NameAvailabilityResponseInner object. + * + * @return the inner object. + */ + NameAvailabilityResponseInner innerModel(); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NameCheckFailureReason.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NameCheckFailureReason.java new file mode 100644 index 000000000000..8fbbb3d9f1e5 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NameCheckFailureReason.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NameCheckFailureReason. */ +public final class NameCheckFailureReason extends ExpandableStringEnum { + /** Static value AlreadyExists for NameCheckFailureReason. */ + public static final NameCheckFailureReason ALREADY_EXISTS = fromString("AlreadyExists"); + + /** Static value Invalid for NameCheckFailureReason. */ + public static final NameCheckFailureReason INVALID = fromString("Invalid"); + + /** + * Creates or finds a NameCheckFailureReason from its string representation. + * + * @param name a name to look for. + * @return the corresponding NameCheckFailureReason. + */ + @JsonCreator + public static NameCheckFailureReason fromString(String name) { + return fromString(name, NameCheckFailureReason.class); + } + + /** @return known NameCheckFailureReason values. */ + public static Collection values() { + return values(NameCheckFailureReason.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NonSqlDataMigrationTable.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NonSqlDataMigrationTable.java new file mode 100644 index 000000000000..525bb1fc56b3 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/NonSqlDataMigrationTable.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Defines metadata for table to be migrated. */ +@Fluent +public final class NonSqlDataMigrationTable { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NonSqlDataMigrationTable.class); + + /* + * Source table name + */ + @JsonProperty(value = "sourceName") + private String sourceName; + + /** + * Get the sourceName property: Source table name. + * + * @return the sourceName value. + */ + public String sourceName() { + return this.sourceName; + } + + /** + * Set the sourceName property: Source table name. + * + * @param sourceName the sourceName value to set. + * @return the NonSqlDataMigrationTable object itself. + */ + public NonSqlDataMigrationTable withSourceName(String sourceName) { + this.sourceName = sourceName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ObjectType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ObjectType.java new file mode 100644 index 000000000000..82b63798030a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ObjectType.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ObjectType. */ +public final class ObjectType extends ExpandableStringEnum { + /** Static value StoredProcedures for ObjectType. */ + public static final ObjectType STORED_PROCEDURES = fromString("StoredProcedures"); + + /** Static value Table for ObjectType. */ + public static final ObjectType TABLE = fromString("Table"); + + /** Static value User for ObjectType. */ + public static final ObjectType USER = fromString("User"); + + /** Static value View for ObjectType. */ + public static final ObjectType VIEW = fromString("View"); + + /** Static value Function for ObjectType. */ + public static final ObjectType FUNCTION = fromString("Function"); + + /** + * Creates or finds a ObjectType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ObjectType. + */ + @JsonCreator + public static ObjectType fromString(String name) { + return fromString(name, ObjectType.class); + } + + /** @return known ObjectType values. */ + public static Collection values() { + return values(ObjectType.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Operations.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Operations.java new file mode 100644 index 000000000000..6e63337c3a47 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/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.datamigration.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all available actions exposed by the Database Migration Service resource provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of action (operation) objects. + */ + PagedIterable list(); + + /** + * Lists all available actions exposed by the Database Migration Service resource provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of action (operation) objects. + */ + PagedIterable list(Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OracleConnectionInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OracleConnectionInfo.java new file mode 100644 index 000000000000..93f67997b300 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OracleConnectionInfo.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Information for connecting to Oracle server. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("OracleConnectionInfo") +@Fluent +public final class OracleConnectionInfo extends ConnectionInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OracleConnectionInfo.class); + + /* + * EZConnect or TNSName connection string. + */ + @JsonProperty(value = "dataSource", required = true) + private String dataSource; + + /** + * Get the dataSource property: EZConnect or TNSName connection string. + * + * @return the dataSource value. + */ + public String dataSource() { + return this.dataSource; + } + + /** + * Set the dataSource property: EZConnect or TNSName connection string. + * + * @param dataSource the dataSource value to set. + * @return the OracleConnectionInfo object itself. + */ + public OracleConnectionInfo withDataSource(String dataSource) { + this.dataSource = dataSource; + return this; + } + + /** {@inheritDoc} */ + @Override + public OracleConnectionInfo withUsername(String username) { + super.withUsername(username); + return this; + } + + /** {@inheritDoc} */ + @Override + public OracleConnectionInfo withPassword(String password) { + super.withPassword(password); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dataSource() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property dataSource in model OracleConnectionInfo")); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OracleOciDriverInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OracleOciDriverInfo.java new file mode 100644 index 000000000000..24535c7f73c8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OracleOciDriverInfo.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Information about an Oracle OCI driver. */ +@Immutable +public final class OracleOciDriverInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OracleOciDriverInfo.class); + + /* + * The name of the driver package + */ + @JsonProperty(value = "driverName", access = JsonProperty.Access.WRITE_ONLY) + private String driverName; + + /* + * The size in bytes of the driver package + */ + @JsonProperty(value = "driverSize", access = JsonProperty.Access.WRITE_ONLY) + private String driverSize; + + /* + * The MD5 Base64 encoded checksum for the driver package. + */ + @JsonProperty(value = "archiveChecksum", access = JsonProperty.Access.WRITE_ONLY) + private String archiveChecksum; + + /* + * The checksum for the driver package provided by Oracle. + */ + @JsonProperty(value = "oracleChecksum", access = JsonProperty.Access.WRITE_ONLY) + private String oracleChecksum; + + /* + * Version listed in the OCI assembly 'oci.dll' + */ + @JsonProperty(value = "assemblyVersion", access = JsonProperty.Access.WRITE_ONLY) + private String assemblyVersion; + + /* + * List of Oracle database versions supported by this driver. Only major + * minor of the version is listed. + */ + @JsonProperty(value = "supportedOracleVersions", access = JsonProperty.Access.WRITE_ONLY) + private List supportedOracleVersions; + + /** + * Get the driverName property: The name of the driver package. + * + * @return the driverName value. + */ + public String driverName() { + return this.driverName; + } + + /** + * Get the driverSize property: The size in bytes of the driver package. + * + * @return the driverSize value. + */ + public String driverSize() { + return this.driverSize; + } + + /** + * Get the archiveChecksum property: The MD5 Base64 encoded checksum for the driver package. + * + * @return the archiveChecksum value. + */ + public String archiveChecksum() { + return this.archiveChecksum; + } + + /** + * Get the oracleChecksum property: The checksum for the driver package provided by Oracle. + * + * @return the oracleChecksum value. + */ + public String oracleChecksum() { + return this.oracleChecksum; + } + + /** + * Get the assemblyVersion property: Version listed in the OCI assembly 'oci.dll'. + * + * @return the assemblyVersion value. + */ + public String assemblyVersion() { + return this.assemblyVersion; + } + + /** + * Get the supportedOracleVersions property: List of Oracle database versions supported by this driver. Only major + * minor of the version is listed. + * + * @return the supportedOracleVersions value. + */ + public List supportedOracleVersions() { + return this.supportedOracleVersions; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OrphanedUserInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OrphanedUserInfo.java new file mode 100644 index 000000000000..f1664b46a21b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/OrphanedUserInfo.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.datamigration.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; + +/** Information of orphaned users on the SQL server database. */ +@Fluent +public final class OrphanedUserInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OrphanedUserInfo.class); + + /* + * Name of the orphaned user + */ + @JsonProperty(value = "name") + private String name; + + /* + * Parent database of the user + */ + @JsonProperty(value = "databaseName") + private String databaseName; + + /** + * Get the name property: Name of the orphaned user. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the orphaned user. + * + * @param name the name value to set. + * @return the OrphanedUserInfo object itself. + */ + public OrphanedUserInfo withName(String name) { + this.name = name; + return this; + } + + /** + * Get the databaseName property: Parent database of the user. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: Parent database of the user. + * + * @param databaseName the databaseName value to set. + * @return the OrphanedUserInfo object itself. + */ + public OrphanedUserInfo withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/PostgreSqlConnectionInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/PostgreSqlConnectionInfo.java new file mode 100644 index 000000000000..3f958d176617 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/PostgreSqlConnectionInfo.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Information for connecting to PostgreSQL server. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("PostgreSqlConnectionInfo") +@Fluent +public final class PostgreSqlConnectionInfo extends ConnectionInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PostgreSqlConnectionInfo.class); + + /* + * Name of the server + */ + @JsonProperty(value = "serverName", required = true) + private String serverName; + + /* + * Name of the database + */ + @JsonProperty(value = "databaseName") + private String databaseName; + + /* + * Port for Server + */ + @JsonProperty(value = "port", required = true) + private int port; + + /* + * Whether to encrypt the connection + */ + @JsonProperty(value = "encryptConnection") + private Boolean encryptConnection; + + /* + * Whether to trust the server certificate + */ + @JsonProperty(value = "trustServerCertificate") + private Boolean trustServerCertificate; + + /** + * Get the serverName property: Name of the server. + * + * @return the serverName value. + */ + public String serverName() { + return this.serverName; + } + + /** + * Set the serverName property: Name of the server. + * + * @param serverName the serverName value to set. + * @return the PostgreSqlConnectionInfo object itself. + */ + public PostgreSqlConnectionInfo withServerName(String serverName) { + this.serverName = serverName; + return this; + } + + /** + * Get the databaseName property: Name of the database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: Name of the database. + * + * @param databaseName the databaseName value to set. + * @return the PostgreSqlConnectionInfo object itself. + */ + public PostgreSqlConnectionInfo withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the port property: Port for Server. + * + * @return the port value. + */ + public int port() { + return this.port; + } + + /** + * Set the port property: Port for Server. + * + * @param port the port value to set. + * @return the PostgreSqlConnectionInfo object itself. + */ + public PostgreSqlConnectionInfo withPort(int port) { + this.port = port; + return this; + } + + /** + * Get the encryptConnection property: Whether to encrypt the connection. + * + * @return the encryptConnection value. + */ + public Boolean encryptConnection() { + return this.encryptConnection; + } + + /** + * Set the encryptConnection property: Whether to encrypt the connection. + * + * @param encryptConnection the encryptConnection value to set. + * @return the PostgreSqlConnectionInfo object itself. + */ + public PostgreSqlConnectionInfo withEncryptConnection(Boolean encryptConnection) { + this.encryptConnection = encryptConnection; + return this; + } + + /** + * Get the trustServerCertificate property: Whether to trust the server certificate. + * + * @return the trustServerCertificate value. + */ + public Boolean trustServerCertificate() { + return this.trustServerCertificate; + } + + /** + * Set the trustServerCertificate property: Whether to trust the server certificate. + * + * @param trustServerCertificate the trustServerCertificate value to set. + * @return the PostgreSqlConnectionInfo object itself. + */ + public PostgreSqlConnectionInfo withTrustServerCertificate(Boolean trustServerCertificate) { + this.trustServerCertificate = trustServerCertificate; + return this; + } + + /** {@inheritDoc} */ + @Override + public PostgreSqlConnectionInfo withUsername(String username) { + super.withUsername(username); + return this; + } + + /** {@inheritDoc} */ + @Override + public PostgreSqlConnectionInfo withPassword(String password) { + super.withPassword(password); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (serverName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property serverName in model PostgreSqlConnectionInfo")); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Project.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Project.java new file mode 100644 index 000000000000..2705bd5a413f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Project.java @@ -0,0 +1,356 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Project. */ +public interface Project { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the sourcePlatform property: Source platform for the project. + * + * @return the sourcePlatform value. + */ + ProjectSourcePlatform sourcePlatform(); + + /** + * Gets the targetPlatform property: Target platform for the project. + * + * @return the targetPlatform value. + */ + ProjectTargetPlatform targetPlatform(); + + /** + * Gets the creationTime property: UTC Date and time when project was created. + * + * @return the creationTime value. + */ + OffsetDateTime creationTime(); + + /** + * Gets the sourceConnectionInfo property: Information for connecting to source. + * + * @return the sourceConnectionInfo value. + */ + ConnectionInfo sourceConnectionInfo(); + + /** + * Gets the targetConnectionInfo property: Information for connecting to target. + * + * @return the targetConnectionInfo value. + */ + ConnectionInfo targetConnectionInfo(); + + /** + * Gets the databasesInfo property: List of DatabaseInfo. + * + * @return the databasesInfo value. + */ + List databasesInfo(); + + /** + * Gets the provisioningState property: The project's provisioning state. + * + * @return the provisioningState value. + */ + ProjectProvisioningState provisioningState(); + + /** + * 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.datamigration.fluent.models.ProjectInner object. + * + * @return the inner object. + */ + ProjectInner innerModel(); + + /** The entirety of the Project definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The Project definition stages. */ + interface DefinitionStages { + /** The first stage of the Project definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Project definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the Project definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies groupName, serviceName. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @return the next definition stage. + */ + WithCreate withExistingService(String groupName, String serviceName); + } + /** + * The stage of the Project 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.WithSourcePlatform, + DefinitionStages.WithTargetPlatform, + DefinitionStages.WithSourceConnectionInfo, + DefinitionStages.WithTargetConnectionInfo, + DefinitionStages.WithDatabasesInfo { + /** + * Executes the create request. + * + * @return the created resource. + */ + Project create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Project create(Context context); + } + /** The stage of the Project definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Project definition allowing to specify sourcePlatform. */ + interface WithSourcePlatform { + /** + * Specifies the sourcePlatform property: Source platform for the project. + * + * @param sourcePlatform Source platform for the project. + * @return the next definition stage. + */ + WithCreate withSourcePlatform(ProjectSourcePlatform sourcePlatform); + } + /** The stage of the Project definition allowing to specify targetPlatform. */ + interface WithTargetPlatform { + /** + * Specifies the targetPlatform property: Target platform for the project. + * + * @param targetPlatform Target platform for the project. + * @return the next definition stage. + */ + WithCreate withTargetPlatform(ProjectTargetPlatform targetPlatform); + } + /** The stage of the Project definition allowing to specify sourceConnectionInfo. */ + interface WithSourceConnectionInfo { + /** + * Specifies the sourceConnectionInfo property: Information for connecting to source. + * + * @param sourceConnectionInfo Information for connecting to source. + * @return the next definition stage. + */ + WithCreate withSourceConnectionInfo(ConnectionInfo sourceConnectionInfo); + } + /** The stage of the Project definition allowing to specify targetConnectionInfo. */ + interface WithTargetConnectionInfo { + /** + * Specifies the targetConnectionInfo property: Information for connecting to target. + * + * @param targetConnectionInfo Information for connecting to target. + * @return the next definition stage. + */ + WithCreate withTargetConnectionInfo(ConnectionInfo targetConnectionInfo); + } + /** The stage of the Project definition allowing to specify databasesInfo. */ + interface WithDatabasesInfo { + /** + * Specifies the databasesInfo property: List of DatabaseInfo. + * + * @param databasesInfo List of DatabaseInfo. + * @return the next definition stage. + */ + WithCreate withDatabasesInfo(List databasesInfo); + } + } + /** + * Begins update for the Project resource. + * + * @return the stage of resource update. + */ + Project.Update update(); + + /** The template for Project update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithSourcePlatform, + UpdateStages.WithTargetPlatform, + UpdateStages.WithSourceConnectionInfo, + UpdateStages.WithTargetConnectionInfo, + UpdateStages.WithDatabasesInfo { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Project apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Project apply(Context context); + } + /** The Project update stages. */ + interface UpdateStages { + /** The stage of the Project update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Project update allowing to specify sourcePlatform. */ + interface WithSourcePlatform { + /** + * Specifies the sourcePlatform property: Source platform for the project. + * + * @param sourcePlatform Source platform for the project. + * @return the next definition stage. + */ + Update withSourcePlatform(ProjectSourcePlatform sourcePlatform); + } + /** The stage of the Project update allowing to specify targetPlatform. */ + interface WithTargetPlatform { + /** + * Specifies the targetPlatform property: Target platform for the project. + * + * @param targetPlatform Target platform for the project. + * @return the next definition stage. + */ + Update withTargetPlatform(ProjectTargetPlatform targetPlatform); + } + /** The stage of the Project update allowing to specify sourceConnectionInfo. */ + interface WithSourceConnectionInfo { + /** + * Specifies the sourceConnectionInfo property: Information for connecting to source. + * + * @param sourceConnectionInfo Information for connecting to source. + * @return the next definition stage. + */ + Update withSourceConnectionInfo(ConnectionInfo sourceConnectionInfo); + } + /** The stage of the Project update allowing to specify targetConnectionInfo. */ + interface WithTargetConnectionInfo { + /** + * Specifies the targetConnectionInfo property: Information for connecting to target. + * + * @param targetConnectionInfo Information for connecting to target. + * @return the next definition stage. + */ + Update withTargetConnectionInfo(ConnectionInfo targetConnectionInfo); + } + /** The stage of the Project update allowing to specify databasesInfo. */ + interface WithDatabasesInfo { + /** + * Specifies the databasesInfo property: List of DatabaseInfo. + * + * @param databasesInfo List of DatabaseInfo. + * @return the next definition stage. + */ + Update withDatabasesInfo(List databasesInfo); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Project refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Project refresh(Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectFile.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectFile.java new file mode 100644 index 000000000000..adfa7d06d37b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectFile.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectFileInner; + +/** An immutable client-side representation of ProjectFile. */ +public interface ProjectFile { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: HTTP strong entity tag value. This is ignored if submitted. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the properties property: Custom file properties. + * + * @return the properties value. + */ + ProjectFileProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.ProjectFileInner object. + * + * @return the inner object. + */ + ProjectFileInner innerModel(); + + /** The entirety of the ProjectFile definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ProjectFile definition stages. */ + interface DefinitionStages { + /** The first stage of the ProjectFile definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ProjectFile definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies groupName, serviceName, projectName. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @return the next definition stage. + */ + WithCreate withExistingProject(String groupName, String serviceName, String projectName); + } + /** + * The stage of the ProjectFile 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.WithEtag, DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ProjectFile create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ProjectFile create(Context context); + } + /** The stage of the ProjectFile definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: HTTP strong entity tag value. This is ignored if submitted.. + * + * @param etag HTTP strong entity tag value. This is ignored if submitted. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the ProjectFile definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Custom file properties. + * + * @param properties Custom file properties. + * @return the next definition stage. + */ + WithCreate withProperties(ProjectFileProperties properties); + } + } + /** + * Begins update for the ProjectFile resource. + * + * @return the stage of resource update. + */ + ProjectFile.Update update(); + + /** The template for ProjectFile update. */ + interface Update extends UpdateStages.WithEtag, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ProjectFile apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ProjectFile apply(Context context); + } + /** The ProjectFile update stages. */ + interface UpdateStages { + /** The stage of the ProjectFile update allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: HTTP strong entity tag value. This is ignored if submitted.. + * + * @param etag HTTP strong entity tag value. This is ignored if submitted. + * @return the next definition stage. + */ + Update withEtag(String etag); + } + /** The stage of the ProjectFile update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Custom file properties. + * + * @param properties Custom file properties. + * @return the next definition stage. + */ + Update withProperties(ProjectFileProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ProjectFile refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ProjectFile refresh(Context context); + + /** + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + FileStorageInfo read(); + + /** + * This method is used for requesting storage information using which contents of the file can be downloaded. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + Response readWithResponse(Context context); + + /** + * This method is used for requesting information for reading and writing the file content. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + FileStorageInfo readWrite(); + + /** + * This method is used for requesting information for reading and writing the file content. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file storage information. + */ + Response readWriteWithResponse(Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectFileProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectFileProperties.java new file mode 100644 index 000000000000..81d2a2465e91 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectFileProperties.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Base class for file properties. */ +@Fluent +public final class ProjectFileProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProjectFileProperties.class); + + /* + * Optional File extension. If submitted it should not have a leading + * period and must match the extension from filePath. + */ + @JsonProperty(value = "extension") + private String extension; + + /* + * Relative path of this file resource. This property can be set when + * creating or updating the file resource. + */ + @JsonProperty(value = "filePath") + private String filePath; + + /* + * Modification DateTime. + */ + @JsonProperty(value = "lastModified", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModified; + + /* + * File content type. This property can be modified to reflect the file + * content type. + */ + @JsonProperty(value = "mediaType") + private String mediaType; + + /* + * File size. + */ + @JsonProperty(value = "size", access = JsonProperty.Access.WRITE_ONLY) + private Long size; + + /** + * Get the extension property: Optional File extension. If submitted it should not have a leading period and must + * match the extension from filePath. + * + * @return the extension value. + */ + public String extension() { + return this.extension; + } + + /** + * Set the extension property: Optional File extension. If submitted it should not have a leading period and must + * match the extension from filePath. + * + * @param extension the extension value to set. + * @return the ProjectFileProperties object itself. + */ + public ProjectFileProperties withExtension(String extension) { + this.extension = extension; + return this; + } + + /** + * Get the filePath property: Relative path of this file resource. This property can be set when creating or + * updating the file resource. + * + * @return the filePath value. + */ + public String filePath() { + return this.filePath; + } + + /** + * Set the filePath property: Relative path of this file resource. This property can be set when creating or + * updating the file resource. + * + * @param filePath the filePath value to set. + * @return the ProjectFileProperties object itself. + */ + public ProjectFileProperties withFilePath(String filePath) { + this.filePath = filePath; + return this; + } + + /** + * Get the lastModified property: Modification DateTime. + * + * @return the lastModified value. + */ + public OffsetDateTime lastModified() { + return this.lastModified; + } + + /** + * Get the mediaType property: File content type. This property can be modified to reflect the file content type. + * + * @return the mediaType value. + */ + public String mediaType() { + return this.mediaType; + } + + /** + * Set the mediaType property: File content type. This property can be modified to reflect the file content type. + * + * @param mediaType the mediaType value to set. + * @return the ProjectFileProperties object itself. + */ + public ProjectFileProperties withMediaType(String mediaType) { + this.mediaType = mediaType; + return this; + } + + /** + * Get the size property: File size. + * + * @return the size value. + */ + public Long size() { + return this.size; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectList.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectList.java new file mode 100644 index 000000000000..16162653a1c9 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** OData page of project resources. */ +@Fluent +public final class ProjectList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProjectList.class); + + /* + * List of projects + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to load the next page of projects + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of projects. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of projects. + * + * @param value the value value to set. + * @return the ProjectList object itself. + */ + public ProjectList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to load the next page of projects. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to load the next page of projects. + * + * @param nextLink the nextLink value to set. + * @return the ProjectList object itself. + */ + public ProjectList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectProvisioningState.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectProvisioningState.java new file mode 100644 index 000000000000..def78d698184 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectProvisioningState.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProjectProvisioningState. */ +public final class ProjectProvisioningState extends ExpandableStringEnum { + /** Static value Deleting for ProjectProvisioningState. */ + public static final ProjectProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for ProjectProvisioningState. */ + public static final ProjectProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Creates or finds a ProjectProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProjectProvisioningState. + */ + @JsonCreator + public static ProjectProvisioningState fromString(String name) { + return fromString(name, ProjectProvisioningState.class); + } + + /** @return known ProjectProvisioningState values. */ + public static Collection values() { + return values(ProjectProvisioningState.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectSourcePlatform.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectSourcePlatform.java new file mode 100644 index 000000000000..b9c3605e7db0 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectSourcePlatform.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProjectSourcePlatform. */ +public final class ProjectSourcePlatform extends ExpandableStringEnum { + /** Static value SQL for ProjectSourcePlatform. */ + public static final ProjectSourcePlatform SQL = fromString("SQL"); + + /** Static value MySQL for ProjectSourcePlatform. */ + public static final ProjectSourcePlatform MY_SQL = fromString("MySQL"); + + /** Static value PostgreSql for ProjectSourcePlatform. */ + public static final ProjectSourcePlatform POSTGRE_SQL = fromString("PostgreSql"); + + /** Static value MongoDb for ProjectSourcePlatform. */ + public static final ProjectSourcePlatform MONGO_DB = fromString("MongoDb"); + + /** Static value Unknown for ProjectSourcePlatform. */ + public static final ProjectSourcePlatform UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a ProjectSourcePlatform from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProjectSourcePlatform. + */ + @JsonCreator + public static ProjectSourcePlatform fromString(String name) { + return fromString(name, ProjectSourcePlatform.class); + } + + /** @return known ProjectSourcePlatform values. */ + public static Collection values() { + return values(ProjectSourcePlatform.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectTargetPlatform.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectTargetPlatform.java new file mode 100644 index 000000000000..f92e8a3cc5b3 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectTargetPlatform.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProjectTargetPlatform. */ +public final class ProjectTargetPlatform extends ExpandableStringEnum { + /** Static value SQLDB for ProjectTargetPlatform. */ + public static final ProjectTargetPlatform SQLDB = fromString("SQLDB"); + + /** Static value SQLMI for ProjectTargetPlatform. */ + public static final ProjectTargetPlatform SQLMI = fromString("SQLMI"); + + /** Static value AzureDbForMySql for ProjectTargetPlatform. */ + public static final ProjectTargetPlatform AZURE_DB_FOR_MY_SQL = fromString("AzureDbForMySql"); + + /** Static value AzureDbForPostgreSql for ProjectTargetPlatform. */ + public static final ProjectTargetPlatform AZURE_DB_FOR_POSTGRE_SQL = fromString("AzureDbForPostgreSql"); + + /** Static value MongoDb for ProjectTargetPlatform. */ + public static final ProjectTargetPlatform MONGO_DB = fromString("MongoDb"); + + /** Static value Unknown for ProjectTargetPlatform. */ + public static final ProjectTargetPlatform UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a ProjectTargetPlatform from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProjectTargetPlatform. + */ + @JsonCreator + public static ProjectTargetPlatform fromString(String name) { + return fromString(name, ProjectTargetPlatform.class); + } + + /** @return known ProjectTargetPlatform values. */ + public static Collection values() { + return values(ProjectTargetPlatform.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectTask.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectTask.java new file mode 100644 index 000000000000..6edbbe91f454 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectTask.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner; + +/** An immutable client-side representation of ProjectTask. */ +public interface ProjectTask { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: HTTP strong entity tag value. This is ignored if submitted. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the properties property: Custom task properties. + * + * @return the properties value. + */ + ProjectTaskProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner object. + * + * @return the inner object. + */ + ProjectTaskInner innerModel(); + + /** The entirety of the ProjectTask definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ProjectTask definition stages. */ + interface DefinitionStages { + /** The first stage of the ProjectTask definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ProjectTask definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies groupName, serviceName, projectName. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @return the next definition stage. + */ + WithCreate withExistingProject(String groupName, String serviceName, String projectName); + } + /** + * The stage of the ProjectTask 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.WithEtag, DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ProjectTask create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ProjectTask create(Context context); + } + /** The stage of the ProjectTask definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: HTTP strong entity tag value. This is ignored if submitted.. + * + * @param etag HTTP strong entity tag value. This is ignored if submitted. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the ProjectTask definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Custom task properties. + * + * @param properties Custom task properties. + * @return the next definition stage. + */ + WithCreate withProperties(ProjectTaskProperties properties); + } + } + /** + * Begins update for the ProjectTask resource. + * + * @return the stage of resource update. + */ + ProjectTask.Update update(); + + /** The template for ProjectTask update. */ + interface Update extends UpdateStages.WithEtag, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ProjectTask apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ProjectTask apply(Context context); + } + /** The ProjectTask update stages. */ + interface UpdateStages { + /** The stage of the ProjectTask update allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: HTTP strong entity tag value. This is ignored if submitted.. + * + * @param etag HTTP strong entity tag value. This is ignored if submitted. + * @return the next definition stage. + */ + Update withEtag(String etag); + } + /** The stage of the ProjectTask update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Custom task properties. + * + * @param properties Custom task properties. + * @return the next definition stage. + */ + Update withProperties(ProjectTaskProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ProjectTask refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ProjectTask refresh(Context context); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * cancels a task if it's currently queued or running. + * + * @throws com.azure.core.management.exception.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 task resource. + */ + ProjectTask cancel(); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * cancels a task if it's currently queued or running. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 task resource. + */ + Response cancelWithResponse(Context context); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * executes a command on a running task. + * + * @param parameters Command to execute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for all types of DMS command properties. + */ + CommandProperties command(CommandPropertiesInner parameters); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * executes a command on a running task. + * + * @param parameters Command to execute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for all types of DMS command properties. + */ + Response commandWithResponse(CommandPropertiesInner parameters, Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectTaskProperties.java new file mode 100644 index 000000000000..3e44d3a97c8d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ProjectTaskProperties.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.models.CommandPropertiesInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** + * Base class for all types of DMS task properties. If task is not supported by current client, this object is returned. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "taskType", + defaultImpl = ProjectTaskProperties.class) +@JsonTypeName("ProjectTaskProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ConnectToSource.MySql", value = ConnectToSourceMySqlTaskProperties.class), + @JsonSubTypes.Type(name = "MigrateSchemaSqlServerSqlDb", value = MigrateSchemaSqlServerSqlDbTaskProperties.class), + @JsonSubTypes.Type(name = "Service.Check.OCI", value = CheckOciDriverTaskProperties.class), + @JsonSubTypes.Type(name = "Service.Upload.OCI", value = UploadOciDriverTaskProperties.class), + @JsonSubTypes.Type(name = "Service.Install.OCI", value = InstallOciDriverTaskProperties.class), + @JsonSubTypes.Type(name = "Connect.MongoDb", value = ConnectToMongoDbTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToSource.SqlServer", value = ConnectToSourceSqlServerTaskProperties.class), + @JsonSubTypes.Type( + name = "ConnectToSource.SqlServer.Sync", + value = ConnectToSourceSqlServerSyncTaskProperties.class), + @JsonSubTypes.Type( + name = "ConnectToSource.PostgreSql.Sync", + value = ConnectToSourcePostgreSqlSyncTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToSource.Oracle.Sync", value = ConnectToSourceOracleSyncTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToTarget.SqlDb", value = ConnectToTargetSqlDbTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToTarget.SqlDb.Sync", value = ConnectToTargetSqlDbSyncTaskProperties.class), + @JsonSubTypes.Type( + name = "ConnectToTarget.AzureDbForPostgreSql.Sync", + value = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties.class), + @JsonSubTypes.Type( + name = "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", + value = ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.class), + @JsonSubTypes.Type(name = "GetUserTables.Sql", value = GetUserTablesSqlTaskProperties.class), + @JsonSubTypes.Type(name = "GetUserTables.AzureSqlDb.Sync", value = GetUserTablesSqlSyncTaskProperties.class), + @JsonSubTypes.Type(name = "GetUserTablesOracle", value = GetUserTablesOracleTaskProperties.class), + @JsonSubTypes.Type(name = "GetUserTablesPostgreSql", value = GetUserTablesPostgreSqlTaskProperties.class), + @JsonSubTypes.Type(name = "ConnectToTarget.AzureSqlDbMI", value = ConnectToTargetSqlMITaskProperties.class), + @JsonSubTypes.Type( + name = "ConnectToTarget.AzureSqlDbMI.Sync.LRS", + value = ConnectToTargetSqlMISyncTaskProperties.class), + @JsonSubTypes.Type( + name = "ConnectToTarget.AzureDbForMySql", + value = ConnectToTargetAzureDbForMySqlTaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.MongoDb", value = MigrateMongoDbTaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.SqlServer.AzureSqlDbMI", value = MigrateSqlServerSqlMITaskProperties.class), + @JsonSubTypes.Type( + name = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS", + value = MigrateSqlServerSqlMISyncTaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.SqlServer.SqlDb", value = MigrateSqlServerSqlDbTaskProperties.class), + @JsonSubTypes.Type( + name = "Migrate.SqlServer.AzureSqlDb.Sync", + value = MigrateSqlServerSqlDbSyncTaskProperties.class), + @JsonSubTypes.Type( + name = "Migrate.MySql.AzureDbForMySql.Sync", + value = MigrateMySqlAzureDbForMySqlSyncTaskProperties.class), + @JsonSubTypes.Type( + name = "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", + value = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties.class), + @JsonSubTypes.Type( + name = "Migrate.Oracle.AzureDbForPostgreSql.Sync", + value = MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.class), + @JsonSubTypes.Type( + name = "ValidateMigrationInput.SqlServer.SqlDb.Sync", + value = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.class), + @JsonSubTypes.Type( + name = "ValidateMigrationInput.SqlServer.AzureSqlDbMI", + value = ValidateMigrationInputSqlServerSqlMITaskProperties.class), + @JsonSubTypes.Type( + name = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", + value = ValidateMigrationInputSqlServerSqlMISyncTaskProperties.class), + @JsonSubTypes.Type(name = "Validate.MongoDb", value = ValidateMongoDbTaskProperties.class), + @JsonSubTypes.Type( + name = "Validate.Oracle.AzureDbPostgreSql.Sync", + value = ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.class), + @JsonSubTypes.Type(name = "GetTDECertificates.Sql", value = GetTdeCertificatesSqlTaskProperties.class), + @JsonSubTypes.Type(name = "Migrate.Ssis", value = MigrateSsisTaskProperties.class) +}) +@Fluent +public class ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ProjectTaskProperties.class); + + /* + * Array of errors. This is ignored if submitted. + */ + @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) + private List errors; + + /* + * The state of the task. This is ignored if submitted. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private TaskState state; + + /* + * Array of command properties. + */ + @JsonProperty(value = "commands", access = JsonProperty.Access.WRITE_ONLY) + private List commands; + + /* + * Key value pairs of client data to attach meta data information to task + */ + @JsonProperty(value = "clientData") + private Map clientData; + + /** + * Get the errors property: Array of errors. This is ignored if submitted. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Get the state property: The state of the task. This is ignored if submitted. + * + * @return the state value. + */ + public TaskState state() { + return this.state; + } + + /** + * Get the commands property: Array of command properties. + * + * @return the commands value. + */ + public List commands() { + return this.commands; + } + + /** + * Get the clientData property: Key value pairs of client data to attach meta data information to task. + * + * @return the clientData value. + */ + public Map clientData() { + return this.clientData; + } + + /** + * Set the clientData property: Key value pairs of client data to attach meta data information to task. + * + * @param clientData the clientData value to set. + * @return the ProjectTaskProperties object itself. + */ + public ProjectTaskProperties withClientData(Map clientData) { + this.clientData = clientData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (commands() != null) { + commands().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Projects.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Projects.java new file mode 100644 index 000000000000..b1c53ab3ae13 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Projects.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.datamigration.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 Projects. */ +public interface Projects { + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * projects owned by a service resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of project resources. + */ + PagedIterable list(String groupName, String serviceName); + + /** + * The project resource is a nested resource representing a stored migration project. This method returns a list of + * projects owned by a service resource. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of project resources. + */ + PagedIterable list(String groupName, String serviceName, Context context); + + /** + * The project resource is a nested resource representing a stored migration project. The GET method retrieves + * information about a project. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 project resource. + */ + Project get(String groupName, String serviceName, String projectName); + + /** + * The project resource is a nested resource representing a stored migration project. The GET method retrieves + * information about a project. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 project resource. + */ + Response getWithResponse(String groupName, String serviceName, String projectName, Context context); + + /** + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a + * project. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 groupName, String serviceName, String projectName); + + /** + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a + * project. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String groupName, String serviceName, String projectName, Boolean deleteRunningTasks, Context context); + + /** + * The project resource is a nested resource representing a stored migration project. The GET method retrieves + * information about a project. + * + * @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 project resource. + */ + Project getById(String id); + + /** + * The project resource is a nested resource representing a stored migration project. The GET method retrieves + * information about a project. + * + * @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 project resource. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a + * project. + * + * @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); + + /** + * The project resource is a nested resource representing a stored migration project. The DELETE method deletes a + * project. + * + * @param id the resource ID. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Boolean deleteRunningTasks, Context context); + + /** + * Begins definition for a new Project resource. + * + * @param name resource name. + * @return the first stage of the new Project definition. + */ + Project.DefinitionStages.Blank define(String name); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QueryAnalysisValidationResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QueryAnalysisValidationResult.java new file mode 100644 index 000000000000..b6b0bbc6f6e7 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QueryAnalysisValidationResult.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Results for query analysis comparison between the source and target. */ +@Fluent +public final class QueryAnalysisValidationResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QueryAnalysisValidationResult.class); + + /* + * List of queries executed and it's execution results in source and target + */ + @JsonProperty(value = "queryResults") + private QueryExecutionResult queryResults; + + /* + * Errors that are part of the execution + */ + @JsonProperty(value = "validationErrors") + private ValidationError validationErrors; + + /** + * Get the queryResults property: List of queries executed and it's execution results in source and target. + * + * @return the queryResults value. + */ + public QueryExecutionResult queryResults() { + return this.queryResults; + } + + /** + * Set the queryResults property: List of queries executed and it's execution results in source and target. + * + * @param queryResults the queryResults value to set. + * @return the QueryAnalysisValidationResult object itself. + */ + public QueryAnalysisValidationResult withQueryResults(QueryExecutionResult queryResults) { + this.queryResults = queryResults; + return this; + } + + /** + * Get the validationErrors property: Errors that are part of the execution. + * + * @return the validationErrors value. + */ + public ValidationError validationErrors() { + return this.validationErrors; + } + + /** + * Set the validationErrors property: Errors that are part of the execution. + * + * @param validationErrors the validationErrors value to set. + * @return the QueryAnalysisValidationResult object itself. + */ + public QueryAnalysisValidationResult withValidationErrors(ValidationError validationErrors) { + this.validationErrors = validationErrors; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (queryResults() != null) { + queryResults().validate(); + } + if (validationErrors() != null) { + validationErrors().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QueryExecutionResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QueryExecutionResult.java new file mode 100644 index 000000000000..12afa6ab7878 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QueryExecutionResult.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.datamigration.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; + +/** Describes query analysis results for execution in source and target. */ +@Fluent +public final class QueryExecutionResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QueryExecutionResult.class); + + /* + * Query text retrieved from the source server + */ + @JsonProperty(value = "queryText") + private String queryText; + + /* + * Total no. of statements in the batch + */ + @JsonProperty(value = "statementsInBatch") + private Long statementsInBatch; + + /* + * Query analysis result from the source + */ + @JsonProperty(value = "sourceResult") + private ExecutionStatistics sourceResult; + + /* + * Query analysis result from the target + */ + @JsonProperty(value = "targetResult") + private ExecutionStatistics targetResult; + + /** + * Get the queryText property: Query text retrieved from the source server. + * + * @return the queryText value. + */ + public String queryText() { + return this.queryText; + } + + /** + * Set the queryText property: Query text retrieved from the source server. + * + * @param queryText the queryText value to set. + * @return the QueryExecutionResult object itself. + */ + public QueryExecutionResult withQueryText(String queryText) { + this.queryText = queryText; + return this; + } + + /** + * Get the statementsInBatch property: Total no. of statements in the batch. + * + * @return the statementsInBatch value. + */ + public Long statementsInBatch() { + return this.statementsInBatch; + } + + /** + * Set the statementsInBatch property: Total no. of statements in the batch. + * + * @param statementsInBatch the statementsInBatch value to set. + * @return the QueryExecutionResult object itself. + */ + public QueryExecutionResult withStatementsInBatch(Long statementsInBatch) { + this.statementsInBatch = statementsInBatch; + return this; + } + + /** + * Get the sourceResult property: Query analysis result from the source. + * + * @return the sourceResult value. + */ + public ExecutionStatistics sourceResult() { + return this.sourceResult; + } + + /** + * Set the sourceResult property: Query analysis result from the source. + * + * @param sourceResult the sourceResult value to set. + * @return the QueryExecutionResult object itself. + */ + public QueryExecutionResult withSourceResult(ExecutionStatistics sourceResult) { + this.sourceResult = sourceResult; + return this; + } + + /** + * Get the targetResult property: Query analysis result from the target. + * + * @return the targetResult value. + */ + public ExecutionStatistics targetResult() { + return this.targetResult; + } + + /** + * Set the targetResult property: Query analysis result from the target. + * + * @param targetResult the targetResult value to set. + * @return the QueryExecutionResult object itself. + */ + public QueryExecutionResult withTargetResult(ExecutionStatistics targetResult) { + this.targetResult = targetResult; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceResult() != null) { + sourceResult().validate(); + } + if (targetResult() != null) { + targetResult().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Quota.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Quota.java new file mode 100644 index 000000000000..d626921000d9 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Quota.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.datamigration.models; + +import com.azure.resourcemanager.datamigration.fluent.models.QuotaInner; + +/** An immutable client-side representation of Quota. */ +public interface Quota { + /** + * Gets the currentValue property: The current value of the quota. If null or missing, the current value cannot be + * determined in the context of the request. + * + * @return the currentValue value. + */ + Double currentValue(); + + /** + * Gets the id property: The resource ID of the quota object. + * + * @return the id value. + */ + String id(); + + /** + * Gets the limit property: The maximum value of the quota. If null or missing, the quota has no maximum, in which + * case it merely tracks usage. + * + * @return the limit value. + */ + Double limit(); + + /** + * Gets the name property: The name of the quota. + * + * @return the name value. + */ + QuotaName name(); + + /** + * Gets the unit property: The unit for the quota, such as Count, Bytes, BytesPerSecond, etc. + * + * @return the unit value. + */ + String unit(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.QuotaInner object. + * + * @return the inner object. + */ + QuotaInner innerModel(); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QuotaList.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QuotaList.java new file mode 100644 index 000000000000..20110a3d3db3 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QuotaList.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.models.QuotaInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** OData page of quota objects. */ +@Fluent +public final class QuotaList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotaList.class); + + /* + * List of quotas + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to load the next page of quotas, or null or missing if this is the + * last page + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of quotas. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of quotas. + * + * @param value the value value to set. + * @return the QuotaList object itself. + */ + public QuotaList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to load the next page of quotas, or null or missing if this is the last page. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to load the next page of quotas, or null or missing if this is the last page. + * + * @param nextLink the nextLink value to set. + * @return the QuotaList object itself. + */ + public QuotaList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QuotaName.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QuotaName.java new file mode 100644 index 000000000000..b92d1102bd08 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/QuotaName.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.datamigration.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 name of the quota. */ +@Fluent +public final class QuotaName { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotaName.class); + + /* + * The localized name of the quota + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /* + * The unlocalized name (or ID) of the quota + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the localizedValue property: The localized name of the quota. + * + * @return the localizedValue value. + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set the localizedValue property: The localized name of the quota. + * + * @param localizedValue the localizedValue value to set. + * @return the QuotaName object itself. + */ + public QuotaName withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + + /** + * Get the value property: The unlocalized name (or ID) of the quota. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The unlocalized name (or ID) of the quota. + * + * @param value the value value to set. + * @return the QuotaName object itself. + */ + public QuotaName withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ReplicateMigrationState.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ReplicateMigrationState.java new file mode 100644 index 000000000000..673d89c6a41e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ReplicateMigrationState.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ReplicateMigrationState. */ +public final class ReplicateMigrationState extends ExpandableStringEnum { + /** Static value UNDEFINED for ReplicateMigrationState. */ + public static final ReplicateMigrationState UNDEFINED = fromString("UNDEFINED"); + + /** Static value VALIDATING for ReplicateMigrationState. */ + public static final ReplicateMigrationState VALIDATING = fromString("VALIDATING"); + + /** Static value PENDING for ReplicateMigrationState. */ + public static final ReplicateMigrationState PENDING = fromString("PENDING"); + + /** Static value COMPLETE for ReplicateMigrationState. */ + public static final ReplicateMigrationState COMPLETE = fromString("COMPLETE"); + + /** Static value ACTION_REQUIRED for ReplicateMigrationState. */ + public static final ReplicateMigrationState ACTION_REQUIRED = fromString("ACTION_REQUIRED"); + + /** Static value FAILED for ReplicateMigrationState. */ + public static final ReplicateMigrationState FAILED = fromString("FAILED"); + + /** + * Creates or finds a ReplicateMigrationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReplicateMigrationState. + */ + @JsonCreator + public static ReplicateMigrationState fromString(String name) { + return fromString(name, ReplicateMigrationState.class); + } + + /** @return known ReplicateMigrationState values. */ + public static Collection values() { + return values(ReplicateMigrationState.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ReportableException.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ReportableException.java new file mode 100644 index 000000000000..20ae37d6b8bd --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ReportableException.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Exception object for all custom exceptions. */ +@Fluent +public final class ReportableException { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReportableException.class); + + /* + * Error message + */ + @JsonProperty(value = "message") + private String message; + + /* + * Actionable steps for this exception + */ + @JsonProperty(value = "actionableMessage") + private String actionableMessage; + + /* + * The path to the file where exception occurred + */ + @JsonProperty(value = "filePath") + private String filePath; + + /* + * The line number where exception occurred + */ + @JsonProperty(value = "lineNumber") + private String lineNumber; + + /* + * Coded numerical value that is assigned to a specific exception + */ + @JsonProperty(value = "hResult") + private Integer hResult; + + /* + * Stack trace + */ + @JsonProperty(value = "stackTrace") + private String stackTrace; + + /** + * Get the message property: Error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Error message. + * + * @param message the message value to set. + * @return the ReportableException object itself. + */ + public ReportableException withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the actionableMessage property: Actionable steps for this exception. + * + * @return the actionableMessage value. + */ + public String actionableMessage() { + return this.actionableMessage; + } + + /** + * Set the actionableMessage property: Actionable steps for this exception. + * + * @param actionableMessage the actionableMessage value to set. + * @return the ReportableException object itself. + */ + public ReportableException withActionableMessage(String actionableMessage) { + this.actionableMessage = actionableMessage; + return this; + } + + /** + * Get the filePath property: The path to the file where exception occurred. + * + * @return the filePath value. + */ + public String filePath() { + return this.filePath; + } + + /** + * Set the filePath property: The path to the file where exception occurred. + * + * @param filePath the filePath value to set. + * @return the ReportableException object itself. + */ + public ReportableException withFilePath(String filePath) { + this.filePath = filePath; + return this; + } + + /** + * Get the lineNumber property: The line number where exception occurred. + * + * @return the lineNumber value. + */ + public String lineNumber() { + return this.lineNumber; + } + + /** + * Set the lineNumber property: The line number where exception occurred. + * + * @param lineNumber the lineNumber value to set. + * @return the ReportableException object itself. + */ + public ReportableException withLineNumber(String lineNumber) { + this.lineNumber = lineNumber; + return this; + } + + /** + * Get the hResult property: Coded numerical value that is assigned to a specific exception. + * + * @return the hResult value. + */ + public Integer hResult() { + return this.hResult; + } + + /** + * Set the hResult property: Coded numerical value that is assigned to a specific exception. + * + * @param hResult the hResult value to set. + * @return the ReportableException object itself. + */ + public ReportableException withHResult(Integer hResult) { + this.hResult = hResult; + return this; + } + + /** + * Get the stackTrace property: Stack trace. + * + * @return the stackTrace value. + */ + public String stackTrace() { + return this.stackTrace; + } + + /** + * Set the stackTrace property: Stack trace. + * + * @param stackTrace the stackTrace value to set. + * @return the ReportableException object itself. + */ + public ReportableException withStackTrace(String stackTrace) { + this.stackTrace = stackTrace; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSku.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSku.java new file mode 100644 index 000000000000..889a64dc771b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSku.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.resourcemanager.datamigration.fluent.models.ResourceSkuInner; +import java.util.List; + +/** An immutable client-side representation of ResourceSku. */ +public interface ResourceSku { + /** + * Gets the resourceType property: The type of resource the SKU applies to. + * + * @return the resourceType value. + */ + String resourceType(); + + /** + * Gets the name property: The name of SKU. + * + * @return the name value. + */ + String name(); + + /** + * Gets the tier property: Specifies the tier of DMS in a scale set. + * + * @return the tier value. + */ + String tier(); + + /** + * Gets the size property: The Size of the SKU. + * + * @return the size value. + */ + String size(); + + /** + * Gets the family property: The Family of this particular SKU. + * + * @return the family value. + */ + String family(); + + /** + * Gets the kind property: The Kind of resources that are supported in this SKU. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the capacity property: Not used. + * + * @return the capacity value. + */ + ResourceSkuCapacity capacity(); + + /** + * Gets the locations property: The set of locations that the SKU is available. + * + * @return the locations value. + */ + List locations(); + + /** + * Gets the apiVersions property: The api versions that support this SKU. + * + * @return the apiVersions value. + */ + List apiVersions(); + + /** + * Gets the costs property: Metadata for retrieving price info. + * + * @return the costs value. + */ + List costs(); + + /** + * Gets the capabilities property: A name value pair to describe the capability. + * + * @return the capabilities value. + */ + List capabilities(); + + /** + * Gets the restrictions property: The restrictions because of which SKU cannot be used. This is empty if there are + * no restrictions. + * + * @return the restrictions value. + */ + List restrictions(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.ResourceSkuInner object. + * + * @return the inner object. + */ + ResourceSkuInner innerModel(); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuCapabilities.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuCapabilities.java new file mode 100644 index 000000000000..f4c7dceb5684 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuCapabilities.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.datamigration.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; + +/** Describes The SKU capabilities object. */ +@Immutable +public final class ResourceSkuCapabilities { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuCapabilities.class); + + /* + * An invariant to describe the feature. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * An invariant if the feature is measured by quantity. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get the name property: An invariant to describe the feature. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the value property: An invariant if the feature is measured by quantity. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuCapacity.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuCapacity.java new file mode 100644 index 000000000000..538537a2b602 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuCapacity.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.datamigration.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; + +/** Describes scaling information of a SKU. */ +@Immutable +public final class ResourceSkuCapacity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuCapacity.class); + + /* + * The minimum capacity. + */ + @JsonProperty(value = "minimum", access = JsonProperty.Access.WRITE_ONLY) + private Long minimum; + + /* + * The maximum capacity. + */ + @JsonProperty(value = "maximum", access = JsonProperty.Access.WRITE_ONLY) + private Long maximum; + + /* + * The default capacity. + */ + @JsonProperty(value = "default", access = JsonProperty.Access.WRITE_ONLY) + private Long defaultProperty; + + /* + * The scale type applicable to the SKU. + */ + @JsonProperty(value = "scaleType", access = JsonProperty.Access.WRITE_ONLY) + private ResourceSkuCapacityScaleType scaleType; + + /** + * Get the minimum property: The minimum capacity. + * + * @return the minimum value. + */ + public Long minimum() { + return this.minimum; + } + + /** + * Get the maximum property: The maximum capacity. + * + * @return the maximum value. + */ + public Long maximum() { + return this.maximum; + } + + /** + * Get the defaultProperty property: The default capacity. + * + * @return the defaultProperty value. + */ + public Long defaultProperty() { + return this.defaultProperty; + } + + /** + * Get the scaleType property: The scale type applicable to the SKU. + * + * @return the scaleType value. + */ + public ResourceSkuCapacityScaleType scaleType() { + return this.scaleType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuCapacityScaleType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuCapacityScaleType.java new file mode 100644 index 000000000000..de230b4ccd96 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuCapacityScaleType.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ResourceSkuCapacityScaleType. */ +public final class ResourceSkuCapacityScaleType extends ExpandableStringEnum { + /** Static value Automatic for ResourceSkuCapacityScaleType. */ + public static final ResourceSkuCapacityScaleType AUTOMATIC = fromString("Automatic"); + + /** Static value Manual for ResourceSkuCapacityScaleType. */ + public static final ResourceSkuCapacityScaleType MANUAL = fromString("Manual"); + + /** Static value None for ResourceSkuCapacityScaleType. */ + public static final ResourceSkuCapacityScaleType NONE = fromString("None"); + + /** + * Creates or finds a ResourceSkuCapacityScaleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceSkuCapacityScaleType. + */ + @JsonCreator + public static ResourceSkuCapacityScaleType fromString(String name) { + return fromString(name, ResourceSkuCapacityScaleType.class); + } + + /** @return known ResourceSkuCapacityScaleType values. */ + public static Collection values() { + return values(ResourceSkuCapacityScaleType.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuCosts.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuCosts.java new file mode 100644 index 000000000000..2c90c804e6b4 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuCosts.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.datamigration.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; + +/** Describes metadata for retrieving price info. */ +@Immutable +public final class ResourceSkuCosts { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuCosts.class); + + /* + * Used for querying price from commerce. + */ + @JsonProperty(value = "meterID", access = JsonProperty.Access.WRITE_ONLY) + private String meterId; + + /* + * The multiplier is needed to extend the base metered cost. + */ + @JsonProperty(value = "quantity", access = JsonProperty.Access.WRITE_ONLY) + private Long quantity; + + /* + * An invariant to show the extended unit. + */ + @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 multiplier is needed to extend the base metered cost. + * + * @return the quantity value. + */ + public Long quantity() { + return this.quantity; + } + + /** + * Get the extendedUnit property: An invariant to show the extended unit. + * + * @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/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuRestrictions.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuRestrictions.java new file mode 100644 index 000000000000..553fca892870 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuRestrictions.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Describes scaling information of a SKU. */ +@Immutable +public final class ResourceSkuRestrictions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuRestrictions.class); + + /* + * The type of restrictions. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private ResourceSkuRestrictionsType type; + + /* + * The value of restrictions. If the restriction type is set to location. + * This would be different locations where the SKU is restricted. + */ + @JsonProperty(value = "values", access = JsonProperty.Access.WRITE_ONLY) + private List values; + + /* + * The reason code for restriction. + */ + @JsonProperty(value = "reasonCode", access = JsonProperty.Access.WRITE_ONLY) + private ResourceSkuRestrictionsReasonCode reasonCode; + + /** + * Get the type property: The type of restrictions. + * + * @return the type value. + */ + public ResourceSkuRestrictionsType type() { + return this.type; + } + + /** + * Get the values property: The value of restrictions. If the restriction type is set to location. This would be + * different locations where the SKU is restricted. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Get the reasonCode property: The reason code for restriction. + * + * @return the reasonCode value. + */ + public ResourceSkuRestrictionsReasonCode reasonCode() { + return this.reasonCode; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuRestrictionsReasonCode.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuRestrictionsReasonCode.java new file mode 100644 index 000000000000..981c8a62d653 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuRestrictionsReasonCode.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ResourceSkuRestrictionsReasonCode. */ +public final class ResourceSkuRestrictionsReasonCode extends ExpandableStringEnum { + /** Static value QuotaId for ResourceSkuRestrictionsReasonCode. */ + public static final ResourceSkuRestrictionsReasonCode QUOTA_ID = fromString("QuotaId"); + + /** Static value NotAvailableForSubscription for ResourceSkuRestrictionsReasonCode. */ + public static final ResourceSkuRestrictionsReasonCode NOT_AVAILABLE_FOR_SUBSCRIPTION = + fromString("NotAvailableForSubscription"); + + /** + * Creates or finds a ResourceSkuRestrictionsReasonCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceSkuRestrictionsReasonCode. + */ + @JsonCreator + public static ResourceSkuRestrictionsReasonCode fromString(String name) { + return fromString(name, ResourceSkuRestrictionsReasonCode.class); + } + + /** @return known ResourceSkuRestrictionsReasonCode values. */ + public static Collection values() { + return values(ResourceSkuRestrictionsReasonCode.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuRestrictionsType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuRestrictionsType.java new file mode 100644 index 000000000000..df0c32cac14d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkuRestrictionsType.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ResourceSkuRestrictionsType. */ +public final class ResourceSkuRestrictionsType extends ExpandableStringEnum { + /** Static value location for ResourceSkuRestrictionsType. */ + public static final ResourceSkuRestrictionsType LOCATION = fromString("location"); + + /** + * Creates or finds a ResourceSkuRestrictionsType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceSkuRestrictionsType. + */ + @JsonCreator + public static ResourceSkuRestrictionsType fromString(String name) { + return fromString(name, ResourceSkuRestrictionsType.class); + } + + /** @return known ResourceSkuRestrictionsType values. */ + public static Collection values() { + return values(ResourceSkuRestrictionsType.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkus.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkus.java new file mode 100644 index 000000000000..62336798155e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkus.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.datamigration.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ResourceSkus. */ +public interface ResourceSkus { + /** + * The skus action returns the list of SKUs that DMS supports. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DMS List SKUs operation response. + */ + PagedIterable list(); + + /** + * The skus action returns the list of SKUs that DMS supports. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the DMS List SKUs operation response. + */ + PagedIterable list(Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkusResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkusResult.java new file mode 100644 index 000000000000..3fc4e6852a67 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ResourceSkusResult.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.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.models.ResourceSkuInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The DMS List SKUs operation response. */ +@Fluent +public final class ResourceSkusResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkusResult.class); + + /* + * The list of SKUs available for the subscription. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The uri to fetch the next page of DMS SKUs. Call ListNext() with this to + * fetch the next page of DMS SKUs. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of SKUs available for the subscription. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of SKUs available for the subscription. + * + * @param value the value value to set. + * @return the ResourceSkusResult object itself. + */ + public ResourceSkusResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The uri to fetch the next page of DMS SKUs. Call ListNext() with this to fetch the + * next page of DMS SKUs. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The uri to fetch the next page of DMS SKUs. Call ListNext() with this to fetch the + * next page of DMS SKUs. + * + * @param nextLink the nextLink value to set. + * @return the ResourceSkusResult object itself. + */ + public ResourceSkusResult 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 ResourceSkusResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ScenarioSource.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ScenarioSource.java new file mode 100644 index 000000000000..0772fcab1498 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ScenarioSource.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ScenarioSource. */ +public final class ScenarioSource extends ExpandableStringEnum { + /** Static value Access for ScenarioSource. */ + public static final ScenarioSource ACCESS = fromString("Access"); + + /** Static value DB2 for ScenarioSource. */ + public static final ScenarioSource DB2 = fromString("DB2"); + + /** Static value MySQL for ScenarioSource. */ + public static final ScenarioSource MY_SQL = fromString("MySQL"); + + /** Static value Oracle for ScenarioSource. */ + public static final ScenarioSource ORACLE = fromString("Oracle"); + + /** Static value SQL for ScenarioSource. */ + public static final ScenarioSource SQL = fromString("SQL"); + + /** Static value Sybase for ScenarioSource. */ + public static final ScenarioSource SYBASE = fromString("Sybase"); + + /** Static value PostgreSQL for ScenarioSource. */ + public static final ScenarioSource POSTGRE_SQL = fromString("PostgreSQL"); + + /** Static value MongoDB for ScenarioSource. */ + public static final ScenarioSource MONGO_DB = fromString("MongoDB"); + + /** Static value SQLRDS for ScenarioSource. */ + public static final ScenarioSource SQLRDS = fromString("SQLRDS"); + + /** Static value MySQLRDS for ScenarioSource. */ + public static final ScenarioSource MY_SQLRDS = fromString("MySQLRDS"); + + /** Static value PostgreSQLRDS for ScenarioSource. */ + public static final ScenarioSource POSTGRE_SQLRDS = fromString("PostgreSQLRDS"); + + /** + * Creates or finds a ScenarioSource from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScenarioSource. + */ + @JsonCreator + public static ScenarioSource fromString(String name) { + return fromString(name, ScenarioSource.class); + } + + /** @return known ScenarioSource values. */ + public static Collection values() { + return values(ScenarioSource.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ScenarioTarget.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ScenarioTarget.java new file mode 100644 index 000000000000..724316427181 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ScenarioTarget.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ScenarioTarget. */ +public final class ScenarioTarget extends ExpandableStringEnum { + /** Static value SQLServer for ScenarioTarget. */ + public static final ScenarioTarget SQLSERVER = fromString("SQLServer"); + + /** Static value SQLDB for ScenarioTarget. */ + public static final ScenarioTarget SQLDB = fromString("SQLDB"); + + /** Static value SQLDW for ScenarioTarget. */ + public static final ScenarioTarget SQLDW = fromString("SQLDW"); + + /** Static value SQLMI for ScenarioTarget. */ + public static final ScenarioTarget SQLMI = fromString("SQLMI"); + + /** Static value AzureDBForMySql for ScenarioTarget. */ + public static final ScenarioTarget AZURE_DBFOR_MY_SQL = fromString("AzureDBForMySql"); + + /** Static value AzureDBForPostgresSQL for ScenarioTarget. */ + public static final ScenarioTarget AZURE_DBFOR_POSTGRES_SQL = fromString("AzureDBForPostgresSQL"); + + /** Static value MongoDB for ScenarioTarget. */ + public static final ScenarioTarget MONGO_DB = fromString("MongoDB"); + + /** + * Creates or finds a ScenarioTarget from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScenarioTarget. + */ + @JsonCreator + public static ScenarioTarget fromString(String name) { + return fromString(name, ScenarioTarget.class); + } + + /** @return known ScenarioTarget values. */ + public static Collection values() { + return values(ScenarioTarget.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaComparisonValidationResult.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaComparisonValidationResult.java new file mode 100644 index 000000000000..a76159c5fd74 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaComparisonValidationResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Results for schema comparison between the source and target. */ +@Fluent +public final class SchemaComparisonValidationResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SchemaComparisonValidationResult.class); + + /* + * List of schema differences between the source and target databases + */ + @JsonProperty(value = "schemaDifferences") + private SchemaComparisonValidationResultType schemaDifferences; + + /* + * List of errors that happened while performing schema compare validation + */ + @JsonProperty(value = "validationErrors") + private ValidationError validationErrors; + + /* + * Count of source database objects + */ + @JsonProperty(value = "sourceDatabaseObjectCount") + private Map sourceDatabaseObjectCount; + + /* + * Count of target database objects + */ + @JsonProperty(value = "targetDatabaseObjectCount") + private Map targetDatabaseObjectCount; + + /** + * Get the schemaDifferences property: List of schema differences between the source and target databases. + * + * @return the schemaDifferences value. + */ + public SchemaComparisonValidationResultType schemaDifferences() { + return this.schemaDifferences; + } + + /** + * Set the schemaDifferences property: List of schema differences between the source and target databases. + * + * @param schemaDifferences the schemaDifferences value to set. + * @return the SchemaComparisonValidationResult object itself. + */ + public SchemaComparisonValidationResult withSchemaDifferences( + SchemaComparisonValidationResultType schemaDifferences) { + this.schemaDifferences = schemaDifferences; + return this; + } + + /** + * Get the validationErrors property: List of errors that happened while performing schema compare validation. + * + * @return the validationErrors value. + */ + public ValidationError validationErrors() { + return this.validationErrors; + } + + /** + * Set the validationErrors property: List of errors that happened while performing schema compare validation. + * + * @param validationErrors the validationErrors value to set. + * @return the SchemaComparisonValidationResult object itself. + */ + public SchemaComparisonValidationResult withValidationErrors(ValidationError validationErrors) { + this.validationErrors = validationErrors; + return this; + } + + /** + * Get the sourceDatabaseObjectCount property: Count of source database objects. + * + * @return the sourceDatabaseObjectCount value. + */ + public Map sourceDatabaseObjectCount() { + return this.sourceDatabaseObjectCount; + } + + /** + * Set the sourceDatabaseObjectCount property: Count of source database objects. + * + * @param sourceDatabaseObjectCount the sourceDatabaseObjectCount value to set. + * @return the SchemaComparisonValidationResult object itself. + */ + public SchemaComparisonValidationResult withSourceDatabaseObjectCount(Map sourceDatabaseObjectCount) { + this.sourceDatabaseObjectCount = sourceDatabaseObjectCount; + return this; + } + + /** + * Get the targetDatabaseObjectCount property: Count of target database objects. + * + * @return the targetDatabaseObjectCount value. + */ + public Map targetDatabaseObjectCount() { + return this.targetDatabaseObjectCount; + } + + /** + * Set the targetDatabaseObjectCount property: Count of target database objects. + * + * @param targetDatabaseObjectCount the targetDatabaseObjectCount value to set. + * @return the SchemaComparisonValidationResult object itself. + */ + public SchemaComparisonValidationResult withTargetDatabaseObjectCount(Map targetDatabaseObjectCount) { + this.targetDatabaseObjectCount = targetDatabaseObjectCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (schemaDifferences() != null) { + schemaDifferences().validate(); + } + if (validationErrors() != null) { + validationErrors().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaComparisonValidationResultType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaComparisonValidationResultType.java new file mode 100644 index 000000000000..07124df97fd2 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaComparisonValidationResultType.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Description about the errors happen while performing migration validation. */ +@Fluent +public final class SchemaComparisonValidationResultType { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SchemaComparisonValidationResultType.class); + + /* + * Name of the object that has the difference + */ + @JsonProperty(value = "objectName") + private String objectName; + + /* + * Type of the object that has the difference. e.g + * (Table/View/StoredProcedure) + */ + @JsonProperty(value = "objectType") + private ObjectType objectType; + + /* + * Update action type with respect to target + */ + @JsonProperty(value = "updateAction") + private UpdateActionType updateAction; + + /** + * Get the objectName property: Name of the object that has the difference. + * + * @return the objectName value. + */ + public String objectName() { + return this.objectName; + } + + /** + * Set the objectName property: Name of the object that has the difference. + * + * @param objectName the objectName value to set. + * @return the SchemaComparisonValidationResultType object itself. + */ + public SchemaComparisonValidationResultType withObjectName(String objectName) { + this.objectName = objectName; + return this; + } + + /** + * Get the objectType property: Type of the object that has the difference. e.g (Table/View/StoredProcedure). + * + * @return the objectType value. + */ + public ObjectType objectType() { + return this.objectType; + } + + /** + * Set the objectType property: Type of the object that has the difference. e.g (Table/View/StoredProcedure). + * + * @param objectType the objectType value to set. + * @return the SchemaComparisonValidationResultType object itself. + */ + public SchemaComparisonValidationResultType withObjectType(ObjectType objectType) { + this.objectType = objectType; + return this; + } + + /** + * Get the updateAction property: Update action type with respect to target. + * + * @return the updateAction value. + */ + public UpdateActionType updateAction() { + return this.updateAction; + } + + /** + * Set the updateAction property: Update action type with respect to target. + * + * @param updateAction the updateAction value to set. + * @return the SchemaComparisonValidationResultType object itself. + */ + public SchemaComparisonValidationResultType withUpdateAction(UpdateActionType updateAction) { + this.updateAction = updateAction; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationOption.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationOption.java new file mode 100644 index 000000000000..e85357365538 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationOption.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SchemaMigrationOption. */ +public final class SchemaMigrationOption extends ExpandableStringEnum { + /** Static value None for SchemaMigrationOption. */ + public static final SchemaMigrationOption NONE = fromString("None"); + + /** Static value ExtractFromSource for SchemaMigrationOption. */ + public static final SchemaMigrationOption EXTRACT_FROM_SOURCE = fromString("ExtractFromSource"); + + /** Static value UseStorageFile for SchemaMigrationOption. */ + public static final SchemaMigrationOption USE_STORAGE_FILE = fromString("UseStorageFile"); + + /** + * Creates or finds a SchemaMigrationOption from its string representation. + * + * @param name a name to look for. + * @return the corresponding SchemaMigrationOption. + */ + @JsonCreator + public static SchemaMigrationOption fromString(String name) { + return fromString(name, SchemaMigrationOption.class); + } + + /** @return known SchemaMigrationOption values. */ + public static Collection values() { + return values(SchemaMigrationOption.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationSetting.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationSetting.java new file mode 100644 index 000000000000..b07e389982e1 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationSetting.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Settings for migrating schema from source to target. */ +@Fluent +public final class SchemaMigrationSetting { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SchemaMigrationSetting.class); + + /* + * Option on how to migrate the schema + */ + @JsonProperty(value = "schemaOption") + private SchemaMigrationOption schemaOption; + + /* + * Resource Identifier of a file resource containing the uploaded schema + * file + */ + @JsonProperty(value = "fileId") + private String fileId; + + /** + * Get the schemaOption property: Option on how to migrate the schema. + * + * @return the schemaOption value. + */ + public SchemaMigrationOption schemaOption() { + return this.schemaOption; + } + + /** + * Set the schemaOption property: Option on how to migrate the schema. + * + * @param schemaOption the schemaOption value to set. + * @return the SchemaMigrationSetting object itself. + */ + public SchemaMigrationSetting withSchemaOption(SchemaMigrationOption schemaOption) { + this.schemaOption = schemaOption; + return this; + } + + /** + * Get the fileId property: Resource Identifier of a file resource containing the uploaded schema file. + * + * @return the fileId value. + */ + public String fileId() { + return this.fileId; + } + + /** + * Set the fileId property: Resource Identifier of a file resource containing the uploaded schema file. + * + * @param fileId the fileId value to set. + * @return the SchemaMigrationSetting object itself. + */ + public SchemaMigrationSetting withFileId(String fileId) { + this.fileId = fileId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationStage.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationStage.java new file mode 100644 index 000000000000..01ac4939d0d6 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SchemaMigrationStage.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SchemaMigrationStage. */ +public final class SchemaMigrationStage extends ExpandableStringEnum { + /** Static value NotStarted for SchemaMigrationStage. */ + public static final SchemaMigrationStage NOT_STARTED = fromString("NotStarted"); + + /** Static value ValidatingInputs for SchemaMigrationStage. */ + public static final SchemaMigrationStage VALIDATING_INPUTS = fromString("ValidatingInputs"); + + /** Static value CollectingObjects for SchemaMigrationStage. */ + public static final SchemaMigrationStage COLLECTING_OBJECTS = fromString("CollectingObjects"); + + /** Static value DownloadingScript for SchemaMigrationStage. */ + public static final SchemaMigrationStage DOWNLOADING_SCRIPT = fromString("DownloadingScript"); + + /** Static value GeneratingScript for SchemaMigrationStage. */ + public static final SchemaMigrationStage GENERATING_SCRIPT = fromString("GeneratingScript"); + + /** Static value UploadingScript for SchemaMigrationStage. */ + public static final SchemaMigrationStage UPLOADING_SCRIPT = fromString("UploadingScript"); + + /** Static value DeployingSchema for SchemaMigrationStage. */ + public static final SchemaMigrationStage DEPLOYING_SCHEMA = fromString("DeployingSchema"); + + /** Static value Completed for SchemaMigrationStage. */ + public static final SchemaMigrationStage COMPLETED = fromString("Completed"); + + /** Static value CompletedWithWarnings for SchemaMigrationStage. */ + public static final SchemaMigrationStage COMPLETED_WITH_WARNINGS = fromString("CompletedWithWarnings"); + + /** Static value Failed for SchemaMigrationStage. */ + public static final SchemaMigrationStage FAILED = fromString("Failed"); + + /** + * Creates or finds a SchemaMigrationStage from its string representation. + * + * @param name a name to look for. + * @return the corresponding SchemaMigrationStage. + */ + @JsonCreator + public static SchemaMigrationStage fromString(String name) { + return fromString(name, SchemaMigrationStage.class); + } + + /** @return known SchemaMigrationStage values. */ + public static Collection values() { + return values(SchemaMigrationStage.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SelectedCertificateInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SelectedCertificateInput.java new file mode 100644 index 000000000000..1347694b012d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SelectedCertificateInput.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.datamigration.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; + +/** Info for certificate to be exported for TDE enabled databases. */ +@Fluent +public final class SelectedCertificateInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SelectedCertificateInput.class); + + /* + * Name of certificate to be exported. + */ + @JsonProperty(value = "certificateName", required = true) + private String certificateName; + + /* + * Password to use for encrypting the exported certificate. + */ + @JsonProperty(value = "password", required = true) + private String password; + + /** + * Get the certificateName property: Name of certificate to be exported. + * + * @return the certificateName value. + */ + public String certificateName() { + return this.certificateName; + } + + /** + * Set the certificateName property: Name of certificate to be exported. + * + * @param certificateName the certificateName value to set. + * @return the SelectedCertificateInput object itself. + */ + public SelectedCertificateInput withCertificateName(String certificateName) { + this.certificateName = certificateName; + return this; + } + + /** + * Get the password property: Password to use for encrypting the exported certificate. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Password to use for encrypting the exported certificate. + * + * @param password the password value to set. + * @return the SelectedCertificateInput object itself. + */ + public SelectedCertificateInput withPassword(String password) { + this.password = password; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (certificateName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property certificateName in model SelectedCertificateInput")); + } + if (password() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property password in model SelectedCertificateInput")); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServerLevelPermissionsGroup.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServerLevelPermissionsGroup.java new file mode 100644 index 000000000000..7509c19f24be --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServerLevelPermissionsGroup.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.datamigration.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ServerLevelPermissionsGroup. */ +public enum ServerLevelPermissionsGroup { + /** Enum value Default. */ + DEFAULT("Default"), + + /** Enum value MigrationFromSqlServerToAzureDB. */ + MIGRATION_FROM_SQL_SERVER_TO_AZURE_DB("MigrationFromSqlServerToAzureDB"), + + /** Enum value MigrationFromSqlServerToAzureMI. */ + MIGRATION_FROM_SQL_SERVER_TO_AZURE_MI("MigrationFromSqlServerToAzureMI"), + + /** Enum value MigrationFromMySQLToAzureDBForMySQL. */ + MIGRATION_FROM_MY_SQLTO_AZURE_DBFOR_MY_SQL("MigrationFromMySQLToAzureDBForMySQL"); + + /** The actual serialized value for a ServerLevelPermissionsGroup instance. */ + private final String value; + + ServerLevelPermissionsGroup(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ServerLevelPermissionsGroup instance. + * + * @param value the serialized value to parse. + * @return the parsed ServerLevelPermissionsGroup object, or null if unable to parse. + */ + @JsonCreator + public static ServerLevelPermissionsGroup fromString(String value) { + ServerLevelPermissionsGroup[] items = ServerLevelPermissionsGroup.values(); + for (ServerLevelPermissionsGroup item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServerProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServerProperties.java new file mode 100644 index 000000000000..b9a610ed72ec --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServerProperties.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.datamigration.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; + +/** Server properties for MySQL type source. */ +@Immutable +public final class ServerProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerProperties.class); + + /* + * Name of the server platform + */ + @JsonProperty(value = "serverPlatform", access = JsonProperty.Access.WRITE_ONLY) + private String serverPlatform; + + /* + * Name of the server + */ + @JsonProperty(value = "serverName", access = JsonProperty.Access.WRITE_ONLY) + private String serverName; + + /* + * Version of the database server + */ + @JsonProperty(value = "serverVersion", access = JsonProperty.Access.WRITE_ONLY) + private String serverVersion; + + /* + * Edition of the database server + */ + @JsonProperty(value = "serverEdition", access = JsonProperty.Access.WRITE_ONLY) + private String serverEdition; + + /* + * Version of the operating system + */ + @JsonProperty(value = "serverOperatingSystemVersion", access = JsonProperty.Access.WRITE_ONLY) + private String serverOperatingSystemVersion; + + /* + * Number of databases in the server + */ + @JsonProperty(value = "serverDatabaseCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer serverDatabaseCount; + + /** + * Get the serverPlatform property: Name of the server platform. + * + * @return the serverPlatform value. + */ + public String serverPlatform() { + return this.serverPlatform; + } + + /** + * Get the serverName property: Name of the server. + * + * @return the serverName value. + */ + public String serverName() { + return this.serverName; + } + + /** + * Get the serverVersion property: Version of the database server. + * + * @return the serverVersion value. + */ + public String serverVersion() { + return this.serverVersion; + } + + /** + * Get the serverEdition property: Edition of the database server. + * + * @return the serverEdition value. + */ + public String serverEdition() { + return this.serverEdition; + } + + /** + * Get the serverOperatingSystemVersion property: Version of the operating system. + * + * @return the serverOperatingSystemVersion value. + */ + public String serverOperatingSystemVersion() { + return this.serverOperatingSystemVersion; + } + + /** + * Get the serverDatabaseCount property: Number of databases in the server. + * + * @return the serverDatabaseCount value. + */ + public Integer serverDatabaseCount() { + return this.serverDatabaseCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperation.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperation.java new file mode 100644 index 000000000000..12183bee471c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperation.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.datamigration.models; + +import com.azure.resourcemanager.datamigration.fluent.models.ServiceOperationInner; + +/** An immutable client-side representation of ServiceOperation. */ +public interface ServiceOperation { + /** + * Gets the name property: The fully qualified action name, e.g. Microsoft.DataMigration/services/read. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: Localized display text. + * + * @return the display value. + */ + ServiceOperationDisplay display(); + + /** + * Gets the inner com.azure.resourcemanager.datamigration.fluent.models.ServiceOperationInner object. + * + * @return the inner object. + */ + ServiceOperationInner innerModel(); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperationDisplay.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperationDisplay.java new file mode 100644 index 000000000000..1124553130fc --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperationDisplay.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.datamigration.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; + +/** Localized display text. */ +@Fluent +public final class ServiceOperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceOperationDisplay.class); + + /* + * The localized resource provider name + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * The localized resource type name + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * The localized operation name + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * The localized operation description + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider property: The localized resource provider name. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: The localized resource provider name. + * + * @param provider the provider value to set. + * @return the ServiceOperationDisplay object itself. + */ + public ServiceOperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: The localized resource type name. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: The localized resource type name. + * + * @param resource the resource value to set. + * @return the ServiceOperationDisplay object itself. + */ + public ServiceOperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: The localized operation name. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: The localized operation name. + * + * @param operation the operation value to set. + * @return the ServiceOperationDisplay object itself. + */ + public ServiceOperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: The localized operation description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The localized operation description. + * + * @param description the description value to set. + * @return the ServiceOperationDisplay object itself. + */ + public ServiceOperationDisplay 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/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperationList.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperationList.java new file mode 100644 index 000000000000..92399a309645 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceOperationList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.models.ServiceOperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** OData page of action (operation) objects. */ +@Fluent +public final class ServiceOperationList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceOperationList.class); + + /* + * List of actions + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to load the next page of actions + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of actions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of actions. + * + * @param value the value value to set. + * @return the ServiceOperationList object itself. + */ + public ServiceOperationList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to load the next page of actions. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to load the next page of actions. + * + * @param nextLink the nextLink value to set. + * @return the ServiceOperationList object itself. + */ + public ServiceOperationList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceProvisioningState.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceProvisioningState.java new file mode 100644 index 000000000000..6412fe57446a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceProvisioningState.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ServiceProvisioningState. */ +public final class ServiceProvisioningState extends ExpandableStringEnum { + /** Static value Accepted for ServiceProvisioningState. */ + public static final ServiceProvisioningState ACCEPTED = fromString("Accepted"); + + /** Static value Deleting for ServiceProvisioningState. */ + public static final ServiceProvisioningState DELETING = fromString("Deleting"); + + /** Static value Deploying for ServiceProvisioningState. */ + public static final ServiceProvisioningState DEPLOYING = fromString("Deploying"); + + /** Static value Stopped for ServiceProvisioningState. */ + public static final ServiceProvisioningState STOPPED = fromString("Stopped"); + + /** Static value Stopping for ServiceProvisioningState. */ + public static final ServiceProvisioningState STOPPING = fromString("Stopping"); + + /** Static value Starting for ServiceProvisioningState. */ + public static final ServiceProvisioningState STARTING = fromString("Starting"); + + /** Static value FailedToStart for ServiceProvisioningState. */ + public static final ServiceProvisioningState FAILED_TO_START = fromString("FailedToStart"); + + /** Static value FailedToStop for ServiceProvisioningState. */ + public static final ServiceProvisioningState FAILED_TO_STOP = fromString("FailedToStop"); + + /** Static value Succeeded for ServiceProvisioningState. */ + public static final ServiceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ServiceProvisioningState. */ + public static final ServiceProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a ServiceProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServiceProvisioningState. + */ + @JsonCreator + public static ServiceProvisioningState fromString(String name) { + return fromString(name, ServiceProvisioningState.class); + } + + /** @return known ServiceProvisioningState values. */ + public static Collection values() { + return values(ServiceProvisioningState.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceScalability.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceScalability.java new file mode 100644 index 000000000000..566dd630921f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceScalability.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ServiceScalability. */ +public final class ServiceScalability extends ExpandableStringEnum { + /** Static value none for ServiceScalability. */ + public static final ServiceScalability NONE = fromString("none"); + + /** Static value manual for ServiceScalability. */ + public static final ServiceScalability MANUAL = fromString("manual"); + + /** Static value automatic for ServiceScalability. */ + public static final ServiceScalability AUTOMATIC = fromString("automatic"); + + /** + * Creates or finds a ServiceScalability from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServiceScalability. + */ + @JsonCreator + public static ServiceScalability fromString(String name) { + return fromString(name, ServiceScalability.class); + } + + /** @return known ServiceScalability values. */ + public static Collection values() { + return values(ServiceScalability.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceSku.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceSku.java new file mode 100644 index 000000000000..34b483f823ce --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceSku.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An Azure SKU instance. */ +@Fluent +public final class ServiceSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceSku.class); + + /* + * The unique name of the SKU, such as 'P3' + */ + @JsonProperty(value = "name") + private String name; + + /* + * The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business + * Critical' + */ + @JsonProperty(value = "tier") + private String tier; + + /* + * The SKU family, used when the service has multiple performance classes + * within a tier, such as 'A', 'D', etc. for virtual machines + */ + @JsonProperty(value = "family") + private String family; + + /* + * The size of the SKU, used when the name alone does not denote a service + * size or when a SKU has multiple performance classes within a family, + * e.g. 'A1' for virtual machines + */ + @JsonProperty(value = "size") + private String size; + + /* + * The capacity of the SKU, if it supports scaling + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get the name property: The unique name of the SKU, such as 'P3'. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The unique name of the SKU, such as 'P3'. + * + * @param name the name value to set. + * @return the ServiceSku object itself. + */ + public ServiceSku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical'. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical'. + * + * @param tier the tier value to set. + * @return the ServiceSku object itself. + */ + public ServiceSku withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the family property: The SKU family, used when the service has multiple performance classes within a tier, + * such as 'A', 'D', etc. for virtual machines. + * + * @return the family value. + */ + public String family() { + return this.family; + } + + /** + * Set the family property: The SKU family, used when the service has multiple performance classes within a tier, + * such as 'A', 'D', etc. for virtual machines. + * + * @param family the family value to set. + * @return the ServiceSku object itself. + */ + public ServiceSku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get the size property: The size of the SKU, used when the name alone does not denote a service size or when a SKU + * has multiple performance classes within a family, e.g. 'A1' for virtual machines. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Set the size property: The size of the SKU, used when the name alone does not denote a service size or when a SKU + * has multiple performance classes within a family, e.g. 'A1' for virtual machines. + * + * @param size the size value to set. + * @return the ServiceSku object itself. + */ + public ServiceSku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the capacity property: The capacity of the SKU, if it supports scaling. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: The capacity of the SKU, if it supports scaling. + * + * @param capacity the capacity value to set. + * @return the ServiceSku object itself. + */ + public ServiceSku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceSkuList.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceSkuList.java new file mode 100644 index 000000000000..08806f034488 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceSkuList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.models.AvailableServiceSkuInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** OData page of available SKUs. */ +@Fluent +public final class ServiceSkuList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceSkuList.class); + + /* + * List of service SKUs + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to load the next page of service SKUs + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of service SKUs. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of service SKUs. + * + * @param value the value value to set. + * @return the ServiceSkuList object itself. + */ + public ServiceSkuList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to load the next page of service SKUs. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to load the next page of service SKUs. + * + * @param nextLink the nextLink value to set. + * @return the ServiceSkuList object itself. + */ + public ServiceSkuList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceTasks.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceTasks.java new file mode 100644 index 000000000000..13d6527081d4 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ServiceTasks.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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.datamigration.fluent.models.ProjectTaskInner; + +/** Resource collection API of ServiceTasks. */ +public interface ServiceTasks { + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service level tasks owned by a service resource. Some tasks may have a status of Unknown, which + * indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks. + */ + PagedIterable list(String groupName, String serviceName); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service level tasks owned by a service resource. Some tasks may have a status of Unknown, which + * indicates that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskType Filter tasks by task type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks. + */ + PagedIterable list(String groupName, String serviceName, String taskType, Context context); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PUT method creates a new service task or updates an existing one, although since service tasks have no mutable + * custom properties, there is little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 task resource. + */ + ProjectTask createOrUpdate(String groupName, String serviceName, String taskName, ProjectTaskInner parameters); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PUT method creates a new service task or updates an existing one, although since service tasks have no mutable + * custom properties, there is little reason to update an existing one. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 task resource. + */ + Response createOrUpdateWithResponse( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters, Context context); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * GET method retrieves information about a service task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 task resource. + */ + ProjectTask get(String groupName, String serviceName, String taskName); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * GET method retrieves information about a service task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param expand Expand the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource. + */ + Response getWithResponse( + String groupName, String serviceName, String taskName, String expand, Context context); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * DELETE method deletes a service task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 groupName, String serviceName, String taskName); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * DELETE method deletes a service task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String groupName, String serviceName, String taskName, Boolean deleteRunningTasks, Context context); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there + * is little reason to do so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 task resource. + */ + ProjectTask update(String groupName, String serviceName, String taskName, ProjectTaskInner parameters); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The + * PATCH method updates an existing service task, but since service tasks have no mutable custom properties, there + * is little reason to do so. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param parameters Information about the task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 task resource. + */ + Response updateWithResponse( + String groupName, String serviceName, String taskName, ProjectTaskInner parameters, Context context); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This + * method cancels a service task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 task resource. + */ + ProjectTask cancel(String groupName, String serviceName, String taskName); + + /** + * The service tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This + * method cancels a service task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param taskName Name of the Task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 task resource. + */ + Response cancelWithResponse(String groupName, String serviceName, String taskName, Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Services.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Services.java new file mode 100644 index 000000000000..9db90d592e73 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Services.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.datamigration.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 Services. */ +public interface Services { + /** + * The services resource is the top-level resource that represents the Database Migration Service. The GET method + * retrieves information about a service instance. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + DataMigrationService getByResourceGroup(String groupName, String serviceName); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The GET method + * retrieves information about a service instance. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Database Migration Service resource. + */ + Response getByResourceGroupWithResponse( + String groupName, String serviceName, Context context); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method + * deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 groupName, String serviceName, Boolean deleteRunningTasks); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method + * deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String groupName, String serviceName); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method + * deletes a service. Any running tasks will be canceled. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 groupName, String serviceName, Boolean deleteRunningTasks, Context context); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * performs a health check and returns the status of the service and virtual machine size. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service health status. + */ + DataMigrationServiceStatusResponse checkStatus(String groupName, String serviceName); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * performs a health check and returns the status of the service and virtual machine size. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service health status. + */ + Response checkStatusWithResponse( + String groupName, String serviceName, Context context); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String groupName, String serviceName); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action + * starts the service and the service can be used for data migration. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String groupName, String serviceName, Context context); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action stops + * the service and the service cannot be used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String groupName, String serviceName); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This action stops + * the service and the service cannot be used for data migration. The service owner won't be billed when the service + * is stopped. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String groupName, String serviceName, Context context); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The skus action + * returns the list of SKUs that a service resource can be updated to. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of available SKUs. + */ + PagedIterable listSkus(String groupName, String serviceName); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The skus action + * returns the list of SKUs that a service resource can be updated to. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of available SKUs. + */ + PagedIterable listSkus(String groupName, String serviceName, Context context); + + /** + * This method checks whether a proposed nested resource name is valid and available. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Requested name to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return indicates whether a proposed resource name is available. + */ + NameAvailabilityResponse checkChildrenNameAvailability( + String groupName, String serviceName, NameAvailabilityRequest parameters); + + /** + * This method checks whether a proposed nested resource name is valid and available. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param parameters Requested name to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return indicates whether a proposed resource name is available. + */ + Response checkChildrenNameAvailabilityWithResponse( + String groupName, String serviceName, NameAvailabilityRequest parameters, Context context); + + /** + * The Services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service resources in a resource group. + * + * @param groupName Name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of service objects. + */ + PagedIterable listByResourceGroup(String groupName); + + /** + * The Services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service resources in a resource group. + * + * @param groupName Name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of service objects. + */ + PagedIterable listByResourceGroup(String groupName, Context context); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service resources 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 oData page of service objects. + */ + PagedIterable list(); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of service resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of service objects. + */ + PagedIterable list(Context context); + + /** + * This method checks whether a proposed top-level resource name is valid and available. + * + * @param location The Azure region of the operation. + * @param parameters Requested name to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return indicates whether a proposed resource name is available. + */ + NameAvailabilityResponse checkNameAvailability(String location, NameAvailabilityRequest parameters); + + /** + * This method checks whether a proposed top-level resource name is valid and available. + * + * @param location The Azure region of the operation. + * @param parameters Requested name to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return indicates whether a proposed resource name is available. + */ + Response checkNameAvailabilityWithResponse( + String location, NameAvailabilityRequest parameters, Context context); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The GET method + * retrieves information about a service instance. + * + * @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 Database Migration Service resource. + */ + DataMigrationService getById(String id); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The GET method + * retrieves information about a service instance. + * + * @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 Database Migration Service resource. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method + * deletes a service. Any running tasks will be canceled. + * + * @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); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. The DELETE method + * deletes a service. Any running tasks will be canceled. + * + * @param id the resource ID. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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, Boolean deleteRunningTasks, Context context); + + /** + * Begins definition for a new DataMigrationService resource. + * + * @param name resource name. + * @return the first stage of the new DataMigrationService definition. + */ + DataMigrationService.DefinitionStages.Blank define(String name); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Severity.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Severity.java new file mode 100644 index 000000000000..498f0d2b889a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Severity.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Severity. */ +public final class Severity extends ExpandableStringEnum { + /** Static value Message for Severity. */ + public static final Severity MESSAGE = fromString("Message"); + + /** Static value Warning for Severity. */ + public static final Severity WARNING = fromString("Warning"); + + /** Static value Error for Severity. */ + public static final Severity ERROR = fromString("Error"); + + /** + * Creates or finds a Severity from its string representation. + * + * @param name a name to look for. + * @return the corresponding Severity. + */ + @JsonCreator + public static Severity fromString(String name) { + return fromString(name, Severity.class); + } + + /** @return known Severity values. */ + public static Collection values() { + return values(Severity.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlConnectionInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlConnectionInfo.java new file mode 100644 index 000000000000..99fa52e29e19 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlConnectionInfo.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Information for connecting to SQL database server. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("SqlConnectionInfo") +@Fluent +public final class SqlConnectionInfo extends ConnectionInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlConnectionInfo.class); + + /* + * Data source in the format + * Protocol:MachineName\SQLServerInstanceName,PortNumber + */ + @JsonProperty(value = "dataSource", required = true) + private String dataSource; + + /* + * Authentication type to use for connection + */ + @JsonProperty(value = "authentication") + private AuthenticationType authentication; + + /* + * Whether to encrypt the connection + */ + @JsonProperty(value = "encryptConnection") + private Boolean encryptConnection; + + /* + * Additional connection settings + */ + @JsonProperty(value = "additionalSettings") + private String additionalSettings; + + /* + * Whether to trust the server certificate + */ + @JsonProperty(value = "trustServerCertificate") + private Boolean trustServerCertificate; + + /* + * Server platform type for connection + */ + @JsonProperty(value = "platform") + private SqlSourcePlatform platform; + + /** + * Get the dataSource property: Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber. + * + * @return the dataSource value. + */ + public String dataSource() { + return this.dataSource; + } + + /** + * Set the dataSource property: Data source in the format Protocol:MachineName\SQLServerInstanceName,PortNumber. + * + * @param dataSource the dataSource value to set. + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withDataSource(String dataSource) { + this.dataSource = dataSource; + return this; + } + + /** + * Get the authentication property: Authentication type to use for connection. + * + * @return the authentication value. + */ + public AuthenticationType authentication() { + return this.authentication; + } + + /** + * Set the authentication property: Authentication type to use for connection. + * + * @param authentication the authentication value to set. + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withAuthentication(AuthenticationType authentication) { + this.authentication = authentication; + return this; + } + + /** + * Get the encryptConnection property: Whether to encrypt the connection. + * + * @return the encryptConnection value. + */ + public Boolean encryptConnection() { + return this.encryptConnection; + } + + /** + * Set the encryptConnection property: Whether to encrypt the connection. + * + * @param encryptConnection the encryptConnection value to set. + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withEncryptConnection(Boolean encryptConnection) { + this.encryptConnection = encryptConnection; + return this; + } + + /** + * Get the additionalSettings property: Additional connection settings. + * + * @return the additionalSettings value. + */ + public String additionalSettings() { + return this.additionalSettings; + } + + /** + * Set the additionalSettings property: Additional connection settings. + * + * @param additionalSettings the additionalSettings value to set. + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withAdditionalSettings(String additionalSettings) { + this.additionalSettings = additionalSettings; + return this; + } + + /** + * Get the trustServerCertificate property: Whether to trust the server certificate. + * + * @return the trustServerCertificate value. + */ + public Boolean trustServerCertificate() { + return this.trustServerCertificate; + } + + /** + * Set the trustServerCertificate property: Whether to trust the server certificate. + * + * @param trustServerCertificate the trustServerCertificate value to set. + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withTrustServerCertificate(Boolean trustServerCertificate) { + this.trustServerCertificate = trustServerCertificate; + return this; + } + + /** + * Get the platform property: Server platform type for connection. + * + * @return the platform value. + */ + public SqlSourcePlatform platform() { + return this.platform; + } + + /** + * Set the platform property: Server platform type for connection. + * + * @param platform the platform value to set. + * @return the SqlConnectionInfo object itself. + */ + public SqlConnectionInfo withPlatform(SqlSourcePlatform platform) { + this.platform = platform; + return this; + } + + /** {@inheritDoc} */ + @Override + public SqlConnectionInfo withUsername(String username) { + super.withUsername(username); + return this; + } + + /** {@inheritDoc} */ + @Override + public SqlConnectionInfo withPassword(String password) { + super.withPassword(password); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (dataSource() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property dataSource in model SqlConnectionInfo")); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationTaskInput.java new file mode 100644 index 000000000000..7769b111dc87 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlMigrationTaskInput.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Base class for migration task input. */ +@Fluent +public class SqlMigrationTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlMigrationTaskInput.class); + + /* + * Information for connecting to source + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private SqlConnectionInfo sourceConnectionInfo; + + /* + * Information for connecting to target + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private SqlConnectionInfo targetConnectionInfo; + + /** + * Get the sourceConnectionInfo property: Information for connecting to source. + * + * @return the sourceConnectionInfo value. + */ + public SqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set the sourceConnectionInfo property: Information for connecting to source. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set. + * @return the SqlMigrationTaskInput object itself. + */ + public SqlMigrationTaskInput withSourceConnectionInfo(SqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get the targetConnectionInfo property: Information for connecting to target. + * + * @return the targetConnectionInfo value. + */ + public SqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set the targetConnectionInfo property: Information for connecting to target. + * + * @param targetConnectionInfo the targetConnectionInfo value to set. + * @return the SqlMigrationTaskInput object itself. + */ + public SqlMigrationTaskInput withTargetConnectionInfo(SqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceConnectionInfo in model SqlMigrationTaskInput")); + } else { + sourceConnectionInfo().validate(); + } + if (targetConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetConnectionInfo in model SqlMigrationTaskInput")); + } else { + targetConnectionInfo().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlServerSqlMISyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlServerSqlMISyncTaskInput.java new file mode 100644 index 000000000000..c1d7ff665251 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlServerSqlMISyncTaskInput.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. */ +@Fluent +public class SqlServerSqlMISyncTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlServerSqlMISyncTaskInput.class); + + /* + * Databases to migrate + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /* + * Backup file share information for all selected databases. + */ + @JsonProperty(value = "backupFileShare") + private FileShare backupFileShare; + + /* + * Fully qualified resourceId of storage + */ + @JsonProperty(value = "storageResourceId", required = true) + private String storageResourceId; + + /* + * Connection information for source SQL Server + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private SqlConnectionInfo sourceConnectionInfo; + + /* + * Connection information for Azure SQL Database Managed Instance + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private MiSqlConnectionInfo targetConnectionInfo; + + /* + * Azure Active Directory Application the DMS instance will use to connect + * to the target instance of Azure SQL Database Managed Instance and the + * Azure Storage Account + */ + @JsonProperty(value = "azureApp", required = true) + private AzureActiveDirectoryApp azureApp; + + /** + * Get the selectedDatabases property: Databases to migrate. + * + * @return the selectedDatabases value. + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set the selectedDatabases property: Databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set. + * @return the SqlServerSqlMISyncTaskInput object itself. + */ + public SqlServerSqlMISyncTaskInput withSelectedDatabases( + List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Get the backupFileShare property: Backup file share information for all selected databases. + * + * @return the backupFileShare value. + */ + public FileShare backupFileShare() { + return this.backupFileShare; + } + + /** + * Set the backupFileShare property: Backup file share information for all selected databases. + * + * @param backupFileShare the backupFileShare value to set. + * @return the SqlServerSqlMISyncTaskInput object itself. + */ + public SqlServerSqlMISyncTaskInput withBackupFileShare(FileShare backupFileShare) { + this.backupFileShare = backupFileShare; + return this; + } + + /** + * Get the storageResourceId property: Fully qualified resourceId of storage. + * + * @return the storageResourceId value. + */ + public String storageResourceId() { + return this.storageResourceId; + } + + /** + * Set the storageResourceId property: Fully qualified resourceId of storage. + * + * @param storageResourceId the storageResourceId value to set. + * @return the SqlServerSqlMISyncTaskInput object itself. + */ + public SqlServerSqlMISyncTaskInput withStorageResourceId(String storageResourceId) { + this.storageResourceId = storageResourceId; + return this; + } + + /** + * Get the sourceConnectionInfo property: Connection information for source SQL Server. + * + * @return the sourceConnectionInfo value. + */ + public SqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set the sourceConnectionInfo property: Connection information for source SQL Server. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set. + * @return the SqlServerSqlMISyncTaskInput object itself. + */ + public SqlServerSqlMISyncTaskInput withSourceConnectionInfo(SqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get the targetConnectionInfo property: Connection information for Azure SQL Database Managed Instance. + * + * @return the targetConnectionInfo value. + */ + public MiSqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set the targetConnectionInfo property: Connection information for Azure SQL Database Managed Instance. + * + * @param targetConnectionInfo the targetConnectionInfo value to set. + * @return the SqlServerSqlMISyncTaskInput object itself. + */ + public SqlServerSqlMISyncTaskInput withTargetConnectionInfo(MiSqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Get the azureApp property: Azure Active Directory Application the DMS instance will use to connect to the target + * instance of Azure SQL Database Managed Instance and the Azure Storage Account. + * + * @return the azureApp value. + */ + public AzureActiveDirectoryApp azureApp() { + return this.azureApp; + } + + /** + * Set the azureApp property: Azure Active Directory Application the DMS instance will use to connect to the target + * instance of Azure SQL Database Managed Instance and the Azure Storage Account. + * + * @param azureApp the azureApp value to set. + * @return the SqlServerSqlMISyncTaskInput object itself. + */ + public SqlServerSqlMISyncTaskInput withAzureApp(AzureActiveDirectoryApp azureApp) { + this.azureApp = azureApp; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (selectedDatabases() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectedDatabases in model SqlServerSqlMISyncTaskInput")); + } else { + selectedDatabases().forEach(e -> e.validate()); + } + if (backupFileShare() != null) { + backupFileShare().validate(); + } + if (storageResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storageResourceId in model SqlServerSqlMISyncTaskInput")); + } + if (sourceConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceConnectionInfo in model SqlServerSqlMISyncTaskInput")); + } else { + sourceConnectionInfo().validate(); + } + if (targetConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetConnectionInfo in model SqlServerSqlMISyncTaskInput")); + } else { + targetConnectionInfo().validate(); + } + if (azureApp() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property azureApp in model SqlServerSqlMISyncTaskInput")); + } else { + azureApp().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlSourcePlatform.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlSourcePlatform.java new file mode 100644 index 000000000000..e7e60e1abe5b --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SqlSourcePlatform.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SqlSourcePlatform. */ +public final class SqlSourcePlatform extends ExpandableStringEnum { + /** Static value SqlOnPrem for SqlSourcePlatform. */ + public static final SqlSourcePlatform SQL_ON_PREM = fromString("SqlOnPrem"); + + /** + * Creates or finds a SqlSourcePlatform from its string representation. + * + * @param name a name to look for. + * @return the corresponding SqlSourcePlatform. + */ + @JsonCreator + public static SqlSourcePlatform fromString(String name) { + return fromString(name, SqlSourcePlatform.class); + } + + /** @return known SqlSourcePlatform values. */ + public static Collection values() { + return values(SqlSourcePlatform.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationInfo.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationInfo.java new file mode 100644 index 000000000000..5112d1135985 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationInfo.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.datamigration.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; + +/** SSIS migration info with SSIS store type, overwrite policy. */ +@Fluent +public final class SsisMigrationInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SsisMigrationInfo.class); + + /* + * The SSIS store type of source, only SSIS catalog is supported now in DMS + */ + @JsonProperty(value = "ssisStoreType") + private SsisStoreType ssisStoreType; + + /* + * The overwrite option for the SSIS project migration + */ + @JsonProperty(value = "projectOverwriteOption") + private SsisMigrationOverwriteOption projectOverwriteOption; + + /* + * The overwrite option for the SSIS environment migration + */ + @JsonProperty(value = "environmentOverwriteOption") + private SsisMigrationOverwriteOption environmentOverwriteOption; + + /** + * Get the ssisStoreType property: The SSIS store type of source, only SSIS catalog is supported now in DMS. + * + * @return the ssisStoreType value. + */ + public SsisStoreType ssisStoreType() { + return this.ssisStoreType; + } + + /** + * Set the ssisStoreType property: The SSIS store type of source, only SSIS catalog is supported now in DMS. + * + * @param ssisStoreType the ssisStoreType value to set. + * @return the SsisMigrationInfo object itself. + */ + public SsisMigrationInfo withSsisStoreType(SsisStoreType ssisStoreType) { + this.ssisStoreType = ssisStoreType; + return this; + } + + /** + * Get the projectOverwriteOption property: The overwrite option for the SSIS project migration. + * + * @return the projectOverwriteOption value. + */ + public SsisMigrationOverwriteOption projectOverwriteOption() { + return this.projectOverwriteOption; + } + + /** + * Set the projectOverwriteOption property: The overwrite option for the SSIS project migration. + * + * @param projectOverwriteOption the projectOverwriteOption value to set. + * @return the SsisMigrationInfo object itself. + */ + public SsisMigrationInfo withProjectOverwriteOption(SsisMigrationOverwriteOption projectOverwriteOption) { + this.projectOverwriteOption = projectOverwriteOption; + return this; + } + + /** + * Get the environmentOverwriteOption property: The overwrite option for the SSIS environment migration. + * + * @return the environmentOverwriteOption value. + */ + public SsisMigrationOverwriteOption environmentOverwriteOption() { + return this.environmentOverwriteOption; + } + + /** + * Set the environmentOverwriteOption property: The overwrite option for the SSIS environment migration. + * + * @param environmentOverwriteOption the environmentOverwriteOption value to set. + * @return the SsisMigrationInfo object itself. + */ + public SsisMigrationInfo withEnvironmentOverwriteOption(SsisMigrationOverwriteOption environmentOverwriteOption) { + this.environmentOverwriteOption = environmentOverwriteOption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationOverwriteOption.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationOverwriteOption.java new file mode 100644 index 000000000000..1d96e820200d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationOverwriteOption.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SsisMigrationOverwriteOption. */ +public final class SsisMigrationOverwriteOption extends ExpandableStringEnum { + /** Static value Ignore for SsisMigrationOverwriteOption. */ + public static final SsisMigrationOverwriteOption IGNORE = fromString("Ignore"); + + /** Static value Overwrite for SsisMigrationOverwriteOption. */ + public static final SsisMigrationOverwriteOption OVERWRITE = fromString("Overwrite"); + + /** + * Creates or finds a SsisMigrationOverwriteOption from its string representation. + * + * @param name a name to look for. + * @return the corresponding SsisMigrationOverwriteOption. + */ + @JsonCreator + public static SsisMigrationOverwriteOption fromString(String name) { + return fromString(name, SsisMigrationOverwriteOption.class); + } + + /** @return known SsisMigrationOverwriteOption values. */ + public static Collection values() { + return values(SsisMigrationOverwriteOption.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationStage.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationStage.java new file mode 100644 index 000000000000..d11e703fab6d --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisMigrationStage.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SsisMigrationStage. */ +public final class SsisMigrationStage extends ExpandableStringEnum { + /** Static value None for SsisMigrationStage. */ + public static final SsisMigrationStage NONE = fromString("None"); + + /** Static value Initialize for SsisMigrationStage. */ + public static final SsisMigrationStage INITIALIZE = fromString("Initialize"); + + /** Static value InProgress for SsisMigrationStage. */ + public static final SsisMigrationStage IN_PROGRESS = fromString("InProgress"); + + /** Static value Completed for SsisMigrationStage. */ + public static final SsisMigrationStage COMPLETED = fromString("Completed"); + + /** + * Creates or finds a SsisMigrationStage from its string representation. + * + * @param name a name to look for. + * @return the corresponding SsisMigrationStage. + */ + @JsonCreator + public static SsisMigrationStage fromString(String name) { + return fromString(name, SsisMigrationStage.class); + } + + /** @return known SsisMigrationStage values. */ + public static Collection values() { + return values(SsisMigrationStage.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisStoreType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisStoreType.java new file mode 100644 index 000000000000..e68f7978f945 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SsisStoreType.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SsisStoreType. */ +public final class SsisStoreType extends ExpandableStringEnum { + /** Static value SsisCatalog for SsisStoreType. */ + public static final SsisStoreType SSIS_CATALOG = fromString("SsisCatalog"); + + /** + * Creates or finds a SsisStoreType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SsisStoreType. + */ + @JsonCreator + public static SsisStoreType fromString(String name) { + return fromString(name, SsisStoreType.class); + } + + /** @return known SsisStoreType values. */ + public static Collection values() { + return values(SsisStoreType.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SyncDatabaseMigrationReportingState.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SyncDatabaseMigrationReportingState.java new file mode 100644 index 000000000000..3c123af0bd59 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SyncDatabaseMigrationReportingState.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SyncDatabaseMigrationReportingState. */ +public final class SyncDatabaseMigrationReportingState + extends ExpandableStringEnum { + /** Static value UNDEFINED for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState UNDEFINED = fromString("UNDEFINED"); + + /** Static value CONFIGURING for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState CONFIGURING = fromString("CONFIGURING"); + + /** Static value INITIALIAZING for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState INITIALIAZING = fromString("INITIALIAZING"); + + /** Static value STARTING for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState STARTING = fromString("STARTING"); + + /** Static value RUNNING for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState RUNNING = fromString("RUNNING"); + + /** Static value READY_TO_COMPLETE for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState READY_TO_COMPLETE = fromString("READY_TO_COMPLETE"); + + /** Static value COMPLETING for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState COMPLETING = fromString("COMPLETING"); + + /** Static value COMPLETE for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState COMPLETE = fromString("COMPLETE"); + + /** Static value CANCELLING for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState CANCELLING = fromString("CANCELLING"); + + /** Static value CANCELLED for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState CANCELLED = fromString("CANCELLED"); + + /** Static value FAILED for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState FAILED = fromString("FAILED"); + + /** Static value VALIDATING for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState VALIDATING = fromString("VALIDATING"); + + /** Static value VALIDATION_COMPLETE for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState VALIDATION_COMPLETE = fromString("VALIDATION_COMPLETE"); + + /** Static value VALIDATION_FAILED for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState VALIDATION_FAILED = fromString("VALIDATION_FAILED"); + + /** Static value RESTORE_IN_PROGRESS for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState RESTORE_IN_PROGRESS = fromString("RESTORE_IN_PROGRESS"); + + /** Static value RESTORE_COMPLETED for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState RESTORE_COMPLETED = fromString("RESTORE_COMPLETED"); + + /** Static value BACKUP_IN_PROGRESS for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState BACKUP_IN_PROGRESS = fromString("BACKUP_IN_PROGRESS"); + + /** Static value BACKUP_COMPLETED for SyncDatabaseMigrationReportingState. */ + public static final SyncDatabaseMigrationReportingState BACKUP_COMPLETED = fromString("BACKUP_COMPLETED"); + + /** + * Creates or finds a SyncDatabaseMigrationReportingState from its string representation. + * + * @param name a name to look for. + * @return the corresponding SyncDatabaseMigrationReportingState. + */ + @JsonCreator + public static SyncDatabaseMigrationReportingState fromString(String name) { + return fromString(name, SyncDatabaseMigrationReportingState.class); + } + + /** @return known SyncDatabaseMigrationReportingState values. */ + public static Collection values() { + return values(SyncDatabaseMigrationReportingState.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SyncMigrationDatabaseErrorEvent.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SyncMigrationDatabaseErrorEvent.java new file mode 100644 index 000000000000..5949daccac34 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SyncMigrationDatabaseErrorEvent.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.datamigration.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; + +/** Database migration errors for online migration. */ +@Immutable +public final class SyncMigrationDatabaseErrorEvent { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SyncMigrationDatabaseErrorEvent.class); + + /* + * String value of timestamp. + */ + @JsonProperty(value = "timestampString", access = JsonProperty.Access.WRITE_ONLY) + private String timestampString; + + /* + * Event type. + */ + @JsonProperty(value = "eventTypeString", access = JsonProperty.Access.WRITE_ONLY) + private String eventTypeString; + + /* + * Event text. + */ + @JsonProperty(value = "eventText", access = JsonProperty.Access.WRITE_ONLY) + private String eventText; + + /** + * Get the timestampString property: String value of timestamp. + * + * @return the timestampString value. + */ + public String timestampString() { + return this.timestampString; + } + + /** + * Get the eventTypeString property: Event type. + * + * @return the eventTypeString value. + */ + public String eventTypeString() { + return this.eventTypeString; + } + + /** + * Get the eventText property: Event text. + * + * @return the eventText value. + */ + public String eventText() { + return this.eventText; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SyncTableMigrationState.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SyncTableMigrationState.java new file mode 100644 index 000000000000..048e5c54a7e7 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/SyncTableMigrationState.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SyncTableMigrationState. */ +public final class SyncTableMigrationState extends ExpandableStringEnum { + /** Static value BEFORE_LOAD for SyncTableMigrationState. */ + public static final SyncTableMigrationState BEFORE_LOAD = fromString("BEFORE_LOAD"); + + /** Static value FULL_LOAD for SyncTableMigrationState. */ + public static final SyncTableMigrationState FULL_LOAD = fromString("FULL_LOAD"); + + /** Static value COMPLETED for SyncTableMigrationState. */ + public static final SyncTableMigrationState COMPLETED = fromString("COMPLETED"); + + /** Static value CANCELED for SyncTableMigrationState. */ + public static final SyncTableMigrationState CANCELED = fromString("CANCELED"); + + /** Static value ERROR for SyncTableMigrationState. */ + public static final SyncTableMigrationState ERROR = fromString("ERROR"); + + /** Static value FAILED for SyncTableMigrationState. */ + public static final SyncTableMigrationState FAILED = fromString("FAILED"); + + /** + * Creates or finds a SyncTableMigrationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding SyncTableMigrationState. + */ + @JsonCreator + public static SyncTableMigrationState fromString(String name) { + return fromString(name, SyncTableMigrationState.class); + } + + /** @return known SyncTableMigrationState values. */ + public static Collection values() { + return values(SyncTableMigrationState.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TaskList.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TaskList.java new file mode 100644 index 000000000000..fca4f3ae24d2 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TaskList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** OData page of tasks. */ +@Fluent +public final class TaskList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TaskList.class); + + /* + * List of tasks + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to load the next page of tasks + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of tasks. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of tasks. + * + * @param value the value value to set. + * @return the TaskList object itself. + */ + public TaskList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to load the next page of tasks. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to load the next page of tasks. + * + * @param nextLink the nextLink value to set. + * @return the TaskList object itself. + */ + public TaskList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TaskState.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TaskState.java new file mode 100644 index 000000000000..664b714fa7dc --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/TaskState.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TaskState. */ +public final class TaskState extends ExpandableStringEnum { + /** Static value Unknown for TaskState. */ + public static final TaskState UNKNOWN = fromString("Unknown"); + + /** Static value Queued for TaskState. */ + public static final TaskState QUEUED = fromString("Queued"); + + /** Static value Running for TaskState. */ + public static final TaskState RUNNING = fromString("Running"); + + /** Static value Canceled for TaskState. */ + public static final TaskState CANCELED = fromString("Canceled"); + + /** Static value Succeeded for TaskState. */ + public static final TaskState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for TaskState. */ + public static final TaskState FAILED = fromString("Failed"); + + /** Static value FailedInputValidation for TaskState. */ + public static final TaskState FAILED_INPUT_VALIDATION = fromString("FailedInputValidation"); + + /** Static value Faulted for TaskState. */ + public static final TaskState FAULTED = fromString("Faulted"); + + /** + * Creates or finds a TaskState from its string representation. + * + * @param name a name to look for. + * @return the corresponding TaskState. + */ + @JsonCreator + public static TaskState fromString(String name) { + return fromString(name, TaskState.class); + } + + /** @return known TaskState values. */ + public static Collection values() { + return values(TaskState.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Tasks.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Tasks.java new file mode 100644 index 000000000000..a2ae24fd6386 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Tasks.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.datamigration.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.datamigration.fluent.models.CommandPropertiesInner; + +/** Resource collection API of Tasks. */ +public interface Tasks { + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates + * that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks. + */ + PagedIterable list(String groupName, String serviceName, String projectName); + + /** + * The services resource is the top-level resource that represents the Database Migration Service. This method + * returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates + * that an error occurred while querying the status of that task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskType Filter tasks by task type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of tasks. + */ + PagedIterable list( + String groupName, String serviceName, String projectName, String taskType, Context context); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method + * retrieves information about a task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 task resource. + */ + ProjectTask get(String groupName, String serviceName, String projectName, String taskName); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method + * retrieves information about a task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param expand Expand the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource. + */ + Response getWithResponse( + String groupName, String serviceName, String projectName, String taskName, String expand, Context context); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE + * method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 groupName, String serviceName, String projectName, String taskName); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE + * method deletes a task, canceling it first if it's running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String groupName, + String serviceName, + String projectName, + String taskName, + Boolean deleteRunningTasks, + Context context); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * cancels a task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 task resource. + */ + ProjectTask cancel(String groupName, String serviceName, String projectName, String taskName); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * cancels a task if it's currently queued or running. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 task resource. + */ + Response cancelWithResponse( + String groupName, String serviceName, String projectName, String taskName, Context context); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * executes a command on a running task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Command to execute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for all types of DMS command properties. + */ + CommandProperties command( + String groupName, String serviceName, String projectName, String taskName, CommandPropertiesInner parameters); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method + * executes a command on a running task. + * + * @param groupName Name of the resource group. + * @param serviceName Name of the service. + * @param projectName Name of the project. + * @param taskName Name of the Task. + * @param parameters Command to execute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for all types of DMS command properties. + */ + Response commandWithResponse( + String groupName, + String serviceName, + String projectName, + String taskName, + CommandPropertiesInner parameters, + Context context); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method + * retrieves information about a task. + * + * @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 task resource. + */ + ProjectTask getById(String id); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET method + * retrieves information about a task. + * + * @param id the resource ID. + * @param expand Expand the response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a task resource. + */ + Response getByIdWithResponse(String id, String expand, Context context); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE + * method deletes a task, canceling it first if it's running. + * + * @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); + + /** + * The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE + * method deletes a task, canceling it first if it's running. + * + * @param id the resource ID. + * @param deleteRunningTasks Delete the resource even if it contains running tasks. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Boolean deleteRunningTasks, Context context); + + /** + * Begins definition for a new ProjectTask resource. + * + * @param name resource name. + * @return the first stage of the new ProjectTask definition. + */ + ProjectTask.DefinitionStages.Blank define(String name); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UpdateActionType.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UpdateActionType.java new file mode 100644 index 000000000000..9989f79a4123 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UpdateActionType.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for UpdateActionType. */ +public final class UpdateActionType extends ExpandableStringEnum { + /** Static value DeletedOnTarget for UpdateActionType. */ + public static final UpdateActionType DELETED_ON_TARGET = fromString("DeletedOnTarget"); + + /** Static value ChangedOnTarget for UpdateActionType. */ + public static final UpdateActionType CHANGED_ON_TARGET = fromString("ChangedOnTarget"); + + /** Static value AddedOnTarget for UpdateActionType. */ + public static final UpdateActionType ADDED_ON_TARGET = fromString("AddedOnTarget"); + + /** + * Creates or finds a UpdateActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding UpdateActionType. + */ + @JsonCreator + public static UpdateActionType fromString(String name) { + return fromString(name, UpdateActionType.class); + } + + /** @return known UpdateActionType values. */ + public static Collection values() { + return values(UpdateActionType.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskInput.java new file mode 100644 index 000000000000..8ba8bfe9b720 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskInput.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.datamigration.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; + +/** Input for the service task to upload an OCI driver. */ +@Fluent +public final class UploadOciDriverTaskInput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UploadOciDriverTaskInput.class); + + /* + * File share information for the OCI driver archive. + */ + @JsonProperty(value = "driverShare") + private FileShare driverShare; + + /** + * Get the driverShare property: File share information for the OCI driver archive. + * + * @return the driverShare value. + */ + public FileShare driverShare() { + return this.driverShare; + } + + /** + * Set the driverShare property: File share information for the OCI driver archive. + * + * @param driverShare the driverShare value to set. + * @return the UploadOciDriverTaskInput object itself. + */ + public UploadOciDriverTaskInput withDriverShare(FileShare driverShare) { + this.driverShare = driverShare; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (driverShare() != null) { + driverShare().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskOutput.java new file mode 100644 index 000000000000..0f8b925c5672 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskOutput.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Output for the service task to upload an OCI driver. */ +@Immutable +public final class UploadOciDriverTaskOutput { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UploadOciDriverTaskOutput.class); + + /* + * The name of the driver package that was validated and uploaded. + */ + @JsonProperty(value = "driverPackageName", access = JsonProperty.Access.WRITE_ONLY) + private String driverPackageName; + + /* + * Validation errors + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the driverPackageName property: The name of the driver package that was validated and uploaded. + * + * @return the driverPackageName value. + */ + public String driverPackageName() { + return this.driverPackageName; + } + + /** + * Get the validationErrors property: Validation errors. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskProperties.java new file mode 100644 index 000000000000..88c95ff03faa --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/UploadOciDriverTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that uploads an OCI driver. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Service.Upload.OCI") +@Fluent +public final class UploadOciDriverTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UploadOciDriverTaskProperties.class); + + /* + * Input for the service task to upload an OCI driver. + */ + @JsonProperty(value = "input") + private UploadOciDriverTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Input for the service task to upload an OCI driver. + * + * @return the input value. + */ + public UploadOciDriverTaskInput input() { + return this.input; + } + + /** + * Set the input property: Input for the service task to upload an OCI driver. + * + * @param input the input value to set. + * @return the UploadOciDriverTaskProperties object itself. + */ + public UploadOciDriverTaskProperties withInput(UploadOciDriverTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public UploadOciDriverTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Usages.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Usages.java new file mode 100644 index 000000000000..05413591ed3a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/Usages.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Usages. */ +public interface Usages { + /** + * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * + * @param location The Azure region of the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of quota objects. + */ + PagedIterable list(String location); + + /** + * This method returns region-specific quotas and resource usage information for the Database Migration Service. + * + * @param location The Azure region of the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return oData page of quota objects. + */ + PagedIterable list(String location, Context context); +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.java new file mode 100644 index 000000000000..c3fc582a78c8 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for task that validates migration input for SQL to Azure SQL DB sync migrations. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ValidateMigrationInput.SqlServer.SqlDb.Sync") +@Fluent +public final class ValidateMigrationInputSqlServerSqlDbSyncTaskProperties extends ProjectTaskProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ValidateMigrationInputSqlServerSqlDbSyncTaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private ValidateSyncMigrationInputSqlServerTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public ValidateSyncMigrationInputSqlServerTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the ValidateMigrationInputSqlServerSqlDbSyncTaskProperties object itself. + */ + public ValidateMigrationInputSqlServerSqlDbSyncTaskProperties withInput( + ValidateSyncMigrationInputSqlServerTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public ValidateMigrationInputSqlServerSqlDbSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMISyncTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMISyncTaskInput.java new file mode 100644 index 000000000000..18d22ee0a676 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMISyncTaskInput.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +/** Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online scenario. */ +@Immutable +public final class ValidateMigrationInputSqlServerSqlMISyncTaskInput extends SqlServerSqlMISyncTaskInput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ValidateMigrationInputSqlServerSqlMISyncTaskInput.class); + + /** {@inheritDoc} */ + @Override + public ValidateMigrationInputSqlServerSqlMISyncTaskInput withSelectedDatabases( + List selectedDatabases) { + super.withSelectedDatabases(selectedDatabases); + return this; + } + + /** {@inheritDoc} */ + @Override + public ValidateMigrationInputSqlServerSqlMISyncTaskInput withBackupFileShare(FileShare backupFileShare) { + super.withBackupFileShare(backupFileShare); + return this; + } + + /** {@inheritDoc} */ + @Override + public ValidateMigrationInputSqlServerSqlMISyncTaskInput withStorageResourceId(String storageResourceId) { + super.withStorageResourceId(storageResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public ValidateMigrationInputSqlServerSqlMISyncTaskInput withSourceConnectionInfo( + SqlConnectionInfo sourceConnectionInfo) { + super.withSourceConnectionInfo(sourceConnectionInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public ValidateMigrationInputSqlServerSqlMISyncTaskInput withTargetConnectionInfo( + MiSqlConnectionInfo targetConnectionInfo) { + super.withTargetConnectionInfo(targetConnectionInfo); + return this; + } + + /** {@inheritDoc} */ + @Override + public ValidateMigrationInputSqlServerSqlMISyncTaskInput withAzureApp(AzureActiveDirectoryApp azureApp) { + super.withAzureApp(azureApp); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMISyncTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMISyncTaskOutput.java new file mode 100644 index 000000000000..9c85e39e1c01 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMISyncTaskOutput.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Output for task that validates migration input for Azure SQL Database Managed Instance online migration. */ +@Immutable +public final class ValidateMigrationInputSqlServerSqlMISyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ValidateMigrationInputSqlServerSqlMISyncTaskOutput.class); + + /* + * Database identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Name of database + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Errors associated with a selected database object + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the id property: Database identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Name of database. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the validationErrors property: Errors associated with a selected database object. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMISyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMISyncTaskProperties.java new file mode 100644 index 000000000000..3faada05288a --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMISyncTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for task that validates migration input for SQL to Azure SQL Database Managed Instance sync scenario. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS") +@Fluent +public final class ValidateMigrationInputSqlServerSqlMISyncTaskProperties extends ProjectTaskProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ValidateMigrationInputSqlServerSqlMISyncTaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private ValidateMigrationInputSqlServerSqlMISyncTaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public ValidateMigrationInputSqlServerSqlMISyncTaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the ValidateMigrationInputSqlServerSqlMISyncTaskProperties object itself. + */ + public ValidateMigrationInputSqlServerSqlMISyncTaskProperties withInput( + ValidateMigrationInputSqlServerSqlMISyncTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public ValidateMigrationInputSqlServerSqlMISyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMITaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMITaskInput.java new file mode 100644 index 000000000000..230a476a3287 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMITaskInput.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.datamigration.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; + +/** Input for task that validates migration input for SQL to Azure SQL Managed Instance. */ +@Fluent +public final class ValidateMigrationInputSqlServerSqlMITaskInput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ValidateMigrationInputSqlServerSqlMITaskInput.class); + + /* + * Information for connecting to source + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private SqlConnectionInfo sourceConnectionInfo; + + /* + * Information for connecting to target + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private SqlConnectionInfo targetConnectionInfo; + + /* + * Databases to migrate + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /* + * Logins to migrate + */ + @JsonProperty(value = "selectedLogins") + private List selectedLogins; + + /* + * Backup file share information for all selected databases. + */ + @JsonProperty(value = "backupFileShare") + private FileShare backupFileShare; + + /* + * SAS URI of Azure Storage Account Container to be used for storing backup + * files. + */ + @JsonProperty(value = "backupBlobShare", required = true) + private BlobShare backupBlobShare; + + /* + * Backup Mode to specify whether to use existing backup or create new + * backup. + */ + @JsonProperty(value = "backupMode") + private BackupMode backupMode; + + /** + * Get the sourceConnectionInfo property: Information for connecting to source. + * + * @return the sourceConnectionInfo value. + */ + public SqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set the sourceConnectionInfo property: Information for connecting to source. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set. + * @return the ValidateMigrationInputSqlServerSqlMITaskInput object itself. + */ + public ValidateMigrationInputSqlServerSqlMITaskInput withSourceConnectionInfo( + SqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get the targetConnectionInfo property: Information for connecting to target. + * + * @return the targetConnectionInfo value. + */ + public SqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set the targetConnectionInfo property: Information for connecting to target. + * + * @param targetConnectionInfo the targetConnectionInfo value to set. + * @return the ValidateMigrationInputSqlServerSqlMITaskInput object itself. + */ + public ValidateMigrationInputSqlServerSqlMITaskInput withTargetConnectionInfo( + SqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Get the selectedDatabases property: Databases to migrate. + * + * @return the selectedDatabases value. + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set the selectedDatabases property: Databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set. + * @return the ValidateMigrationInputSqlServerSqlMITaskInput object itself. + */ + public ValidateMigrationInputSqlServerSqlMITaskInput withSelectedDatabases( + List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Get the selectedLogins property: Logins to migrate. + * + * @return the selectedLogins value. + */ + public List selectedLogins() { + return this.selectedLogins; + } + + /** + * Set the selectedLogins property: Logins to migrate. + * + * @param selectedLogins the selectedLogins value to set. + * @return the ValidateMigrationInputSqlServerSqlMITaskInput object itself. + */ + public ValidateMigrationInputSqlServerSqlMITaskInput withSelectedLogins(List selectedLogins) { + this.selectedLogins = selectedLogins; + return this; + } + + /** + * Get the backupFileShare property: Backup file share information for all selected databases. + * + * @return the backupFileShare value. + */ + public FileShare backupFileShare() { + return this.backupFileShare; + } + + /** + * Set the backupFileShare property: Backup file share information for all selected databases. + * + * @param backupFileShare the backupFileShare value to set. + * @return the ValidateMigrationInputSqlServerSqlMITaskInput object itself. + */ + public ValidateMigrationInputSqlServerSqlMITaskInput withBackupFileShare(FileShare backupFileShare) { + this.backupFileShare = backupFileShare; + return this; + } + + /** + * Get the backupBlobShare property: SAS URI of Azure Storage Account Container to be used for storing backup files. + * + * @return the backupBlobShare value. + */ + public BlobShare backupBlobShare() { + return this.backupBlobShare; + } + + /** + * Set the backupBlobShare property: SAS URI of Azure Storage Account Container to be used for storing backup files. + * + * @param backupBlobShare the backupBlobShare value to set. + * @return the ValidateMigrationInputSqlServerSqlMITaskInput object itself. + */ + public ValidateMigrationInputSqlServerSqlMITaskInput withBackupBlobShare(BlobShare backupBlobShare) { + this.backupBlobShare = backupBlobShare; + return this; + } + + /** + * Get the backupMode property: Backup Mode to specify whether to use existing backup or create new backup. + * + * @return the backupMode value. + */ + public BackupMode backupMode() { + return this.backupMode; + } + + /** + * Set the backupMode property: Backup Mode to specify whether to use existing backup or create new backup. + * + * @param backupMode the backupMode value to set. + * @return the ValidateMigrationInputSqlServerSqlMITaskInput object itself. + */ + public ValidateMigrationInputSqlServerSqlMITaskInput withBackupMode(BackupMode backupMode) { + this.backupMode = backupMode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceConnectionInfo in model" + + " ValidateMigrationInputSqlServerSqlMITaskInput")); + } else { + sourceConnectionInfo().validate(); + } + if (targetConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetConnectionInfo in model" + + " ValidateMigrationInputSqlServerSqlMITaskInput")); + } else { + targetConnectionInfo().validate(); + } + if (selectedDatabases() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectedDatabases in model" + + " ValidateMigrationInputSqlServerSqlMITaskInput")); + } else { + selectedDatabases().forEach(e -> e.validate()); + } + if (backupFileShare() != null) { + backupFileShare().validate(); + } + if (backupBlobShare() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property backupBlobShare in model" + + " ValidateMigrationInputSqlServerSqlMITaskInput")); + } else { + backupBlobShare().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMITaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMITaskOutput.java new file mode 100644 index 000000000000..94dbac24d2af --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMITaskOutput.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Output for task that validates migration input for SQL to Azure SQL Managed Instance migrations. */ +@Fluent +public final class ValidateMigrationInputSqlServerSqlMITaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ValidateMigrationInputSqlServerSqlMITaskOutput.class); + + /* + * Result identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Name of database + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Errors associated with the RestoreDatabaseName + */ + @JsonProperty(value = "restoreDatabaseNameErrors", access = JsonProperty.Access.WRITE_ONLY) + private List restoreDatabaseNameErrors; + + /* + * Errors associated with the BackupFolder path + */ + @JsonProperty(value = "backupFolderErrors", access = JsonProperty.Access.WRITE_ONLY) + private List backupFolderErrors; + + /* + * Errors associated with backup share user name and password credentials + */ + @JsonProperty(value = "backupShareCredentialsErrors", access = JsonProperty.Access.WRITE_ONLY) + private List backupShareCredentialsErrors; + + /* + * Errors associated with the storage account provided. + */ + @JsonProperty(value = "backupStorageAccountErrors", access = JsonProperty.Access.WRITE_ONLY) + private List backupStorageAccountErrors; + + /* + * Errors associated with existing backup files. + */ + @JsonProperty(value = "existingBackupErrors", access = JsonProperty.Access.WRITE_ONLY) + private List existingBackupErrors; + + /* + * Information about backup files when existing backup mode is used. + */ + @JsonProperty(value = "databaseBackupInfo") + private DatabaseBackupInfo databaseBackupInfo; + + /** + * Get the id property: Result identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Name of database. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the restoreDatabaseNameErrors property: Errors associated with the RestoreDatabaseName. + * + * @return the restoreDatabaseNameErrors value. + */ + public List restoreDatabaseNameErrors() { + return this.restoreDatabaseNameErrors; + } + + /** + * Get the backupFolderErrors property: Errors associated with the BackupFolder path. + * + * @return the backupFolderErrors value. + */ + public List backupFolderErrors() { + return this.backupFolderErrors; + } + + /** + * Get the backupShareCredentialsErrors property: Errors associated with backup share user name and password + * credentials. + * + * @return the backupShareCredentialsErrors value. + */ + public List backupShareCredentialsErrors() { + return this.backupShareCredentialsErrors; + } + + /** + * Get the backupStorageAccountErrors property: Errors associated with the storage account provided. + * + * @return the backupStorageAccountErrors value. + */ + public List backupStorageAccountErrors() { + return this.backupStorageAccountErrors; + } + + /** + * Get the existingBackupErrors property: Errors associated with existing backup files. + * + * @return the existingBackupErrors value. + */ + public List existingBackupErrors() { + return this.existingBackupErrors; + } + + /** + * Get the databaseBackupInfo property: Information about backup files when existing backup mode is used. + * + * @return the databaseBackupInfo value. + */ + public DatabaseBackupInfo databaseBackupInfo() { + return this.databaseBackupInfo; + } + + /** + * Set the databaseBackupInfo property: Information about backup files when existing backup mode is used. + * + * @param databaseBackupInfo the databaseBackupInfo value to set. + * @return the ValidateMigrationInputSqlServerSqlMITaskOutput object itself. + */ + public ValidateMigrationInputSqlServerSqlMITaskOutput withDatabaseBackupInfo( + DatabaseBackupInfo databaseBackupInfo) { + this.databaseBackupInfo = databaseBackupInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (restoreDatabaseNameErrors() != null) { + restoreDatabaseNameErrors().forEach(e -> e.validate()); + } + if (backupFolderErrors() != null) { + backupFolderErrors().forEach(e -> e.validate()); + } + if (backupShareCredentialsErrors() != null) { + backupShareCredentialsErrors().forEach(e -> e.validate()); + } + if (backupStorageAccountErrors() != null) { + backupStorageAccountErrors().forEach(e -> e.validate()); + } + if (existingBackupErrors() != null) { + existingBackupErrors().forEach(e -> e.validate()); + } + if (databaseBackupInfo() != null) { + databaseBackupInfo().validate(); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMITaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMITaskProperties.java new file mode 100644 index 000000000000..3d82611d6126 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMigrationInputSqlServerSqlMITaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for task that validates migration input for SQL to Azure SQL Database Managed Instance. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("ValidateMigrationInput.SqlServer.AzureSqlDbMI") +@Fluent +public final class ValidateMigrationInputSqlServerSqlMITaskProperties extends ProjectTaskProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ValidateMigrationInputSqlServerSqlMITaskProperties.class); + + /* + * Task input + */ + @JsonProperty(value = "input") + private ValidateMigrationInputSqlServerSqlMITaskInput input; + + /* + * Task output. This is ignored if submitted. + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Task input. + * + * @return the input value. + */ + public ValidateMigrationInputSqlServerSqlMITaskInput input() { + return this.input; + } + + /** + * Set the input property: Task input. + * + * @param input the input value to set. + * @return the ValidateMigrationInputSqlServerSqlMITaskProperties object itself. + */ + public ValidateMigrationInputSqlServerSqlMITaskProperties withInput( + ValidateMigrationInputSqlServerSqlMITaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: Task output. This is ignored if submitted. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public ValidateMigrationInputSqlServerSqlMITaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMongoDbTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMongoDbTaskProperties.java new file mode 100644 index 000000000000..893c3623f87e --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateMongoDbTaskProperties.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.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** Properties for the task that validates a migration between MongoDB data sources. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Validate.MongoDb") +@Fluent +public final class ValidateMongoDbTaskProperties extends ProjectTaskProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidateMongoDbTaskProperties.class); + + /* + * Describes how a MongoDB data migration should be performed + */ + @JsonProperty(value = "input") + private MongoDbMigrationSettings input; + + /* + * An array containing a single MongoDbMigrationProgress object + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Describes how a MongoDB data migration should be performed. + * + * @return the input value. + */ + public MongoDbMigrationSettings input() { + return this.input; + } + + /** + * Set the input property: Describes how a MongoDB data migration should be performed. + * + * @param input the input value to set. + * @return the ValidateMongoDbTaskProperties object itself. + */ + public ValidateMongoDbTaskProperties withInput(MongoDbMigrationSettings input) { + this.input = input; + return this; + } + + /** + * Get the output property: An array containing a single MongoDbMigrationProgress object. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public ValidateMongoDbTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.java new file mode 100644 index 000000000000..a0115d61b6df --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; +import java.util.Map; + +/** + * Properties for the task that validates a migration for Oracle to Azure Database for PostgreSQL for online migrations. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "taskType") +@JsonTypeName("Validate.Oracle.AzureDbPostgreSql.Sync") +@Fluent +public final class ValidateOracleAzureDbForPostgreSqlSyncTaskProperties extends ProjectTaskProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.class); + + /* + * Input for the task that migrates Oracle databases to Azure Database for + * PostgreSQL for online migrations + */ + @JsonProperty(value = "input") + private MigrateOracleAzureDbPostgreSqlSyncTaskInput input; + + /* + * An array containing a single validation error response object + */ + @JsonProperty(value = "output", access = JsonProperty.Access.WRITE_ONLY) + private List output; + + /** + * Get the input property: Input for the task that migrates Oracle databases to Azure Database for PostgreSQL for + * online migrations. + * + * @return the input value. + */ + public MigrateOracleAzureDbPostgreSqlSyncTaskInput input() { + return this.input; + } + + /** + * Set the input property: Input for the task that migrates Oracle databases to Azure Database for PostgreSQL for + * online migrations. + * + * @param input the input value to set. + * @return the ValidateOracleAzureDbForPostgreSqlSyncTaskProperties object itself. + */ + public ValidateOracleAzureDbForPostgreSqlSyncTaskProperties withInput( + MigrateOracleAzureDbPostgreSqlSyncTaskInput input) { + this.input = input; + return this; + } + + /** + * Get the output property: An array containing a single validation error response object. + * + * @return the output value. + */ + public List output() { + return this.output; + } + + /** {@inheritDoc} */ + @Override + public ValidateOracleAzureDbForPostgreSqlSyncTaskProperties withClientData(Map clientData) { + super.withClientData(clientData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (input() != null) { + input().validate(); + } + if (output() != null) { + output().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateOracleAzureDbPostgreSqlSyncTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateOracleAzureDbPostgreSqlSyncTaskOutput.java new file mode 100644 index 000000000000..6256ba4f9e9c --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateOracleAzureDbPostgreSqlSyncTaskOutput.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.datamigration.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; + +/** Output for task that validates migration input for Oracle to Azure Database for PostgreSQL for online migrations. */ +@Immutable +public final class ValidateOracleAzureDbPostgreSqlSyncTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ValidateOracleAzureDbPostgreSqlSyncTaskOutput.class); + + /* + * Errors associated with a selected database object + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the validationErrors property: Errors associated with a selected database object. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateSyncMigrationInputSqlServerTaskInput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateSyncMigrationInputSqlServerTaskInput.java new file mode 100644 index 000000000000..c8036c3547d4 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateSyncMigrationInputSqlServerTaskInput.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.datamigration.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; + +/** Input for task that validates migration input for SQL sync migrations. */ +@Fluent +public final class ValidateSyncMigrationInputSqlServerTaskInput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ValidateSyncMigrationInputSqlServerTaskInput.class); + + /* + * Information for connecting to source SQL server + */ + @JsonProperty(value = "sourceConnectionInfo", required = true) + private SqlConnectionInfo sourceConnectionInfo; + + /* + * Information for connecting to target + */ + @JsonProperty(value = "targetConnectionInfo", required = true) + private SqlConnectionInfo targetConnectionInfo; + + /* + * Databases to migrate + */ + @JsonProperty(value = "selectedDatabases", required = true) + private List selectedDatabases; + + /** + * Get the sourceConnectionInfo property: Information for connecting to source SQL server. + * + * @return the sourceConnectionInfo value. + */ + public SqlConnectionInfo sourceConnectionInfo() { + return this.sourceConnectionInfo; + } + + /** + * Set the sourceConnectionInfo property: Information for connecting to source SQL server. + * + * @param sourceConnectionInfo the sourceConnectionInfo value to set. + * @return the ValidateSyncMigrationInputSqlServerTaskInput object itself. + */ + public ValidateSyncMigrationInputSqlServerTaskInput withSourceConnectionInfo( + SqlConnectionInfo sourceConnectionInfo) { + this.sourceConnectionInfo = sourceConnectionInfo; + return this; + } + + /** + * Get the targetConnectionInfo property: Information for connecting to target. + * + * @return the targetConnectionInfo value. + */ + public SqlConnectionInfo targetConnectionInfo() { + return this.targetConnectionInfo; + } + + /** + * Set the targetConnectionInfo property: Information for connecting to target. + * + * @param targetConnectionInfo the targetConnectionInfo value to set. + * @return the ValidateSyncMigrationInputSqlServerTaskInput object itself. + */ + public ValidateSyncMigrationInputSqlServerTaskInput withTargetConnectionInfo( + SqlConnectionInfo targetConnectionInfo) { + this.targetConnectionInfo = targetConnectionInfo; + return this; + } + + /** + * Get the selectedDatabases property: Databases to migrate. + * + * @return the selectedDatabases value. + */ + public List selectedDatabases() { + return this.selectedDatabases; + } + + /** + * Set the selectedDatabases property: Databases to migrate. + * + * @param selectedDatabases the selectedDatabases value to set. + * @return the ValidateSyncMigrationInputSqlServerTaskInput object itself. + */ + public ValidateSyncMigrationInputSqlServerTaskInput withSelectedDatabases( + List selectedDatabases) { + this.selectedDatabases = selectedDatabases; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sourceConnectionInfo in model" + + " ValidateSyncMigrationInputSqlServerTaskInput")); + } else { + sourceConnectionInfo().validate(); + } + if (targetConnectionInfo() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property targetConnectionInfo in model" + + " ValidateSyncMigrationInputSqlServerTaskInput")); + } else { + targetConnectionInfo().validate(); + } + if (selectedDatabases() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property selectedDatabases in model" + + " ValidateSyncMigrationInputSqlServerTaskInput")); + } else { + selectedDatabases().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateSyncMigrationInputSqlServerTaskOutput.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateSyncMigrationInputSqlServerTaskOutput.java new file mode 100644 index 000000000000..e56338314680 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidateSyncMigrationInputSqlServerTaskOutput.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.datamigration.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; + +/** Output for task that validates migration input for SQL sync migrations. */ +@Immutable +public final class ValidateSyncMigrationInputSqlServerTaskOutput { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ValidateSyncMigrationInputSqlServerTaskOutput.class); + + /* + * Database identifier + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Name of database + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Errors associated with a selected database object + */ + @JsonProperty(value = "validationErrors", access = JsonProperty.Access.WRITE_ONLY) + private List validationErrors; + + /** + * Get the id property: Database identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Name of database. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the validationErrors property: Errors associated with a selected database object. + * + * @return the validationErrors value. + */ + public List validationErrors() { + return this.validationErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (validationErrors() != null) { + validationErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidationError.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidationError.java new file mode 100644 index 000000000000..47aa92ad70f7 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidationError.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.datamigration.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; + +/** Description about the errors happen while performing migration validation. */ +@Fluent +public final class ValidationError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidationError.class); + + /* + * Error Text + */ + @JsonProperty(value = "text") + private String text; + + /* + * Severity of the error + */ + @JsonProperty(value = "severity") + private Severity severity; + + /** + * Get the text property: Error Text. + * + * @return the text value. + */ + public String text() { + return this.text; + } + + /** + * Set the text property: Error Text. + * + * @param text the text value to set. + * @return the ValidationError object itself. + */ + public ValidationError withText(String text) { + this.text = text; + return this; + } + + /** + * Get the severity property: Severity of the error. + * + * @return the severity value. + */ + public Severity severity() { + return this.severity; + } + + /** + * Set the severity property: Severity of the error. + * + * @param severity the severity value to set. + * @return the ValidationError object itself. + */ + public ValidationError withSeverity(Severity severity) { + this.severity = severity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidationStatus.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidationStatus.java new file mode 100644 index 000000000000..164cca7a4654 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/ValidationStatus.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.datamigration.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ValidationStatus. */ +public final class ValidationStatus extends ExpandableStringEnum { + /** Static value Default for ValidationStatus. */ + public static final ValidationStatus DEFAULT = fromString("Default"); + + /** Static value NotStarted for ValidationStatus. */ + public static final ValidationStatus NOT_STARTED = fromString("NotStarted"); + + /** Static value Initialized for ValidationStatus. */ + public static final ValidationStatus INITIALIZED = fromString("Initialized"); + + /** Static value InProgress for ValidationStatus. */ + public static final ValidationStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Completed for ValidationStatus. */ + public static final ValidationStatus COMPLETED = fromString("Completed"); + + /** Static value CompletedWithIssues for ValidationStatus. */ + public static final ValidationStatus COMPLETED_WITH_ISSUES = fromString("CompletedWithIssues"); + + /** Static value Stopped for ValidationStatus. */ + public static final ValidationStatus STOPPED = fromString("Stopped"); + + /** Static value Failed for ValidationStatus. */ + public static final ValidationStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a ValidationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ValidationStatus. + */ + @JsonCreator + public static ValidationStatus fromString(String name) { + return fromString(name, ValidationStatus.class); + } + + /** @return known ValidationStatus values. */ + public static Collection values() { + return values(ValidationStatus.class); + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/WaitStatistics.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/WaitStatistics.java new file mode 100644 index 000000000000..833d1ba0db86 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/WaitStatistics.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.datamigration.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; + +/** Wait statistics gathered during query batch execution. */ +@Fluent +public final class WaitStatistics { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WaitStatistics.class); + + /* + * Type of the Wait + */ + @JsonProperty(value = "waitType") + private String waitType; + + /* + * Total wait time in millisecond(s) + */ + @JsonProperty(value = "waitTimeMs") + private Float waitTimeMs; + + /* + * Total no. of waits + */ + @JsonProperty(value = "waitCount") + private Long waitCount; + + /** + * Get the waitType property: Type of the Wait. + * + * @return the waitType value. + */ + public String waitType() { + return this.waitType; + } + + /** + * Set the waitType property: Type of the Wait. + * + * @param waitType the waitType value to set. + * @return the WaitStatistics object itself. + */ + public WaitStatistics withWaitType(String waitType) { + this.waitType = waitType; + return this; + } + + /** + * Get the waitTimeMs property: Total wait time in millisecond(s). + * + * @return the waitTimeMs value. + */ + public Float waitTimeMs() { + return this.waitTimeMs; + } + + /** + * Set the waitTimeMs property: Total wait time in millisecond(s). + * + * @param waitTimeMs the waitTimeMs value to set. + * @return the WaitStatistics object itself. + */ + public WaitStatistics withWaitTimeMs(Float waitTimeMs) { + this.waitTimeMs = waitTimeMs; + return this; + } + + /** + * Get the waitCount property: Total no. of waits. + * + * @return the waitCount value. + */ + public Long waitCount() { + return this.waitCount; + } + + /** + * Set the waitCount property: Total no. of waits. + * + * @param waitCount the waitCount value to set. + * @return the WaitStatistics object itself. + */ + public WaitStatistics withWaitCount(Long waitCount) { + this.waitCount = waitCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/package-info.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/models/package-info.java new file mode 100644 index 000000000000..d5aeec466dfe --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/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 DataMigrationManagementClient. Data Migration Client. */ +package com.azure.resourcemanager.datamigration.models; diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/package-info.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/package-info.java new file mode 100644 index 000000000000..e3c6a93d6d6f --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/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 DataMigrationManagementClient. Data Migration Client. */ +package com.azure.resourcemanager.datamigration; diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/module-info.java b/sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/module-info.java new file mode 100644 index 000000000000..151fa2103451 --- /dev/null +++ b/sdk/datamigration/azure-resourcemanager-datamigration/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.datamigration { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.datamigration; + exports com.azure.resourcemanager.datamigration.fluent; + exports com.azure.resourcemanager.datamigration.fluent.models; + exports com.azure.resourcemanager.datamigration.models; + + opens com.azure.resourcemanager.datamigration.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.datamigration.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/datamigration/ci.yml b/sdk/datamigration/ci.yml new file mode 100644 index 000000000000..d117581b7763 --- /dev/null +++ b/sdk/datamigration/ci.yml @@ -0,0 +1,33 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - master + - main + - hotfix/* + - release/* + paths: + include: + - sdk/datamigration/ + +pr: + branches: + include: + - master + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datamigration/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: datamigration + Artifacts: + - name: azure-resourcemanager-datamigration + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerdatamigration diff --git a/sdk/datamigration/pom.xml b/sdk/datamigration/pom.xml new file mode 100644 index 000000000000..fe4af71ac42d --- /dev/null +++ b/sdk/datamigration/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-datamigration-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-datamigration + + + +